Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我让 Jenkins 在 heroku 上运行(使用 war 文件)。我正在使用 bitbucket 并将 Jenkins 服务添加到我的私有存储库中,一切正常。
当我将更改推送到远程存储库(bitbucket)时,一切正常,并且在 Jenkins 中启动了新构建。然而,这就是我的问题所在。Jenkins 无法从远程存储库中提取,因为凭据不存在。
我想我需要为 jenkins 添加一个 ssh 密钥,但是如何在 heroku 上执行此操作?还是有其他解决方案?还是根本不可能。
谢谢您的回答。
您需要将密钥添加到 Git 或让 Jenkins 从持久存储(SQL、NoSQL、环境变量、云存储......)中获取它。将它挂接到您从 Procfile 调用的脚本中的一个好地方。
如果你把它放到 git 中(前提是你的 Git 不是公开的),告诉 Jenkins 密钥在 /app 目录下的某个地方。这可能是最简单的方法。如果您不能信任您的 Git 密钥,那么您可以(ab)使用很多插件。
希望本教程可以帮助http://www.agilogy.com/blog/heroku-staging-with-jenkins.html