Deploying an app to production typically happens using some tool like Jenkins. The deployment job usually takes the Git tag as input parameter. The parameter is used to checkout the expected version of the app, build & deploy it.
Now, the tag to be used must obviously be assigned in advance. The developers probably follow a specific development/release procedure (Git Flow anyone?) and tag releases when they are “done”.
I sometimes want to deploy a version of the software which is not ready yet. A typical scenario is that I cannot reproduce a bug in my local development environment but can see it in production or staging. In this case, I’d like to deploy (to staging!) a version of the app with some debugging statements included.
The deployment tool wants a tag for deployment though. I surely just need to tag this debug version and deploy it! I tend to forget how to do this and I also want the process to be as smooth as possible.
Here’s what I defined in my shell:
Plain and stupid but it does the job. So the workflow for the described scenario is:
Using the same tag has the advantage of not polluting the repo with pretty useless debug versions. Furthermore, the browser’s form cache will remember it so you don’t have to type it out again during deployment (assuming deployment happens via a web interface).