Merge "Allow for Leapfrogs from other Releases"
This commit is contained in:
commit
37ff5563ec
@ -39,6 +39,19 @@ function tag_leap_success {
|
|||||||
debug "LEAP ${1} marked as success"
|
debug "LEAP ${1} marked as success"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_for_todolist {
|
||||||
|
if [[ -v UPGRADES_TO_TODOLIST ]]; then
|
||||||
|
notice "UPGRADES_TO_TODOLIST is set, continuing..."
|
||||||
|
else
|
||||||
|
notice "Please export UPGRADES_TO_TODOLIST variable before continuing"
|
||||||
|
notice "This variable is set via the prep.sh script and details the"
|
||||||
|
notice "incremental RELEASES that need to run for the leap."
|
||||||
|
notice ""
|
||||||
|
notice "example: export UPGRADES_TO_TODOLIST=\"MITAKA NEWTON\""
|
||||||
|
exit 99
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function run_lock {
|
function run_lock {
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
@ -291,6 +304,12 @@ function pre_flight {
|
|||||||
|
|
||||||
discover_code_version
|
discover_code_version
|
||||||
|
|
||||||
|
# set config directory here since we need to check if existing redeploy
|
||||||
|
# has been kicked off before prompting for the release, JUNO is the only
|
||||||
|
# other directory that may differ but since we aren't leaping to JUNO,
|
||||||
|
# this should be safe to set here
|
||||||
|
CONFIG_DIR="/etc/openstack_deploy"
|
||||||
|
|
||||||
if [[ -f "${CONFIG_DIR}/upgrade-leap/redeploy-started.complete" && ! -f "${CONFIG_DIR}/upgrade-leap/osa-leap.complete" ]]; then
|
if [[ -f "${CONFIG_DIR}/upgrade-leap/redeploy-started.complete" && ! -f "${CONFIG_DIR}/upgrade-leap/osa-leap.complete" ]]; then
|
||||||
resume_incomplete_leap
|
resume_incomplete_leap
|
||||||
elif [ "${VALIDATE_UPGRADE_INPUT}" == "TRUE" ]; then
|
elif [ "${VALIDATE_UPGRADE_INPUT}" == "TRUE" ]; then
|
||||||
@ -419,7 +438,7 @@ function run_venv_prep {
|
|||||||
if [[ -e "/etc/rpc_deploy" ]]; then
|
if [[ -e "/etc/rpc_deploy" ]]; then
|
||||||
PB_DIR="/opt/leap42/openstack-ansible-${JUNO_RELEASE}/rpc_deployment"
|
PB_DIR="/opt/leap42/openstack-ansible-${JUNO_RELEASE}/rpc_deployment"
|
||||||
else
|
else
|
||||||
PB_DIR="/opt/leap42/openstack-ansible-${KILO_RELEASE}/playbooks"
|
PB_DIR="/opt/leap42/openstack-ansible-${RELEASE}/playbooks"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd "${PB_DIR}"
|
pushd "${PB_DIR}"
|
||||||
|
@ -40,7 +40,6 @@ export UPGRADE_UTILS="${UPGRADE_UTILS:-${SYSTEM_PATH}/upgrade-utilities}"
|
|||||||
export VENV_URL="${VENV_URL:-https://rpc-repo.rackspace.com/venvs/leap-bundles}"
|
export VENV_URL="${VENV_URL:-https://rpc-repo.rackspace.com/venvs/leap-bundles}"
|
||||||
|
|
||||||
export VALIDATE_UPGRADE_INPUT="${VALIDATE_UPGRADE_INPUT:-TRUE}"
|
export VALIDATE_UPGRADE_INPUT="${VALIDATE_UPGRADE_INPUT:-TRUE}"
|
||||||
export UPGRADES_TO_TODOLIST="${UPGRADES_TO_TODOLIST:-''}"
|
|
||||||
export CODE_UPGRADE_FROM=""
|
export CODE_UPGRADE_FROM=""
|
||||||
|
|
||||||
# Bootstrap ansible tool, see also bootstrap_recent_ansible
|
# Bootstrap ansible tool, see also bootstrap_recent_ansible
|
||||||
|
@ -21,6 +21,9 @@ set -e -u
|
|||||||
source lib/vars.sh
|
source lib/vars.sh
|
||||||
source lib/functions.sh
|
source lib/functions.sh
|
||||||
|
|
||||||
|
## Ensure UPGRADES_TO_TODOLIST is set
|
||||||
|
check_for_todolist
|
||||||
|
|
||||||
### Run the DB migrations
|
### Run the DB migrations
|
||||||
# Stop the services to ensure DB and application consistency
|
# Stop the services to ensure DB and application consistency
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-poweroff.leap" ]]; then
|
if [[ ! -f "/opt/leap42/openstack-ansible-poweroff.leap" ]]; then
|
||||||
@ -35,46 +38,26 @@ if [[ ! -f "/opt/leap42/openstack-ansible-poweroff.leap" ]]; then
|
|||||||
tag_leap_success "poweroff"
|
tag_leap_success "poweroff"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kilo migrations
|
# Run Migrations for Each Release in the TODO
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${KILO_RELEASE}-db.leap" ]]; then
|
for RELEASES in ${UPGRADES_TO_TODOLIST}; do
|
||||||
notice "Running Kilo DB Migrations"
|
RELEASE_NAME=${RELEASES}_RELEASE
|
||||||
link_release "/opt/leap42/openstack-ansible-${KILO_RELEASE}"
|
if [[ ! -f "/opt/leap42/openstack-ansible-${!RELEASE_NAME}-db.leap" ]]; then
|
||||||
|
notice "Running ${RELEASES} DB Migrations"
|
||||||
|
link_release "/opt/leap42/openstack-ansible-${!RELEASE_NAME}"
|
||||||
RUN_TASKS=()
|
RUN_TASKS=()
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-kilo.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${KILO_RELEASE}.tgz'")
|
if [[ "${RELEASES}" == "JUNO" ]]; then
|
||||||
run_items "/opt/leap42/openstack-ansible-${KILO_RELEASE}"
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-kilo.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${!RELEASE_NAME}.tgz'")
|
||||||
tag_leap_success "${KILO_RELEASE}-db"
|
elif [[ "${RELEASES}" == "LIBERTY" ]]; then
|
||||||
fi
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-liberty.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${!RELEASE_NAME}.tgz'")
|
||||||
|
|
||||||
# Liberty migrations
|
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${LIBERTY_RELEASE}-db.leap" ]]; then
|
|
||||||
notice "Running Liberty DB Migrations"
|
|
||||||
link_release "/opt/leap42/openstack-ansible-${LIBERTY_RELEASE}"
|
|
||||||
RUN_TASKS=()
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-liberty.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${LIBERTY_RELEASE}.tgz'")
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/glance-db-storage-url-fix.yml")
|
RUN_TASKS+=("${UPGRADE_UTILS}/glance-db-storage-url-fix.yml")
|
||||||
run_items "/opt/leap42/openstack-ansible-${LIBERTY_RELEASE}"
|
elif [[ "${RELEASES}" == "MITAKA" ]]; then
|
||||||
tag_leap_success "${LIBERTY_RELEASE}-db"
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-mitaka.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${!RELEASE_NAME}.tgz'")
|
||||||
fi
|
|
||||||
|
|
||||||
# Mitaka migrations
|
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${MITAKA_RELEASE}-db.leap" ]]; then
|
|
||||||
notice "Running Mitaka DB Migrations"
|
|
||||||
link_release "/opt/leap42/openstack-ansible-${MITAKA_RELEASE}"
|
|
||||||
RUN_TASKS=()
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-mitaka.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${MITAKA_RELEASE}.tgz'")
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/neutron-mtu-migration.yml")
|
RUN_TASKS+=("${UPGRADE_UTILS}/neutron-mtu-migration.yml")
|
||||||
run_items "/opt/leap42/openstack-ansible-${MITAKA_RELEASE}"
|
elif [[ "${RELEASES}" == "NEWTON" ]]; then
|
||||||
tag_leap_success "${MITAKA_RELEASE}-db"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Newton migrations
|
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-db.leap" ]]; then
|
|
||||||
notice "Running Newton DB Migrations"
|
|
||||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
|
||||||
RUN_TASKS=()
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-collation-alter.yml")
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-collation-alter.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-newton.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${NEWTON_RELEASE}.tgz'")
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-migrations-newton.yml -e 'venv_tar_location=/opt/leap42/venvs/openstack-ansible-${!RELEASE_NAME}.tgz'")
|
||||||
run_items "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
|
||||||
tag_leap_success "${NEWTON_RELEASE}-db"
|
|
||||||
fi
|
fi
|
||||||
### Run the DB migrations
|
run_items "/opt/leap42/openstack-ansible-${!RELEASE_NAME}"
|
||||||
|
tag_leap_success "${!RELEASE_NAME}-db"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
@ -24,38 +24,22 @@ source lib/functions.sh
|
|||||||
# Execute a preflight check
|
# Execute a preflight check
|
||||||
pre_flight
|
pre_flight
|
||||||
|
|
||||||
# Clone the Juno release so we have a clean copy of the source code.
|
# assemble list of versions to check out
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${JUNO_RELEASE}-prep.leap" ]]; then
|
TODO="${CODE_UPGRADE_FROM}"
|
||||||
clone_release ${JUNO_RELEASE}
|
TODO+=" ${UPGRADES_TO_TODOLIST}"
|
||||||
touch "/opt/leap42/openstack-ansible-${JUNO_RELEASE}-prep.leap"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build the releases. This will clone all of the releases and check them out
|
# Build the releases. This will loop through the TODO variable, check out the
|
||||||
# separately in addition to creating all of the venvs needed for a successful migration.
|
# releases, and create all of the venvs needed for a successful migration
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${KILO_RELEASE}-prep.leap" ]]; then
|
for RELEASES in ${TODO}; do
|
||||||
clone_release ${KILO_RELEASE}
|
RELEASE_NAME=${RELEASES}_RELEASE
|
||||||
get_venv ${KILO_RELEASE}
|
if [[ ! -f "/opt/leap42/openstack-ansible-${!RELEASE_NAME}-prep.leap" ]]; then
|
||||||
touch "/opt/leap42/openstack-ansible-${KILO_RELEASE}-prep.leap"
|
clone_release ${!RELEASE_NAME}
|
||||||
|
if [[ "${RELEASES}" != "JUNO" ]]; then
|
||||||
|
get_venv ${!RELEASE_NAME}
|
||||||
fi
|
fi
|
||||||
|
touch "/opt/leap42/openstack-ansible-${!RELEASE_NAME}-prep.leap"
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${LIBERTY_RELEASE}-prep.leap" ]]; then
|
|
||||||
clone_release ${LIBERTY_RELEASE}
|
|
||||||
get_venv ${LIBERTY_RELEASE}
|
|
||||||
touch "/opt/leap42/openstack-ansible-${LIBERTY_RELEASE}-prep.leap"
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${MITAKA_RELEASE}-prep.leap" ]]; then
|
|
||||||
clone_release ${MITAKA_RELEASE}
|
|
||||||
get_venv ${MITAKA_RELEASE}
|
|
||||||
touch "/opt/leap42/openstack-ansible-${MITAKA_RELEASE}-prep.leap"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-prep.leap" ]]; then
|
|
||||||
clone_release ${NEWTON_RELEASE}
|
|
||||||
get_venv ${NEWTON_RELEASE}
|
|
||||||
touch "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-prep.leap"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -f "/opt/leap42/openstack-ansible-prep-finalsteps.leap" ]]; then
|
if [[ ! -f "/opt/leap42/openstack-ansible-prep-finalsteps.leap" ]]; then
|
||||||
RUN_TASKS=()
|
RUN_TASKS=()
|
||||||
|
@ -21,6 +21,9 @@ set -e -u
|
|||||||
source lib/vars.sh
|
source lib/vars.sh
|
||||||
source lib/functions.sh
|
source lib/functions.sh
|
||||||
|
|
||||||
|
## Ensure UPGRADES_TO_TODOLIST is set
|
||||||
|
check_for_todolist
|
||||||
|
|
||||||
### Kilo System migration
|
### Kilo System migration
|
||||||
# Run tasks
|
# Run tasks
|
||||||
UPGRADE_SCRIPTS="${UPGRADE_UTILS}-kilo/scripts"
|
UPGRADE_SCRIPTS="${UPGRADE_UTILS}-kilo/scripts"
|
||||||
|
Loading…
Reference in New Issue
Block a user