From 5bd3a818a30ebc6d9292c61bed11ed71c3e33019 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 16 Nov 2019 09:29:48 -0600 Subject: [PATCH 1/3] ci: fix SC2162 in docker-versions-create.sh --- docker-versions-create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-versions-create.sh b/docker-versions-create.sh index ef0d93e5..7f154947 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -46,7 +46,7 @@ Or skip this branch merge completely. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EOL printf "Should we try again? (y):" - read answer + read -r answer if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then # If you use non-local editor or files are changed in repo cat < Date: Sat, 16 Nov 2019 09:30:06 -0600 Subject: [PATCH 2/3] ci: add batch mode to docker-versions-create.sh --- docker-versions-create.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 7f154947..231e429a 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -8,6 +8,23 @@ function TrapExit { git checkout master } +batchMode=false + +while getopts "b" arg +do + case $arg in + b) + batchMode=true + ;; + *) + echo "Unsupported arg $arg" + exit 2 + ;; + esac +done + +${batchMode} && echo "Using batch mode" + trap TrapExit EXIT SIGTERM test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!"; @@ -37,6 +54,11 @@ for branch in "${branches_list[@]}"; do git commit -m "Auto merge branch with master" -a # push may fail if remote doesn't have this branch yet. In this case - sending branch git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; } + elif ${batchMode}; then + status=$? + echo "Git merge failed in batch mode" + exit ${status} + # and trap exit gets us back to master else cat< Date: Sat, 16 Nov 2019 09:30:39 -0600 Subject: [PATCH 3/3] ci: add adopt11 to docker-versions-create.sh --- docker-versions-create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 231e429a..da0fcff1 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -1,7 +1,7 @@ #!/bin/bash #set -x # Use this variable to indicate a list of branches that docker hub is watching -branches_list=('openj9' 'openj9-nightly') +branches_list=('openj9' 'openj9-nightly' 'adopt11') function TrapExit { echo "Checking out back in master"