如何直接从我的 Gitlab 存储库部署到 Heroku [英] How to deploy to Heroku directly from my Gitlab repository

查看:21
本文介绍了如何直接从我的 Gitlab 存储库部署到 Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的团队中,我们使用 Gitlab 作为远程存储库,因此我们正在寻找一种解决方案来将我们的应用程序自动部署到 Heroku.我们从 Github 找到了用于将应用程序自动部署到 Heroku 的 Codeship.

In my team, we use Gitlab as a remote repository, so we are looking for a solution to auto deploy our apps to Heroku. We found Codeship for auto deploying apps to Heroku from Github.

有什么建议吗?技巧?

推荐答案

如果你不准备使用 Ruby/dpl,你可以按如下方式部署到 Heroku:

If you are not prepared to use Ruby/dpl you can deploy to Heroku as follows:

查找您的 Heroku API 密钥(帐户设置 -> Heroku Web 控制台上的 API 密钥)并将其作为 Gitlab 秘密变量提供,例如HEROKU_API_KEY(请注意,这些值与 heroku auth:token 返回的值不同......)

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...)

然后在相关工作的 .gitlab-ci.yml 配置文件中添加两个脚本行:

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 HEAD:master

您可以在 http://查看详细说明blog.thecodewhisperer.com/permalink/deploying-jekyll-to-heroku-using-gitlab-ci

这篇关于如何直接从我的 Gitlab 存储库部署到 Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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