@@ -34,10 +34,11 @@ build_docker() {
3434
3535on_success () {
3636 local VERSION=$1
37+ local BRANCHNAME=$2
3738 local SUFFIX=" "
3839
39- if [ ! -z " $2 " ]; then
40- SUFFIX=$2
40+ if [ ! -z " $3 " ]; then
41+ SUFFIX=$3
4142 fi
4243
4344 local DEFAULT_MSG=" Update CLI version to $VERSION$SUFFIX "
@@ -58,11 +59,11 @@ on_success() {
5859 git tag -a $VERSION$SUFFIX -m " version $VERSION$SUFFIX "
5960
6061 echo " Pushing to Github"
61- git push origin $VERSION$SUFFIX
62+ git push origin $BRANCHNAME
6263
6364 echo " Generating release $VERSION$SUFFIX "
6465 curl --data " {\" tag_name\" : \" $VERSION$SUFFIX \" ,
65- \" target_commitish\" : \" master \" ,
66+ \" target_commitish\" : \" $BRANCHNAME \" ,
6667 \" name\" : \" v$VERSION$SUFFIX \" ,
6768 \" body\" : \" Release of version $VERSION$SUFFIX \" ,
6869 \" draft\" : false,
@@ -84,43 +85,45 @@ if [ $# -eq 0 ]; then
8485fi
8586
8687VERSION=$1
87-
88+ BRANCHNAME= " "
8889# # STANDARD VERSION
8990
9091if [[ $VERSION == 1.3.* ]]; then
91- switch_to_branch " 1.3.x"
92+ BRANCHNAME= " 1.3.x"
9293elif [[ $VERSION == 1.4.* ]]; then
93- switch_to_branch " 1.4.x"
94+ BRANCHNAME= " 1.4.x"
9495elif [[ $VERSION == 1.5.* ]]; then
95- switch_to_branch " master"
96+ BRANCHNAME= " master"
9697fi
9798
99+ switch_to_branch $BRANCHNAME
98100replace_files_with $VERSION
99101build_docker $VERSION
100102DOCKER_BUILD_RESULT=$?
101103
102104if [ $DOCKER_BUILD_RESULT -eq 0 ]; then
103- on_success $VERSION
105+ on_success $VERSION $BRANCHNAME
104106else
105107 on_error
106108fi
107109
108110# # CHROMIUM VERSION
109111
110112if [[ $VERSION == 1.3.* ]]; then
111- switch_to_branch " 1.3.x-chromium"
113+ BRANCHNAME= " 1.3.x-chromium"
112114elif [[ $VERSION == 1.4.* ]]; then
113- switch_to_branch " 1.4.x-chromium"
115+ BRANCHNAME= " 1.4.x-chromium"
114116elif [[ $VERSION == 1.5.* ]]; then
115- switch_to_branch " 1.5.x-chromium"
117+ BRANCHNAME= " 1.5.x-chromium"
116118fi
117119
120+ switch_to_branch $BRANCHNAME
118121replace_files_with $VERSION " -chromium"
119122build_docker $VERSION " -chromium"
120123DOCKER_BUILD_RESULT=$?
121124
122125if [ $DOCKER_BUILD_RESULT -eq 0 ]; then
123- on_success $VERSION " -chromium"
126+ on_success $VERSION $BRANCHNAME " -chromium"
124127else
125128 on_error
126129fi
0 commit comments