From 0861dce3d0e0e6e97edd5fb0d2d0264e7b006944 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Tue, 17 Mar 2020 23:16:49 +0000 Subject: [PATCH] Delete stack upon completion Change-Id: Ie5103efaa6c924d4eddbbd622db3a145b0dfc59a --- .../engine-verify-deployment-parent-jobs.yaml | 12 ++------ .../engine-verify-offline-deploy-test.yaml | 30 ++++++++++--------- .../engine-verify-online-deploy-test.yaml | 30 ++++++++++--------- .../scripts/delete-heat-stack.sh | 5 ++++ 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/jjb/engine/engine-verify-jobs/engine-verify-deployment-parent-jobs.yaml b/jjb/engine/engine-verify-jobs/engine-verify-deployment-parent-jobs.yaml index 5376bb06f..c83da3085 100644 --- a/jjb/engine/engine-verify-jobs/engine-verify-deployment-parent-jobs.yaml +++ b/jjb/engine/engine-verify-jobs/engine-verify-deployment-parent-jobs.yaml @@ -104,12 +104,6 @@ properties: - logrotate -# - build-blocker: -# use-build-blocker: true -# blocking-jobs: -# - 'engine-verify-online-ubuntu1804.*' -# - 'engine-verify-offline-ubuntu1804.*' -# block-level: 'NODE' - throttle: max-per-node: 1 max-total: 3 @@ -173,7 +167,6 @@ node-parameters: true kill-phase-on: FAILURE abort-all-job: true -# enable-condition: "\"$EXECUTION_MODE\" == \"offline-deployment\"" - multijob: name: "{environment-type} deployment and testing" condition: SUCCESSFUL @@ -197,9 +190,8 @@ EXECUTION_MODE=$EXECUTION_MODE VERBOSITY=$VERBOSITY DISTRO=$DISTRO - property-file: "$WORKSPACE/change.properties" kill-phase-on: FAILURE - abort-all-job: true + abort-all-job: false - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-cloud-master' current-parameters: false node-parameters: false @@ -219,7 +211,7 @@ VERBOSITY=$VERBOSITY DISTRO=$DISTRO kill-phase-on: FAILURE - abort-all-job: true + abort-all-job: false - job-template: name: 'engine-verify-packaging-{distro}-{stream}' diff --git a/jjb/engine/engine-verify-jobs/engine-verify-offline-deploy-test.yaml b/jjb/engine/engine-verify-jobs/engine-verify-offline-deploy-test.yaml index 027657aa8..8ed343ab7 100644 --- a/jjb/engine/engine-verify-jobs/engine-verify-offline-deploy-test.yaml +++ b/jjb/engine/engine-verify-jobs/engine-verify-offline-deploy-test.yaml @@ -77,11 +77,11 @@ description: 'Name of heat-environment file to use.' - string: name: STACK_NAME - default: "nordix-cicd-verify-engine-offline-{distro}-$BUILD_NUMBER" + default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER" description: 'Name of the created stack' - string: name: KEYPAIR_NAME - default: "keypair-nordix-cicd-verify-offline-engine-{distro}-$BUILD_NUMBER" + default: "keypair-nordix-cicd-verify-offline-engine-{distro}-$GERRIT_CHANGE_NUMBER" description: 'Name of the created keypair' - string: name: USE_PREBUILT_DEPLOYMENT_IMAGE @@ -154,18 +154,20 @@ node-parameters: true kill-phase-on: FAILURE abort-all-job: false - - conditional-step: - condition-kind: and - condition-operands: - - condition-kind: strings-match - condition-string1: $DELETE_STACK - condition-string2: true - - condition-kind: strings-match - condition-string1: $PROVISIONER_TYPE - condition-string2: heat - on-evaluation-failure: dont-run - steps: - - 'engine-delete-stack-macro' + + publishers: + - postbuildscript: + builders: + - role: SLAVE + build-on: + - SUCCESS + - FAILURE + - ABORTED + - NOT_BUILT + - UNSTABLE + build-steps: + - 'engine-wait-pkg-mgr-macro' + - 'engine-delete-stack-macro' - job-template: name: 'engine-verify-offline-{phase}-{distro}-{cloud}-{type}-{stream}' diff --git a/jjb/engine/engine-verify-jobs/engine-verify-online-deploy-test.yaml b/jjb/engine/engine-verify-jobs/engine-verify-online-deploy-test.yaml index c295c788c..7f3b90314 100644 --- a/jjb/engine/engine-verify-jobs/engine-verify-online-deploy-test.yaml +++ b/jjb/engine/engine-verify-jobs/engine-verify-online-deploy-test.yaml @@ -77,11 +77,11 @@ description: 'Name of heat-environment file to use.' - string: name: STACK_NAME - default: "nordix-cicd-verify-engine-online-{distro}-$BUILD_NUMBER" + default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER" description: 'Name of the created stack' - string: name: KEYPAIR_NAME - default: "keypair-nordix-cicd-verify-online-engine-{distro}-$BUILD_NUMBER" + default: "keypair-nordix-cicd-verify-online-engine-{distro}-$GERRIT_CHANGE_NUMBER" description: 'Name of the created keypair' - string: name: USE_PREBUILT_DEPLOYMENT_IMAGE @@ -159,18 +159,20 @@ node-parameters: true kill-phase-on: FAILURE abort-all-job: false - - conditional-step: - condition-kind: and - condition-operands: - - condition-kind: strings-match - condition-string1: $DELETE_STACK - condition-string2: true - - condition-kind: strings-match - condition-string1: $PROVISIONER_TYPE - condition-string2: heat - on-evaluation-failure: dont-run - steps: - - 'engine-delete-stack-macro' + + publishers: + - postbuildscript: + builders: + - role: SLAVE + build-on: + - SUCCESS + - FAILURE + - ABORTED + - NOT_BUILT + - UNSTABLE + build-steps: + - 'engine-wait-pkg-mgr-macro' + - 'engine-delete-stack-macro' - job-template: name: 'engine-verify-online-{phase}-{distro}-{cloud}-{type}-{stream}' diff --git a/jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh b/jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh index da41d0b2b..f11c4d38b 100755 --- a/jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh +++ b/jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh @@ -27,6 +27,11 @@ if [[ "$EXECUTION_MODE" == "offline-deployment" && "$PROVISIONER_TYPE" == "heat" exit 0 fi +if [[ "$DELETE_STACK" != "true" || "$PROVISIONER_TYPE" != "heat" ]]; then + echo "Info : Skipping stack delete" + exit 0 +fi + set +u source /opt/engine/.venv/bin/activate set -u -- 2.25.1