如何直接从我的Gitlab存储库部署到Heroku [英] How to deploy to Heroku directly from my Gitlab repository
问题描述
在我的团队中,我们使用Gitlab一个远程存储库,所以我们正在寻找一个解决方案,直接将我们的应用程序自动部署到Heroku。我们在Github上发现了自动部署应用程序到Heroku的代码。
任何提示?如果你不准备使用Ruby / dpl,你可以按如下方式部署到Heroku:
$ / $> $ / $> $ / $> $ / $> $ / $> b$ b
查找您的Heroku API密钥(帐户设置 - > Heroku Web控制台上的API密钥),并将其作为Gitlab秘密变量提供,例如HEROKU_API_KEY(请注意这些值与heroku auth:token返回的值不同)
然后在您的.gitlab-ci.yml配置文件中添加两个脚本行文件在相关的工作:
git remote add heroku https:// heroku:$ HEROKU_API_KEY@git.heroku.com/< ;您的heroku应用程序的名称> .git
git push -f heroku master
您可以在 http:// blog .thecodewhisperer.com / permalink / deployloying-jekyll-to-heroku-using-gitlab-ci
In my team, we use Gitlab a remote repository, so we are finding a solution for auto deploy we apps to Heroku directly. We found Codeship for auto deploy apps to Heroku from Github.
Any tips? Tricks?
If you are not prepared to use Ruby/dpl you can deploy to Heroku as follows:
Look up your Heroku API key (Account settings -> API Key on the Heroku web console) and make it available as a Gitlab secret variable e.g. HEROKU_API_KEY (Please note the values is not the same as what heroku auth:token returns...)
Then add two script lines in your .gitlab-ci.yml config file at the relevant job:
git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/<name of your heroku app>.git
git push -f heroku master
You can see detailed explanation at http://blog.thecodewhisperer.com/permalink/deploying-jekyll-to-heroku-using-gitlab-ci
这篇关于如何直接从我的Gitlab存储库部署到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!