From 3c8548b265c861ffac5e097fe0715f76393e5363 Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Tue, 10 Jan 2017 13:56:53 -0500 Subject: [PATCH] Work on starting the upgrade job * Add a new variable UPGRADE_BASEBRANCH and use that to check out a stable branch, then run the bootstrap process. This will require a change to project-config so that the job names will add in the branch name, so we can pick it up instead of providing a value when none is present. * Add a section to confd_overrides for the upgrade scenario to fix the following error TASK [bootstrap-host : Deploy user conf.d configuration] *********************** fatal: [localhost]: FAILED! => {"failed": true, "msg": "{{ confd_overrides[scenario] }}: 'dict object' has no attribute u'upgrade'"} Change-Id: Ia5fd197e81da0a1fd55327d155f181c8792bc199 --- scripts/gate-check-commit.sh | 28 ++++++++++++++++++++++++++++ tests/bootstrap-aio.yml | 14 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index df293dcb91..8740359ee1 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -32,6 +32,12 @@ export ANSIBLE_ROLE_FETCH_MODE="git-clone" # Set the scenario to execute based on the first CLI parameter export SCENARIO=${1:-"aio"} +# TODO(sc68cal) update the job configs to have the stable branch +# So we have job names like: +# gate-openstack-ansible-openstack-ansible-upgrade-newton-ubuntu-xenial-nv +export UPGRADE_BASEBRANCH=${2:-"newton"} +export SCENARIO_BACKUP=${SCENARIO_BACKUP:-''} + ## Functions ----------------------------------------------------------------- info_block "Checking for required libraries." 2> /dev/null || source "$(dirname "${0}")/scripts-library.sh" @@ -42,6 +48,16 @@ trap gate_job_exit_tasks EXIT # Log some data about the instance and the rest of the system log_instance_info + +if [[ "$SCENARIO" == "upgrade" ]]; then + # First, check out the base branch and build an AIO + git checkout origin/stable/$UPGRADE_BASEBRANCH + + # Do a quick swap of SCENARIO since the newton branch doesn't know about the upgrade scenario + export SCENARIO_BACKUP=$SCENARIO + SCENARIO="aio" +fi + # Get minimum disk size DATA_DISK_MIN_SIZE="$((1024**3 * $(awk '/bootstrap_host_data_disk_min_size/{print $2}' "$(dirname "${0}")/../tests/roles/bootstrap-host/defaults/main.yml") ))" @@ -106,4 +122,16 @@ bash "$(dirname "${0}")/run-playbooks.sh" # Log some data about the instance and the rest of the system log_instance_info +if [ ! -z $SCENARIO_BACKUP ]; then + # Restore the scenario from L56 + SCENARIO=$SCENARIO_BACKUP +fi + +if [[ "$SCENARIO" == "upgrade" ]]; then + # Hopefully we can re-check out the patch from Zuul. + git checkout FETCH_HEAD + export I_REALLY_KNOW_WHAT_I_AM_DOING=true + bash "$(dirname "${0}")/run-upgrade.sh" +fi + exit_success diff --git a/tests/bootstrap-aio.yml b/tests/bootstrap-aio.yml index f15baac324..84cbf05b6b 100644 --- a/tests/bootstrap-aio.yml +++ b/tests/bootstrap-aio.yml @@ -46,6 +46,20 @@ - name: keystone.yml.aio - name: neutron.yml.aio - name: nova.yml.aio + upgrade: + # This starts as an AIO box, then an upgrade is run + - name: aodh.yml.aio + - name: cinder.yml.aio + - name: ceilometer.yml.aio + - name: designate.yml.aio + - name: glance.yml.aio + - name: gnocchi.yml.aio + - name: heat.yml.aio + - name: horizon.yml.aio + - name: keystone.yml.aio + - name: neutron.yml.aio + - name: nova.yml.aio + - name: swift.yml.aio vars: scenario: "{{ lookup('env','SCENARIO') | default('aio', true) }}" sshd: