mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-19 17:28:14 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
commit
99c1fc81f1
1 file changed
+24
-2
@@ -1,13 +1,30 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#set -x
|
#set -x
|
||||||
# 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')
|
branches_list=('openj9' 'openj9-nightly' 'adopt11')
|
||||||
|
|
||||||
function TrapExit {
|
function TrapExit {
|
||||||
echo "Checking out back in master"
|
echo "Checking out back in master"
|
||||||
git checkout master
|
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
|
trap TrapExit EXIT SIGTERM
|
||||||
|
|
||||||
test -d ./.git || { echo ".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!";
|
||||||
@@ -37,6 +54,11 @@ for branch in "${branches_list[@]}"; do
|
|||||||
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" || { echo "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
|
||||||
|
status=$?
|
||||||
|
echo "Git merge failed in batch mode"
|
||||||
|
exit ${status}
|
||||||
|
# and trap exit gets us back to master
|
||||||
else
|
else
|
||||||
cat<<EOL
|
cat<<EOL
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
@@ -46,7 +68,7 @@ Or skip this branch merge completely.
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
EOL
|
EOL
|
||||||
printf "Should we try again? (y):"
|
printf "Should we try again? (y):"
|
||||||
read answer
|
read -r answer
|
||||||
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
|
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
|
||||||
# If you use non-local editor or files are changed in repo
|
# If you use non-local editor or files are changed in repo
|
||||||
cat <<EOL
|
cat <<EOL
|
||||||
|
|||||||
Reference in new issue
Block a user