【发布时间】:2017-05-22 17:53:00
【问题描述】:
我正在将 Phoenix 应用程序部署到 Heroku,但其中一些依赖项位于私有 Gitlab 存储库中,我无法通过 SSH 访问它们。当我尝试向上推送我的应用程序时,我遇到了与依赖项之一相关的以下错误(我通常在本地机器上拥有 SSH 访问权限):
remote: -----> Fetching app dependencies with mix
remote: * Getting cool_dep (git@gitlab.com:group/cool_dep.git)
remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.
这就是我到目前为止所做的 - 如果有人能告诉我我遗漏了什么或做错了什么,我将不胜感激......
为此 Heroku 部署生成了一个新的公钥/私钥对。我将公钥放入 Gitlab 设置中的 SSH 密钥中。 (密钥没有秘密密码)
-
将
debitoor/ssh-private-keybuildpack 添加到我的 buildpack 中,这样它们的读取方式如下: -
将公钥对应的私钥添加到应用的配置中:
$ heroku config:set SSH_KEY=$(cat /Users/username/.ssh/heroku_id_rsa | base64) --app cool-app-12345 -
在应用的配置中设置 SSH 主机:
$ heroku config:set SSH_HOSTS="git@gitlab.com" --app cool-app-12345
最后,当我运行 git subtree push --prefix local_app cool-app-12345 master 时,它开始加载,但在遇到第一个私有依赖时失败。
谁能澄清我在这里遗漏了什么?为什么主机密钥验证失败?
- 还值得注意 - 我通过基本的
$ git clone ...测试了公钥/私钥对,并且效果很好,所以密钥关系是有效的......当 Heroku 参与其中时,这似乎是一个问题。
【问题讨论】:
标签: heroku ssh elixir gitlab phoenix-framework