aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliyuenan <liyuenan@huawei.com>2016-11-30 14:42:29 +0800
committerliyuenan <liyuenan@huawei.com>2016-12-07 09:41:22 +0800
commit389a538a690427032c98d4812dbf69993d036fef (patch)
tree01e2df43576d2628b13d4e405bb4eda9e29d2ea2
parenta8614e961d4e600f6fbbac23e4c1a279dd1b186a (diff)
Deploy some special scenarios automatically in CI
For daily build or verify build, adjust OS_VERSION and OPENSTACK_VERSION value according to OS_VERSION and DEPLOY_SCENARIO pass from CI. JIRA: COMPASS-509 Change-Id: I4db4d759e62a3b574ac8decde11ee8cba80069e2 Signed-off-by: liyuenan <liyuenan@huawei.com>
-rwxr-xr-xci/deploy_ci.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/ci/deploy_ci.sh b/ci/deploy_ci.sh
new file mode 100755
index 00000000..ecb28d00
--- /dev/null
+++ b/ci/deploy_ci.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# ROOT_BUILD_CAUSE DEPLOY_SCENARIO COMPASS_OS_VERSION got from CI
+
+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}
+
+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
+ 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
+ ;;
+ os-ocl-nofeature-ha)
+ # os-ocl-nofeature-ha scenario supports liberty only
+ export OPENSTACK_VERSION=liberty
+ ;;
+ *)
+ # setup for testing mitaka by default
+ export OPENSTACK_VERSION=${OPENSTACK_VERSION:-mitaka}
+ ;;
+ esac
+
+ else
+ case $DEPLOY_SCENARIO in
+ os-nosdn-nofeature-ha)
+ # temporarily setup for testing newton
+ export COMPASS_OS_VERSION=xenial
+ export OPENSTACK_VERSION=newton_xenial
+ ;;
+ os-odl_2-nofeature-ha)
+ # temporarily setup for testing newton
+ export COMPASS_OS_VERSION=xenial
+ export 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
+ ;;
+ os-ocl-nofeature-ha)
+ # os-ocl-nofeature-ha scenario supports liberty only
+ export COMPASS_OS_VERSION=trusty
+ export OPENSTACK_VERSION=liberty
+ ;;
+ *)
+ # setup for testing mitaka by default
+ export COMPASS_OS_VERSION=${COMPASS_OS_VERSION:-trusty}
+ export OPENSTACK_VERSION=${OPENSTACK_VERSION:-mitaka}
+ ;;
+ esac
+ fi
+fi
+
+echo "########################################"
+echo 'DEPLOY_SCENARIO='$DEPLOY_SCENARIO
+echo 'COMPASS_OS_VERSION='$COMPASS_OS_VERSION
+echo 'OPENSTACK_VERSION='$OPENSTACK_VERSION
+echo "########################################"
+
+$CI_DIR/../deploy.sh