xci: Make post merge job common across all scenarios 05/54105/1
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 19 Mar 2018 12:45:39 +0000 (13:45 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Mon, 19 Mar 2018 12:45:39 +0000 (13:45 +0100)
It is difficuly to have post-merge jobs per scenario since we set
the scenario during job runtime and having jobs per scenario makes
things unnecessarily complicated. Apart from that, there is no
reason to have scenario specific merge jobs either since this is
some kind of verify job and everything is same except the scenario
name itself which we extract via set-scenario script.

Daily and further jobs will be scenario specific since they will
be run on timer and we will have ability to specify the scenario.

Change-Id: I3bf6d5ce0fbc48b2d2b2b9695e198bad229ce08d
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
jjb/xci/xci-merge-jobs.yml

index 8a3a7cf..a7c14ce 100644 (file)
       - opensuse:
           disabled: false
     # -------------------------------
-    # scenarios
-    # -------------------------------
-    scenario:
-      - 'os-odl-sfc':
-          project: sfc
-    # -------------------------------
-    # type
-    # -------------------------------
-    type:
-      - virtual
-    # -------------------------------
     # postmerge promotion phases
     # -------------------------------
     phase:
     # jobs
     # -------------------------------
     jobs:
-      - 'xci-{scenario}-{type}-merge-{stream}'
-      - 'xci-{scenario}-{type}-promote-merge-{stream}'
-      - 'xci-merge-{distro}-{type}-{stream}'
-      - 'xci-merge-{distro}-{phase}-{type}-{stream}'
+      - 'xci-merge-virtual-{stream}'
+      - 'xci-merge-promote-virtual-{stream}'
+      - 'xci-merge-{distro}-virtual-{stream}'
+      - 'xci-merge-{distro}-{phase}-virtual-{stream}'
 # -------------------------------
 # job templates
 # -------------------------------
 - job-template:
-    name: 'xci-{scenario}-{type}-merge-{stream}'
+    name: 'xci-merge-virtual-{stream}'
 
     project-type: multijob
 
@@ -76,8 +65,8 @@
             - comment-added-contains-event:
                 comment-contains-value: 'remerge'
           projects:
-            - project-compare-type: 'ANT'
-              project-pattern: '{obj:project}'
+            - project-compare-type: 'REG_EXP'
+              project-pattern: 'sfc|sdnvpn'
               branches:
                 - branch-compare-type: 'ANT'
                   branch-pattern: '**/{branch}'
           description: 'Git URL to use on this Jenkins Slave'
 
     builders:
-      - description-setter:
-          description: "Node: $NODE_NAME"
       - 'xci-merge-set-scenario-macro'
+      - inject:
+          properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
+      - description-setter:
+          description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
       - multijob:
           name: deploy and test
           condition: SUCCESSFUL
           projects:
-            - name: 'xci-merge-opensuse-{type}-{stream}'
+            - name: 'xci-merge-opensuse-virtual-{stream}'
               current-parameters: false
               predefined-parameters: |
                 DISTRO=opensuse
               node-parameters: false
               kill-phase-on: FAILURE
               abort-all-job: true
-            - name: 'xci-merge-ubuntu-{type}-{stream}'
+            - name: 'xci-merge-ubuntu-virtual-{stream}'
               current-parameters: false
               predefined-parameters: |
                 DISTRO=ubuntu
               node-parameters: false
               kill-phase-on: FAILURE
               abort-all-job: true
-            - name: 'xci-merge-centos-{type}-{stream}'
+            - name: 'xci-merge-centos-virtual-{stream}'
               current-parameters: false
               predefined-parameters: |
                 DISTRO=centos
           name: promote
           condition: SUCCESSFUL
           projects:
-            - name: 'xci-{scenario}-{type}-promote-merge-{stream}'
+            - name: 'xci-merge-promote-virtual-{stream}'
               current-parameters: true
               predefined-parameters: |
                 GERRIT_PROJECT=$GERRIT_PROJECT
               abort-all-job: true
 
 - job-template:
-    name: 'xci-merge-{distro}-{type}-{stream}'
+    name: 'xci-merge-{distro}-virtual-{stream}'
 
     project-type: multijob
 
           name: deploy
           condition: SUCCESSFUL
           projects:
-            - name: 'xci-merge-{distro}-deploy-{type}-{stream}'
+            - name: 'xci-merge-{distro}-deploy-virtual-{stream}'
               current-parameters: true
               predefined-parameters: |
                 DISTRO={distro}
           name: healthcheck
           condition: SUCCESSFUL
           projects:
-            - name: 'xci-merge-{distro}-healthcheck-{type}-{stream}'
+            - name: 'xci-merge-{distro}-healthcheck-virtual-{stream}'
               current-parameters: true
               predefined-parameters: |
                 DISTRO={distro}
                 !include-raw: ./xci-cleanup.sh
 
 - job-template:
-    name: 'xci-merge-{distro}-{phase}-{type}-{stream}'
+    name: 'xci-merge-{distro}-{phase}-virtual-{stream}'
 
     disabled: false
 
       - 'xci-merge-{phase}-macro'
 
 - job-template:
-    name: 'xci-{scenario}-{type}-promote-merge-{stream}'
+    name: 'xci-merge-promote-virtual-{stream}'
 
     disabled: false