Add method to not trigger downstream ar-jobs 59/61459/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 2 Aug 2017 16:06:23 +0000 (12:06 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 9 Aug 2017 20:10:07 +0000 (16:10 -0400)
When we are triggering many autorelease jobs per day we do not wish to
trigger distribution-test jobs for every run otherwise it will spam the
Jenkins queue. This allows us to selectively disable triggering the jobs
when we manually build.

Change-Id: Ia345b3875bd29e5869bc09aa378314d542fef181
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/autorelease/autorelease-templates.yaml

index ee3bb89c275110aaea145ba77d8a8d6294b3941e..d1e3ec70601c75bfb0e6ddfe46fa82e2dc78198c 100644 (file)
           name: ARCHIVE_ARTIFACTS
           default: '{archive-artifacts}'
           description: Artifacts to archive to the logs server.
+      - bool:
+          name: TRIGGER_DOWNSTREAM_JOBS
+          default: true
+          description: |
+              Used by the post-build-script step to determine if downstream
+              jobs should be triggered for this run or not.
 
     scm:
       - git:
 
     publishers:
       - opendaylight-infra-notify-status
-      - trigger-parameterized-builds:
-          - project: 'integration-distribution-test-{integration-test}'
-            condition: UNSTABLE_OR_BETTER
-            property-file: variables.jenkins-trigger
-            fail-on-missing: true
-          - project: 'integration-distribution-test-{integration-test}'
-            condition: FAILED
-            trigger-with-no-params: true
-          - project: 'integration-sanity-test-{integration-test}'
-            condition: UNSTABLE_OR_BETTER
-            property-file: variables.jenkins-trigger
-            fail-on-missing: true
-          - project: 'integration-sanity-test-{integration-test}'
-            condition: FAILED
-            trigger-with-no-params: true
-          - project: 'packaging-build-rpm-{stream}'
-            condition: UNSTABLE_OR_BETTER
-            predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
-            property-file: variables.jenkins-trigger
-            fail-on-missing: true
-          - project: 'packaging-build-deb-{stream}'
-            condition: UNSTABLE_OR_BETTER
-            predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
-            property-file: variables.jenkins-trigger
-            fail-on-missing: true
+      - postbuildscript:
+          builders:
+            - conditional-step:
+                condition-kind: boolean-expression
+                condition-expression: $TRIGGER_DOWNSTREAM_JOBS
+                steps:
+                  - trigger-builds:
+                      - project: 'integration-distribution-test-{integration-test}'
+                        condition: UNSTABLE_OR_BETTER
+                        property-file: variables.jenkins-trigger
+                        fail-on-missing: true
+                      - project: 'integration-distribution-test-{integration-test}'
+                        condition: FAILED
+                        trigger-with-no-params: true
+                      - project: 'integration-sanity-test-{integration-test}'
+                        condition: UNSTABLE_OR_BETTER
+                        property-file: variables.jenkins-trigger
+                        fail-on-missing: true
+                      - project: 'integration-sanity-test-{integration-test}'
+                        condition: FAILED
+                        trigger-with-no-params: true
+                      - project: 'packaging-build-rpm-{stream}'
+                        condition: UNSTABLE_OR_BETTER
+                        predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
+                        property-file: variables.jenkins-trigger
+                        fail-on-missing: true
+                      - project: 'packaging-build-deb-{stream}'
+                        condition: UNSTABLE_OR_BETTER
+                        predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
+                        property-file: variables.jenkins-trigger
+                        fail-on-missing: true
+          script-only-if-succeeded: false
+          script-only-if-failed: false
       - lf-infra-publish
 
 - job-template: