From f10e37c414a730624a2ab837d4502e1dab30bef9 Mon Sep 17 00:00:00 2001 From: Roman Iuvshin Date: Fri, 13 Jan 2017 18:03:15 +0200 Subject: [PATCH] allow skip backup on upgrade --- .../base/scripts/base/commands/cmd_upgrade.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh b/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh index 472b96117d0..cda5ee55e01 100644 --- a/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh +++ b/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh @@ -13,6 +13,16 @@ cmd_upgrade() { debug $FUNCNAME CHE_IMAGE_VERSION=$(get_image_version) + DO_BACKUP="true" + + while [ $# -gt 0 ]; do + case $1 in + --skip-backup) + DO_BACKUP="false" + shift ;; + *) error "Unknown parameter: $1; did you mean --skip-backup?" ; return 2 ;; + esac + done # If we got here, this means: # image version > configured & installed version @@ -39,8 +49,13 @@ cmd_upgrade() { cmd_stop fi fi - info "upgrade" "Preparing backup..." - cmd_backup + + if [[ "${DO_BACKUP}" == "true" ]]; then + info "upgrade" "Preparing backup..." + cmd_backup + else + info "upgrade" "Skipping backup." + fi info "upgrade" "Reinitializing the system with your configuration..." cmd_init --accept-license --reinit