[iec] Trigger all usecases in parent jobs 21/721/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 16 May 2019 19:31:53 +0000 (21:31 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 19 May 2019 19:36:25 +0000 (21:36 +0200)
This should fix the unresolved job reference for seba_on_arm by
using j2 templates to create triggers for all usecases defined.

While at it, fix missing {deploy-type} in trigger name and rename
all occurences of s/deploy-type/deploy_type/g since jinja2 does
not allow dashes ('-') in variable names.

Change-Id: Ibeffa1fde45d7be498301d084b07f1577b992bae
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
jjb/iec/iec.yaml

index 4cb9440..edeba00 100644 (file)
@@ -17,7 +17,7 @@
     # -------------------------------
     # DEPLOY TYPE DEFINITIONS
     # -------------------------------
-    deploy-type:
+    deploy_type:
       - fuel-baremetal:
           slave-label: 'aarch64_dev'
           scenario: 'k8-calico-iec-noha'
@@ -37,9 +37,9 @@
           scenario: 'k8-calico-iec-noha'
 
     jobs:
-      - 'iec-{deploy-type}-daily-{stream}'
-      - 'iec-deploy-{deploy-type}-daily-{stream}'
-      - 'iec-install-{usecase}-{deploy-type}-daily-{stream}'
+      - 'iec-{deploy_type}-daily-{stream}'
+      - 'iec-deploy-{deploy_type}-daily-{stream}'
+      - 'iec-install-{usecase}-{deploy_type}-daily-{stream}'
 
 ##############
 # PARAMETERS #
@@ -83,7 +83,7 @@
 # job templates
 ########################
 - job-template:
-    name: 'iec-{deploy-type}-daily-{stream}'
+    name: 'iec-{deploy_type}-daily-{stream}'
     disabled: '{obj:disabled}'
     concurrent: false
     node: '{slave-label}'
@@ -96,7 +96,7 @@
       - build-blocker:
           use-build-blocker: true
           blocking-jobs:
-            - '.*-{deploy-type}-daily-.*'
+            - '.*-{deploy_type}-daily-.*'
           blocking-level: 'NODE'
 
     wrappers:
           name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
 
     triggers:
-      - 'iec-{deploy-type}-daily-{stream}-trigger'
+      - 'iec-{deploy_type}-daily-{stream}-trigger'
 
     parameters:
       - lf-infra-parameters:
 
     builders:
       - trigger-builds:
-          - project: 'iec-deploy-{deploy-type}-daily-{stream}'
+          - project: 'iec-deploy-{deploy_type}-daily-{stream}'
             current-parameters: false
-            predefined-parameters: |
+            predefined-parameters:
               DEPLOY_SCENARIO={scenario}
             same-node: true
             block: true
-          - project: 'iec-install-{usecase}-daily-{stream}'
+          - project:
+              !j2: |
+                {%- for uc in usecase -%}
+                iec-install-{{ uc | first }}-{{ deploy_type }}-daily-{{ stream }}
+                {%- if not loop.last -%},{%- endif -%}
+                {%- endfor %}
             current-parameters: false
             same-node: true
             block: true
 
 - job-template:
-    name: 'iec-deploy-{deploy-type}-daily-{stream}'
+    name: 'iec-deploy-{deploy_type}-daily-{stream}'
     concurrent: true
     node: '{slave-label}'
     properties:
       - build-blocker:
           use-build-blocker: true
           blocking-jobs:
-            - '.*-deploy-{deploy-type}-daily-*'
+            - '.*-deploy-{deploy_type}-daily-*'
           blocking-level: 'NODE'
 
     parameters:
       - conditional-step:
           condition-kind: regex-match
           regex: 'compass-.*'
-          label: '{deploy-type}'
+          label: '{deploy_type}'
           steps:
             - shell:
                 !include-raw-escape: ./iec-compass-build.sh
       - conditional-step:
           condition-kind: regex-match
           regex: 'fuel-.*'
-          label: '{deploy-type}'
+          label: '{deploy_type}'
           steps:
             - shell:
                 !include-raw-escape: ./iec-fuel-deploy.sh
           recipients: armband@enea.com
 
 - job-template:
-    name: 'iec-install-{usecase}-{deploy-type}-daily-{stream}'
+    name: 'iec-install-{usecase}-{deploy_type}-daily-{stream}'
     concurrent: true
     node: '{slave-label}'
     properties:
       - build-blocker:
           use-build-blocker: true
           blocking-jobs:
-            - '.*-deploy-{deploy-type}-daily-*'
-            - '.*-install-{usecase}-{deploy-type}-daily-*'
+            - '.*-deploy-{deploy_type}-daily-*'
+            - '.*-install-{usecase}-{deploy_type}-daily-*'
           blocking-level: 'NODE'
 
     parameters:
 
     wrappers:
       - build-name:
-          name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${deploy-type}'
+          name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${deploy_type}'
 
     scm: *scm