Proper continuous integration and continuous deployment with Git and Heroku

后端 未结 6 1951
醉梦人生
醉梦人生 2021-02-04 09:30

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 > CHE

6条回答
  •  星月不相逢
    2021-02-04 10:15

    to preface I am one of the founders of Codeship (https://codeship.io), which is a service that supports exactly this.

    But more on topic, basically there are 2 different ways I think this could be implemented (please keep in mind that all branch names I use are arbitrary and can be named totally different):

    staging/production in one go

    Whenever you push to your master or a specific deploy branch you run your tests and if all of them pass you first deploy to your staging app, run separate tests (Selenium or sauce labs is great for that) and if that works out including migrations you push to your production app.

    This is great as the latest version is always available in production and we use this cycle for a long time now. Works great for us. The downside is that pushing to a staging heroku app takes some time. If you want to run the migrations against a copy of your production data this takes even more time. It's not an eternity, but it takes a couple of minutes.

    staging/production as separate steps

    You could have separate staging/production branches which are deployed to the respective heroku applications. This has the advantage of being faster and you can control when to release certain parts. Especially for applications where you want external feedback before deploying to production this works great.

    We support all of that at Railsonfire, but we are currently working on a new version of our service which is way better. We integrate really well with Heroku so you don't have to think about that (but still have the option to do it yourself in any way you want)

提交回复
热议问题