Bash script to automate git release flow.

Ravindu Nirmal Fernando
DevOps SriLanka
Published in
2 min readApr 1, 2018

Two weeks before I got a chance to do a code release for the staging environment at my workplace. So there were simple yet easy to forget the steps involved in doing a code release for our staging environment. The truth was I honestly forgot to run the git push --tags origin command in the process.

Image Courtesy - https://stage.salesfusion.com/resource/b2b-social-media-best-practices-told-memes/

So given all the circumstances, I thought it would be great if I wrote a simple script to automate this process. I mean at least it would have stopped me making silly mistakes and I really hate keeping more than 10 commands on my head and doing it in order. Aaaaand I'm lazy...

Image Courtesy - https://engineering.upside.com/upside-engineering-diary-14-automate-all-the-things-e66ddf4a8637

As the meme above says not all, but at least do it where you can! So here is a simple bash script I wrote. Guess what! I did several releases with this thing and it was awesome!

Image Courtesy - https://imgur.com/gallery/HWPe3Hg

This does some extra work as I needed those. Feel free to modify it and use it for your own purposes. Enjoy!

--

--