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")