From 9c661b6edf9d33fb07d998bf2440c0e92a43109e Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Fri, 23 Aug 2019 07:49:43 +0000 Subject: [PATCH] Be more explicit with Nordix CICD ONAP stack name We need to differentiate between user initiated deployments and CICD ones so we know who created a certain stack. For CICD deployments, stack name will be in following form nordix-cicd-onap-{onap-branch}-{onap-flavor} such as nordix-cicd-onap-master-full nordix-cicd-onap-dublin-core For user initiated deployments, stack name will be set to something random in following form in engine nordix-custom-onap-{random-string} such as nordix-custom-onap-aglee Change-Id: I145d8a6f4e3d624ef723f8decfbab0ce5297f45a --- .../cloud-infra-periodic-onap.yaml | 24 +++++++++++++++++-- jjb/cloud-infra/delete-heat-stack.sh | 9 +++---- jjb/cloud-infra/onap-macros.yaml | 4 ---- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/jjb/cloud-infra/cloud-infra-periodic-onap.yaml b/jjb/cloud-infra/cloud-infra-periodic-onap.yaml index b4bfb9f6..4c659a93 100644 --- a/jjb/cloud-infra/cloud-infra-periodic-onap.yaml +++ b/jjb/cloud-infra/cloud-infra-periodic-onap.yaml @@ -32,6 +32,7 @@ - 'dublin': nordix-branch: master onap-version: 4.0.0-ONAP + onap-flavor: full engine-version: master engine-refspec: master deploy-scenario-version: master @@ -40,6 +41,7 @@ - 'master': nordix-branch: master onap-version: master + onap-flavor: full engine-version: master engine-refspec: master deploy-scenario-version: master @@ -105,6 +107,13 @@ name: ONAP_VERSION default: '{onap-version}' description: 'ONAP version to deploy' + - string: + name: ONAP_FLAVOR + default: '{onap-flavor}' + description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.' + - string: + name: STACK_NAME + default: 'nordix-cicd-onap-{onap-branch}-{onap-flavor}' - string: name: ENGINE_VERSION default: '{engine-version}' @@ -176,6 +185,7 @@ DEPLOY_SCENARIO=$DEPLOY_SCENARIO ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=$ONAP_FLAVOR + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -202,6 +212,7 @@ ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=full TEST_TYPE=oom-healthcheck + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -228,6 +239,7 @@ ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=core TEST_TYPE=onap-healthcheck + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -250,6 +262,7 @@ ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=small TEST_TYPE=onap-healthcheck + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -272,6 +285,7 @@ ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=medium TEST_TYPE=onap-healthcheck + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -294,6 +308,7 @@ ONAP_VERSION=$ONAP_VERSION ONAP_FLAVOR=full TEST_TYPE=onap-healthcheck + STACK_NAME=$STACK_NAME ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION @@ -319,6 +334,7 @@ ONAP_FLAVOR=$ONAP_FLAVOR ENGINE_VERSION=$ENGINE_VERSION ENGINE_REFSPEC=$ENGINE_REFSPEC + STACK_NAME=$STACK_NAME DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC XTESTING_REPO_URL=$XTESTING_REPO_URL @@ -360,6 +376,10 @@ branch: '{nordix-branch}' - nordix-gerrit-parameters - onap-parameter-macro + - string: + name: ONAP_FLAVOR + default: '{onap-flavor}' + description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.' - string: name: ONAP_VERSION default: '{onap-version}' @@ -385,7 +405,7 @@ builders: - description-setter: - description: $INSTALLER_TYPE $DEPLOY_SCENARIO + description: $DEPLOY_SCENARIO | $ONAP_FLAVOR - '{onap-other-phases}-macro' - job-template: @@ -445,7 +465,7 @@ builders: - description-setter: - description: $INSTALLER_TYPE $DEPLOY_SCENARIO + description: $DEPLOY_SCENARIO | $ONAP_FLAVOR - 'onap-healthcheck-macro' # vim: set ts=2 sw=2 expandtab: diff --git a/jjb/cloud-infra/delete-heat-stack.sh b/jjb/cloud-infra/delete-heat-stack.sh index 50a6396e..7c6ecdb4 100644 --- a/jjb/cloud-infra/delete-heat-stack.sh +++ b/jjb/cloud-infra/delete-heat-stack.sh @@ -29,16 +29,13 @@ echo "-------------------------------------------------------------------------" echo echo -# stack name to delete -export STACK_NAME=nordix-onap-custom - cd $WORKSPACE -sudo apt install -y python-dev python-virtualenv -virtualenv $WORKSPACE/.venv +sudo apt install -y -qq python-dev python-virtualenv > /dev/null +virtualenv -q $WORKSPACE/.venv set +u source $WORKSPACE/.venv/bin/activate set -u -pip install openstacksdk python-openstackclient python-heatclient +pip install -q openstacksdk python-openstackclient python-heatclient echo "Info: Deleting stack $STACK_NAME" echo "-------------------------------------------------------------------------" source /tmp/openrc && /bin/rm -f /tmp/openrc diff --git a/jjb/cloud-infra/onap-macros.yaml b/jjb/cloud-infra/onap-macros.yaml index 42f7bc0e..b05c4e3a 100644 --- a/jjb/cloud-infra/onap-macros.yaml +++ b/jjb/cloud-infra/onap-macros.yaml @@ -50,10 +50,6 @@ name: HEAT_ENVIRONMENT_FILE default: "file://$WORKSPACE/.cache/repos/swconfig/scenarios/$DEPLOY_SCENARIO/$INSTALLER_TYPE/role/$DEPLOY_SCENARIO/files/heat-environment-full.yaml" description: 'Type of the deployment' - - string: - name: ONAP_FLAVOR - default: 'full' - description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.' - string: name: TEST_TYPE default: 'oom-healthcheck' -- 2.25.1