Removed logging change from docker-versions-create.sh

This commit is contained in:
Geoff Bourne 2020-03-26 20:53:10 -05:00
parent 6f67f76eef
commit c73bedc63c

View File

@ -3,10 +3,8 @@
# Use this variable to indicate a list of branches that docker hub is watching # Use this variable to indicate a list of branches that docker hub is watching
branches_list=('openj9' 'openj9-nightly' 'adopt11' 'multiarch' 'armv7') branches_list=('openj9' 'openj9-nightly' 'adopt11' 'multiarch' 'armv7')
. /start-utils
function TrapExit { function TrapExit {
log "Checking out back in master" echo "Checking out back in master"
git checkout master git checkout master
} }
@ -19,33 +17,33 @@ do
batchMode=true batchMode=true
;; ;;
*) *)
log "Unsupported arg $arg" echo "Unsupported arg $arg"
exit 2 exit 2
;; ;;
esac esac
done done
${batchMode} && log "Using batch mode" ${batchMode} && echo "Using batch mode"
trap TrapExit EXIT SIGTERM trap TrapExit EXIT SIGTERM
test -d ./.git || { log ".git folder was not found. Please start this script from root directory of the project!"; test -d ./.git || { echo ".git folder was not found. Please start this script from root directory of the project!";
exit 1; } exit 1; }
# Making sure we are in master # Making sure we are in master
git checkout master git checkout master
git pull --all || { log "Can't pull the repo!"; \ git pull --all || { echo "Can't pull the repo!"; \
exit 1; } exit 1; }
git_branches=$(git branch -a) git_branches=$(git branch -a)
for branch in "${branches_list[@]}"; do for branch in "${branches_list[@]}"; do
if [[ "$git_branches" != *"$branch"* ]]; then if [[ "$git_branches" != *"$branch"* ]]; then
log "Can't update $branch because I can't find it in the list of branches." echo "Can't update $branch because I can't find it in the list of branches."
exit 1 exit 1
else else
log "Branch $branch found. Working with it." echo "Branch $branch found. Working with it."
git checkout "$branch" || { log "Can't checkout into the branch. Don't know the cause."; \ git checkout "$branch" || { echo "Can't checkout into the branch. Don't know the cause."; \
exit 1; } exit 1; }
proceed='False' proceed='False'
while [[ "$proceed" == "False" ]]; do while [[ "$proceed" == "False" ]]; do
@ -54,14 +52,14 @@ for branch in "${branches_list[@]}"; do
if git merge -m 'Auto-merging via docker-versions-create' master; then if git merge -m 'Auto-merging via docker-versions-create' master; then
proceed="True" proceed="True"
log "Branch $branch updated to current master successfully" echo "Branch $branch updated to current master successfully"
# pushing changes to remote for this branch # pushing changes to remote for this branch
git commit -m "Auto merge branch with master" -a 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 # push may fail if remote doesn't have this branch yet. In this case - sending branch
git push || git push -u origin "$branch" || { log "Can't push changes to the origin."; exit 1; } git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
elif ${batchMode}; then elif ${batchMode}; then
status=$? status=$?
log "Git merge failed in batch mode" echo "Git merge failed in batch mode"
exit ${status} exit ${status}
# and trap exit gets us back to master # and trap exit gets us back to master
else else