Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manage hotfixes in Heroku pipeline

I have a simple Heroku deployment pipeline (review apps -> development -> staging -> production). If I push something to master then it will trigger the CI (codeship) and if the tests ran successfully the Codeship will deploy the changes to development Heroku app. It's pretty simple.

But how can we manage the hotfixes? What happen if we cannot deploy the current master to production for any reason.

I've just read an article which says that we should handle hotfixes with git tags. Is it the only way to manage hotfixes? Can we handle these without using git tags?

like image 857
Peter Kota Avatar asked Oct 07 '18 10:10

Peter Kota


People also ask

How do you use pipeline in Heroku?

A common pipeline workflow has the following steps: A developer creates a pull request to make a change to the codebase. Heroku automatically creates a review app for the pull request, allowing developers to test the change. When the change is ready, it's merged into the codebase's master branch.

What is CI CD with Heroku?

Heroku CI is a low-setup, visual test runner that integrates with Heroku Pipelines to automatically run your tests on every push to GitHub, using disposable apps with strong dev-prod parity.

What is add to pipeline in Heroku?

Setting up a Pipeline Each deployed application on Heroku is called an app, and a Pipeline is a collection of apps relating to a single codebase. Apps will exist in one of multiple stages in a Continuous Delivery workflow - review, staging and production (live).

Is heroku a CD tool?

Heroku Makes Deployment Easy “Heroku's CI/CD tools, like Review Apps, Pipelines, and CI, allow us to maintain quality standards internally, as well as enable regional physicians to test localized versions of the app right from their browser.” “It was quick and easy to set up our CI/CD workflow on Heroku.


1 Answers

master is your deployment branch. So hotfixes are done in master branch as well.

I assume you also have a development branch. So if you have ongoing work, you continue to do it on the development branch and not merge it to master.

If master is broken - you must fix it (hence the hotfix). You fix the issue, push it to master, and continue with the deployment cycle.

Then you should also cherry pick the hotfix back to your development branch.

Update

If you wish to stick with a single master branch than I cannot see a workaround working with hotfix branches.

You don't necessary need to tag one each time. But the key is to know which version is the last stable version currently in production slot.

Developers continue to work on master - it goes to staging but you asses that it cannot proceed to master.

So you:

  • create a new branch, based on the current version - this is the hotfix branch.
  • Create the fix
  • Deploy it
  • Merge it to master
like image 69
Igal S. Avatar answered Sep 27 '22 03:09

Igal S.