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
This commit is contained in:
Antony Messerli 2017-12-14 13:11:40 -06:00
parent 4d2a8335aa
commit e67f805f35
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

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