如何从heroku访问私有github存储库? [英] How do I access a private github repo from heroku?

查看:179
本文介绍了如何从heroku访问私有github存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个私有存储库,在部署到Heroku时会尝试访问该私有存储库.但是,Heroku不允许我克隆私人仓库,并给了我以下错误(正如我期望的那样):

I have a private repo that I'm trying to access when deploying to Heroku. However, Heroku doesn't let me clone the private repo, and gives me the following error (as i would expect):

Host key verification failed.
       fatal: The remote end hung up unexpectedly
       Git error: command `git clone
       'git@github.com:pr/lm-models.git'
       "/tmp/build_3r0z0znww0zda/vendor/bundle/ruby/1.9.1/cache/bundler/git/lm-models-aab025aaadbe07202b16e1db7505ae1726f8723a"
       --bare --no-hardlinks` in directory /tmp/build_3r0z0znww0zda has failed.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

我找到了这个,但是不想以明文显示我的用户名/密码:

I have found this, but do not want to display my username/password in clear text:

将heroku应用程序链接到私有(组织)github存储库

推荐答案

您需要在Gemfile中使用用户名/密码,或者提供依赖性.您也可以使用Gemfury(假设它是宝石):

You need to use username/password in the Gemfile, or vendor the dependency. You can also use Gemfury (assuming it's a gem):

  • https://devcenter.heroku.com/articles/git-submodules#vendoring
  • http://gembundler.com/v1.3/bundle_package.html
  • https://devcenter.heroku.com/articles/gemfury

这篇关于如何从heroku访问私有github存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆