Delete stack upon completion 66/4066/2
authorFatih Degirmenci <fdegir@gmail.com>
Tue, 17 Mar 2020 23:16:49 +0000 (23:16 +0000)
committerFatih Degirmenci <fdegir@gmail.com>
Tue, 17 Mar 2020 23:57:52 +0000 (23:57 +0000)
Change-Id: Ie5103efaa6c924d4eddbbd622db3a145b0dfc59a

jjb/engine/engine-verify-jobs/engine-verify-deployment-parent-jobs.yaml
jjb/engine/engine-verify-jobs/engine-verify-offline-deploy-test.yaml
jjb/engine/engine-verify-jobs/engine-verify-online-deploy-test.yaml
jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh

index 5376bb06fd453e14399b6c1069467f995e965142..c83da3085304f5cf5a9b18aa1a0e0c855ba77003 100644 (file)
 
     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
               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
                 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
                 VERBOSITY=$VERBOSITY
                 DISTRO=$DISTRO
               kill-phase-on: FAILURE
-              abort-all-job: true
+              abort-all-job: false
 
 - job-template:
     name: 'engine-verify-packaging-{distro}-{stream}'
index 027657aa8a960f6a1ed392dfe7194eb054708c1f..8ed343ab75b98e4e9d16e4e47024b3c2bac5132b 100644 (file)
           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
               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}'
index c295c788cf5dd7c6e9d33ec5cdbb44ca5cb9b77a..7f3b903140b5d6c3158f5d22e1637ee10acf7b9e 100644 (file)
           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
               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}'
index da41d0b2bdc95a79df8d0a35b1be919374aef832..f11c4d38be1d5ccdbd3a0de5e41b55f1c8085dbe 100755 (executable)
@@ -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