Fix manual ci trigger build 55/25655/11
authorliyuenan <liyuenan@huawei.com>
Thu, 8 Dec 2016 04:42:00 +0000 (12:42 +0800)
committerliyuenan <liyuenan@huawei.com>
Fri, 9 Dec 2016 14:38:40 +0000 (22:38 +0800)
JIRA: COMPASS-509

Change-Id: I17bc50b855203af5c1fa9227dbb02e7ccbb87965
Signed-off-by: liyuenan <liyuenan@huawei.com>
ci/deploy_ci.sh

index ecb28d0..b4e8541 100755 (executable)
 
 CI_DIR=$(cd $(dirname ${BASH_SOURCE:-$0});pwd)
 
-if [[ $ROOT_BUILD_CAUSE = MANUALTRIGGER ]]; then
-    # For manual ci trigger buid, directly use the value pass from CI
-    export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-trusty}
-    export OPENSTACK_VERSION=${OPENSTACK_VERSION:-mitaka}
+if [[ $ROOT_BUILD_CAUSE == MANUALTRIGGER ]]; then
+    # For manual ci trigger build, directly use the value pass from CI
+    if [[ $COMPASS_OPENSTACK_VERSION == newton ]]; then
+        export COMPASS_OS_VERSION=xenial
+        export COMPASS_OPENSTACK_VERSION=newton_xenial
+    else
+        case $DEPLOY_SCENARIO in
+        os-odl_l2-moon-ha)
+            # os-odl_l2-moon-ha scenario supports xenial mitaka only
+            export COMPASS_OS_VERSION=xenial
+            export COMPASS_OPENSTACK_VERSION=mitaka_xenial
+            ;;
+        os-ocl-nofeature-ha)
+            # os-ocl-nofeature-ha scenario supports liberty only
+            export COMPASS_OS_VERSION=trusty
+            export COMPASS_OPENSTACK_VERSION=liberty
+            ;;
+        *)
+            # setup for testing mitaka by default
+            export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-trusty}
+            export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-mitaka}
+            ;;
+        esac
+    fi
 
 else
     # For daily build or verify build, adjust COMPASS_OS_VERSION and OPENSTACK_VERSION
     # value according to COMPASS_OS_VERSION and DEPLOY_SCENARIO pass from CI
 
-    if [[ $COMPASS_OS_VERSION == centos ]]; then
+    if [[ $COMPASS_OS_VERSION == centos7 ]]; then
         case $DEPLOY_SCENARIO in
         os-odl_l2-moon-ha)
             # os-odl_l2-moon-ha scenario supports xenial mitaka only
             export COMPASS_OS_VERSION=xenial
-            export OPENSTACK_VERSION=mitaka_xenial
+            export COMPASS_OPENSTACK_VERSION=mitaka_xenial
             ;;
         os-ocl-nofeature-ha)
             # os-ocl-nofeature-ha scenario supports liberty only
-            export OPENSTACK_VERSION=liberty
+            export COMPASS_OS_VERSION=centos7
+            export COMPASS_OPENSTACK_VERSION=liberty
             ;;
         *)
             # setup for testing mitaka by default
-            export OPENSTACK_VERSION=${OPENSTACK_VERSION:-mitaka}
+            export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-centos7}
+            export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-mitaka}
             ;;
         esac
 
@@ -43,36 +65,42 @@ else
         os-nosdn-nofeature-ha)
             # temporarily setup for testing newton
             export COMPASS_OS_VERSION=xenial
-            export OPENSTACK_VERSION=newton_xenial
+            export COMPASS_OPENSTACK_VERSION=newton_xenial
             ;;
         os-odl_2-nofeature-ha)
             # temporarily setup for testing newton
             export COMPASS_OS_VERSION=xenial
-            export OPENSTACK_VERSION=newton_xenial
+            export COMPASS_OPENSTACK_VERSION=newton_xenial
             ;;
         os-odl_l2-moon-ha)
             # os-odl_l2-moon-ha scenario supports xenial mitaka only
             export COMPASS_OS_VERSION=xenial
-            export OPENSTACK_VERSION=mitaka_xenial
+            export COMPASS_OPENSTACK_VERSION=mitaka_xenial
             ;;
         os-ocl-nofeature-ha)
             # os-ocl-nofeature-ha scenario supports liberty only
             export COMPASS_OS_VERSION=trusty
-            export OPENSTACK_VERSION=liberty
+            export COMPASS_OPENSTACK_VERSION=liberty
             ;;
         *)
             # setup for testing mitaka by default
             export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-trusty}
-            export OPENSTACK_VERSION=${OPENSTACK_VERSION:-mitaka}
+            export COMPASS_OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION:-mitaka}
             ;;
         esac
     fi
 fi
 
-echo "########################################"
+# these variables used by compass
+export OS_VERSION=$COMPASS_OS_VERSION
+export OPENSTACK_VERSION=$COMPASS_OPENSTACK_VERSION
+
+set +x
+echo "#############################################"
 echo 'DEPLOY_SCENARIO='$DEPLOY_SCENARIO
-echo 'COMPASS_OS_VERSION='$COMPASS_OS_VERSION
+echo 'OS_VERSION='$OS_VERSION
 echo 'OPENSTACK_VERSION='$OPENSTACK_VERSION
-echo "########################################"
+echo "#############################################"
+set -x
 
 $CI_DIR/../deploy.sh