From 70893c9b8ce4cc2306a0931733a386927a07415c Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 19 Nov 2018 12:16:14 -0500 Subject: [PATCH] Apex: Fix OS_VERSION detection When we run deployments for snapshot creation we typically pass in the OS_VERSION var so we know what openstack version we are deploying with. However when we run a verify/gate job to ensure that the snapshot deploys work we do not have this variable, and need to detect it based on the OPNFV branch, or if the branch is master, the deploy scenario naming scheme. Change-Id: If1445dc564d2af59b9740391de56b821b78de0b5 Signed-off-by: Tim Rozet --- jjb/apex/apex-deploy.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 8f7af7ff9..0e247df6c 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -151,6 +151,25 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then else ENV_TYPE="functest" fi + if [ -z "$OS_VERSION" ]; then + echo "INFO: OS_VERSION not passed to deploy, detecting based on branch and scenario" + case $BRANCH in + master) + if [[ "$DEPLOY_SCENARIO" =~ "rocky" ]]; then + OS_VERSION=rocky + else + OS_VERSION=master + fi + ;; + *gambia) + OS_VERSION=queens + ;; + *) + echo "Unable to detection OS_VERSION, aborting" + exit 1 + ;; + esac + fi if [[ "$OS_VERSION" != "master" ]]; then SNAP_ENV="${ENV_TYPE}-${OS_VERSION}-environment.yaml" else -- 2.16.6