Skip to content

Commit

Permalink
feat(docker-monolithic): allow running upgrade non-interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
bytestream committed Feb 4, 2025
1 parent 9be2e39 commit 4bd841c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions templates/docker-monolithic/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ set -eu -o pipefail

usage="Options:
-h,--help Display this help and exit.
-r,--ref=5.x Git ref (commit sha, ref name, tag) to run the script on.
--skip-backup Skip taking a backup before upgrading.
"

# options
ref=5.x
skip_backup=false

while [[ "$#" -gt 0 ]]; do
case $1 in
Expand All @@ -18,6 +21,9 @@ while [[ "$#" -gt 0 ]]; do
ref="$2"
shift
;;
--skip-backup)
skip_backup=true
;;
*)
echo "Unknown parameter passed: $1"
exit 1
Expand Down Expand Up @@ -54,6 +60,10 @@ check_docker_compose() {
}

backup() {
if [ "${skip_backup}" = true ]; then
return
fi

echo
echo "It is recommend to take a backup before upgrading, this may take some time. If you've already taken a backup you can skip this step."
echo "Do you want to take a backup? [Y/n]"
Expand Down

0 comments on commit 4bd841c

Please sign in to comment.