Created
September 23, 2019 05:38
-
-
Save glyphsharie/1a067a4af79dbd4c8f76e1458376a261 to your computer and use it in GitHub Desktop.
Use to release tag
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 | |
| d=`date +%Y%m%d` | |
| counter=$3 | |
| tmsg=$2 | |
| prefix=$1 | |
| echo "==================== RELEASE TAG ====================" | |
| echo Parameters to read --- Prefix: $1 --- Message: $2 --- Counter: $3 | |
| # prefix msg counter | |
| if [ -z "$1" ]; then | |
| prefix='prod' | |
| fi | |
| if [ -z "$2" ] ; then | |
| tmsg="New Tag on Enviroment: $prefix-$d-$counter" | |
| fi | |
| if [ -z "$3" ]; then | |
| counter=0 | |
| fi | |
| echo Creating $prefix-$d-$counter with message : $tmsg ... | |
| finaltag=$prefix-$d-$counter | |
| git tag -a $finaltag -m $tmsg | |
| echo Created $prefix-$d-$counter with message : $tmsg ... | |
| echo "================ NOW PUSHING TAG =====================" | |
| git push origin $finaltag | |
| echo "================ DONE PUSHING TAG =====================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment