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?
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: