From e67f805f3526187a22ae53d5faa4b4611f11ec08 Mon Sep 17 00:00:00 2001 From: Antony Messerli Date: Thu, 14 Dec 2017 13:11:40 -0600 Subject: [PATCH] Link the current deployed release on a leapfrog Existing code assumes starting point of KILO_RELEASE. This change allows other releases to be the starting point before the migrations occur. Change-Id: Idb7d2981b37e653c9e92a9e41e4bf54b17aef1f5 --- leap-upgrades/lib/functions.sh | 13 +++++++++++++ leap-upgrades/migrations.sh | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index 67234cf4..81433857 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -52,6 +52,19 @@ function check_for_todolist { fi } +function check_for_release { + if [[ -v RELEASE ]]; then + notice "RELEASE is set, continuing..." + else + notice "Please export RELEASE variable before continuing" + notice "This variable reflects the release version being leaped" + notice "from. i.e. value of KILO_RELEASE, LIBERTY_RELEASE, etc." + notice "" + notice "example: export RELEASE=\"liberty-eol\"" + exit 99 + fi +} + function run_lock { set +e diff --git a/leap-upgrades/migrations.sh b/leap-upgrades/migrations.sh index eeeec7cf..ad6ece7f 100755 --- a/leap-upgrades/migrations.sh +++ b/leap-upgrades/migrations.sh @@ -24,11 +24,14 @@ source lib/functions.sh ## Ensure UPGRADES_TO_TODOLIST is set check_for_todolist +## Ensure RELEASE is set +check_for_release + ### Run the DB migrations # Stop the services to ensure DB and application consistency if [[ ! -f "/opt/leap42/openstack-ansible-poweroff.leap" ]]; then if [ -e "/opt/openstack-ansible" ]; then - link_release "/opt/leap42/openstack-ansible-${KILO_RELEASE}" + link_release "/opt/leap42/openstack-ansible-${RELEASE}" fi RUN_TASKS=() RUN_TASKS+=("${UPGRADE_UTILS}/power-down.yml")