使用 Git 和 Heroku 进行适当的持续集成和持续部署 [英] Proper continuous integration and continuous deployment with Git and Heroku

查看:21
本文介绍了使用 Git 和 Heroku 进行适当的持续集成和持续部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 heroku 和 git 开发一个 ruby​​ on rails 网站.

I am developing a ruby on rails website using heroku and git.

我应该使用哪些工具和功能来设置以下简单的开发流程?

What tools and features should I use to set up the following simple development process?

代码 > 签入 > 自动测试 > 自动部署

CODE > CHECK-IN > AUTO TEST > AUTO DEPLOY

  • 我将代码签入我的存储库(首选选项,托管 git,如 github)
  • 自动运行测试并且网站部署在我的登台 Heroku 应用中
  • 如果测试通过,网站会自动部署到我的生产 Heroku 应用中
  • 如果测试失败,我想以某种方式收到通知.

你会怎么做?

推荐答案

我们使用 Integrity.这是一个非常简单的解决方案 - 它不会在阳光下做所有事情,但它很容易设置和处理最常见的用例/功能.如果您希望它做更多事情,它也很容易破解.

We use Integrity. It is a pretty simple solution - it won't do everything under the sun, but it's quite easy to set up and handles the most common use cases/features. It's also pretty easy to hack on, if you want it to do more.

完整性状态:

Heroku 是部署 Integrity 最简单、最快捷的方式.

Heroku is the easiest and fastest way to deploy Integrity.

但是:

注意
Heroku 上无法通过 SSH 访问存储库

NOTE
It isn’t possible to access repositories over SSH on Heroku

这是因为您的 Integrity 应用程序需要一个 SSH 密钥.这不是不可能的,但肯定要跳几圈.您需要为 Integrity 提供一个私钥并将其放入应用程序中,然后破解 Integrity 以在启动 git clone 时使用该 ssh 密钥.

This is because your Integrity app will need an SSH key. It's not impossible, but definitely a few hoops to jump through. You'll need to give Integrity a private key and put it in the app, and then hack Integrity to use that ssh key when it initiates the git clone.

在您列出的事情中,自动部署可能是大多数人不希望他们的 CI 服务器做的事情(而且 Integrity 并没有提供开箱即用的功能).您需要配置 git 以使用该 ssh 密钥并从正确的位置(签出的存储库)启动 git push.

Of the things you listed, the automatic deploy is probably the thing most people would not expect their CI server to do (and Integrity does not provide out of the box). You'll need to configure git to use that ssh key and initiate a git push from the proper location (the checked out repository).

不幸的是,我不知道如何执行此操作的详细信息——我们实际上是在 VPS 上运行 Integrity.

Unfortunately I don't know the details of how to do this--we actually run Integrity on a VPS.

这篇关于使用 Git 和 Heroku 进行适当的持续集成和持续部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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