Last active
June 4, 2019 17:50
-
-
Save workingmonk/f9e8feeabdb33f075f3adf61bc980cd3 to your computer and use it in GitHub Desktop.
Simple script to tag git repo with current date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This will create a tag "PROD_2018.09.05" with the message "Production deploy tag for September 05 2018" | |
# Example: https://github.com/SmartThingsCommunity/SmartThingsPublic/releases/tag/PROD_2018.09.05 | |
tagDate=`date +%Y.%m.%d` | |
infoDate=`date +%B\ %d\ %Y` | |
tag="PROD_$tagDate" | |
echo $tag | |
git checkout production | |
git pull | |
git tag -a $tag -m 'Production deploy tag for $infoDate' | |
git show $tag |
run the commands on repo clones not forks
git checkout production && git pull && git tag -a PROD_2019.06.04 -m 'Production deploy tag for June 4, 2019' && git push origin PROD_2019.06.04
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git checkout production && git pull && git tag -a PROD_2019.03.05 -m 'Production deploy tag for March 5, 2019' && git show PROD_2019.03.05 && git push origin PROD_2019.03.05