From 82d618d7901ac9ce50b0bbc23641290e77340a56 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 9 Apr 2018 17:47:08 +0100 Subject: [PATCH] Remove double warning from run-upgrade The reality is that the upgrade script is always in development, as is all open source software. Instead of having this extra warning we just have one which provides a suitable warning to use this in a test environment first. Also, we remove the set -v because the output of the whole script is not very helpful when executing or debugging. Change-Id: I8e23bfacf131a0c7d5c3716437dbfecb896bbb70 --- scripts/gate-check-commit.sh | 5 ----- scripts/run-upgrade.sh | 27 +++++++++++---------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 005348c561..00a79013b1 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -202,11 +202,6 @@ if [[ "${ACTION}" == "upgrade" ]]; then # Checkout the original HEAD we started with git checkout ${UPGRADE_TARGET_BRANCH} - # There is a protection in the run-upgrade script - # to prevent people doing anything silly. We need - # to bypass that for an automated test. - export I_REALLY_KNOW_WHAT_I_AM_DOING=true - # Unset environment variables used by the bootstrap-ansible # script to allow newer versions of Ansible and global # requirements to be installed. diff --git a/scripts/run-upgrade.sh b/scripts/run-upgrade.sh index c133a0ca2b..fd7388df22 100755 --- a/scripts/run-upgrade.sh +++ b/scripts/run-upgrade.sh @@ -20,7 +20,7 @@ ## Shell Opts ---------------------------------------------------------------- -set -e -u -v +set -e -u ## Vars ---------------------------------------------------------------------- @@ -33,9 +33,6 @@ export MAIN_PATH="$(dirname "${SCRIPTS_PATH}")" # The path to find all the upgrade playbooks export UPGRADE_PLAYBOOKS="${SCRIPTS_PATH}/upgrade-utilities/playbooks" -# The toggle which guards against using this script prematurely -export I_REALLY_KNOW_WHAT_I_AM_DOING=${I_REALLY_KNOW_WHAT_I_AM_DOING:-"false"} - # The expected source series name export SOURCE_SERIES="pike" @@ -127,12 +124,21 @@ function pre_flight { # Notify the user. echo -e " This script will perform a ${SOURCE_SERIES^} to ${TARGET_SERIES^} upgrade. - Once you start the upgrade there's no going back. + Once you start the upgrade there is no going back. Note that the upgrade targets impacting the data plane as little as possible, but assumes that the control plane can experience some down time. + This script executes a one-size-fits-all upgrade, + and given that the tests implemented for it are + not monitored as well as those for a greenfield + environment, the results may vary with each release. + + Please use it against a test environment with your + configurations to validate whether it suits your + needs and does a suitable upgrade. + Are you ready to perform this upgrade now? " @@ -145,20 +151,9 @@ function pre_flight { fi } -function exit_early { - echo -e " - The upgrade script is still under active development and should not be - run at this time. For test environments the early exit of the script can - skipped by executing ``export I_REALLY_KNOW_WHAT_I_AM_DOING=true`` before - ``run-upgrade.sh``. - " - exit 99 -} - ## Main ---------------------------------------------------------------------- function main { - [[ "${I_REALLY_KNOW_WHAT_I_AM_DOING}" = true ]] || exit_early pre_flight check_for_current