Skip to content

Commit 1a1bfac

Browse files
committed
Update generation script
1 parent fc0b423 commit 1a1bfac

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

scripts/change-version-to

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22

3+
switch_to_branch() {
4+
local BRANCH=$1
5+
6+
git checkout -b $BRANCH
7+
git pull origin $BRANCH
8+
}
9+
310
replace_files_with() {
411
local VERSION=$1
512

@@ -28,7 +35,7 @@ on_success() {
2835
fi
2936

3037
echo "Committing files"
31-
git add Dockerfile README.txt
38+
git add Dockerfile README.md
3239
git commit -m "$COMMIT_MSG"
3340
git tag -a $VERSION -m "version $VERSION"
3441

@@ -60,6 +67,13 @@ if [ $# -eq 0 ]
6067
fi
6168

6269
VERSION=$1
70+
71+
if [[ $VERSION == 1.3.* ]]; then
72+
switch_to_branch "1.3.x"
73+
else
74+
switch_to_branch "master"
75+
fi
76+
6377
replace_files_with $VERSION
6478
build_docker $VERSION
6579
DOCKER_BUILD_RESULT=$?
@@ -70,4 +84,4 @@ else
7084
on_error
7185
fi
7286

73-
87+
switch_to_branch "master"

0 commit comments

Comments
 (0)