Consolidate integration scm and triggers macros 21/26421/2
authorLuis Gomez <ecelgp@gmail.com>
Wed, 2 Sep 2015 21:16:40 +0000 (14:16 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 2 Sep 2015 21:53:06 +0000 (14:53 -0700)
integration-gerrit-scm: downloads a project gerrit
integration-distribution-scm: downloads integration/distribution
integration-trigger-patch-submitted: trigger for patch submitted
integration-trigger-patch-merged: trigger for patch submitted

Change-Id: I509e60b70cc9f9d30ec5240091d52c8d60b0aaea
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
jjb/integration/integration-macros.yaml
jjb/integration/integration-templates.yaml
jjb/integration/integration-test-jobs.yaml

index e9c8d10bbcbffd194fedd2bec3f7c57c0f4cda07..77db9db0b434aa25cd6fef3f17b2db31abf36e4a 100644 (file)
@@ -63,8 +63,8 @@
             description: 'Integration Patch Refspec'
 
 # Macro: integration-gerrit-scm
-# Operation: this macro downloads a project gerrit and using the project name as basedir
-# Used by: integration-patch-test-{stream} job template
+# Operation: this macro downloads a project gerrit
+# Used by: all csit jobs
 
 - scm:
     name: integration-gerrit-scm
         - git:
             credentials-id: '{credentials-id}'
             url: '$GIT_BASE'
-            basedir: '$GERRIT_PROJECT'
-            refspec: '$GERRIT_REFSPEC'
-            branches:
-                - 'origin/{branch}'
-            skip-tag: true
-            choosing-strategy: 'gerrit'
-
-# Macro: integration-gerrit-test-scm
-# Operation: this macro downloads an integration/test gerrit using test as basedir
-# Used by: {project}-verify-csit-* job templates
-
-- scm:
-    name: integration-gerrit-test-scm
-    scm:
-        - git:
-            credentials-id: '{credentials-id}'
-            url: '$GIT_BASE'
-            basedir: 'test'
-            refspec: '$GERRIT_REFSPEC'
+            basedir: '{basedir}'
+            refspec: '{refspec}'
             branches:
                 - 'origin/{branch}'
             skip-tag: true
@@ -98,7 +81,7 @@
 
 # Macro: integration-distribution-scm
 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
-# Used by: {project}-csit-* and integration-patch-test-{stream} job templates
+# Used by: integration-patch-test-{stream} job template
 
 - scm:
     name: integration-distribution-scm
                 - 'origin/{branch}'
             skip-tag: true
 
-# Macro: integration-patch-scm
-# Operation: this macro downloads a test patch that can be used to debug in the sandbox
-# Used by: {project}-csit-* job templates
-
-- scm:
-    name: integration-test-scm
-    scm:
-        - git:
-            credentials-id: '{credentials-id}'
-            basedir: 'test'
-            url: '$GIT_BASE'
-            refspec: '$PATCHREFSPEC'
-            branches:
-                - 'origin/{branch}'
-            skip-tag: true
-            choosing-strategy: 'gerrit'
-
-# Macro: integration-test-gerrit-trigger-patch-submitted
-# Operation: this macro sets a trigger for patch submit on csit/suites/{project}/**
+# Macro: integration-trigger-patch-submitted
+# Operation: this macro sets a trigger for patch submitted on a path pattern
 # Used by: {project}-verify-csit-* job templates
 
 - trigger:
-    name: integration-test-gerrit-trigger-patch-submitted
-    triggers:
-        - gerrit:
-            server-name: 'OpenDaylight'
-            trigger-on:
-                - patchset-created-event:
-                    exclude-drafts: 'true'
-                    exclude-trivial-rebase: 'false'
-                    exclude-no-code-change: 'true'
-                - draft-published-event
-                - comment-added-contains-event:
-                    comment-contains-value: 'recheck'
-                - comment-added-contains-event:
-                    comment-contains-value: 'reverify'
-            projects:
-              - project-compare-type: 'ANT'
-                project-pattern: '{name}'
-                branches:
-                  - branch-compare-type: 'ANT'
-                    branch-pattern: '**/{branch}'
-                file-paths:
-                  - compare-type: 'ANT'
-                    pattern: 'csit/suites/{project}/**'
-
-# Macro: integration-csit-gerrit-trigger-patch-submitted
-# Operation: this macro sets a trigger for patch submit on csit/libraries
-# Used by: integration-verify-csit-1node-{stream} job template
-
-- trigger:
-    name: integration-csit-gerrit-trigger-patch-submitted
+    name: integration-trigger-patch-submitted
     triggers:
         - gerrit:
             server-name: 'OpenDaylight'
                     branch-pattern: '**/{branch}'
                 file-paths:
                   - compare-type: 'ANT'
-                    pattern: 'csit/libraries/*'
+                    pattern: '{pattern}'
 
-# Macro: integration-csit-gerrit-trigger-patch-merged
-# Operation: this macro sets a trigger for patch merged on csit/**
+# Macro: integration-trigger-patch-merged
+# Operation: this macro sets a trigger for patch merged on a path pattern
 # Used by: not used yet
 
 - trigger:
-    name: integration-csit-gerrit-trigger-patch-merged
+    name: integration-trigger-patch-merged
     triggers:
         - gerrit:
             server-name: 'OpenDaylight'
                     branch-pattern: '**/{branch}'
                 file-paths:
                   - compare-type: 'ANT'
-                    pattern: 'csit/**'
+                    pattern: '{pattern}'
 
 # Macro: integration-jclouds-controller-mininet
 # Operation: this macro will spin the controller and mininet vms
index f69ee328ec9f20829810901bf4463ca812aa4c3b..65645124e4b09b4cefd97ade2ef8c404097eafac 100644 (file)
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: 'master'
-        - integration-gerrit-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$GERRIT_REFSPEC'
             branch: 'master'
 
     wrappers:
                 - '{ssh-credentials}'
 
     triggers:
-        - integration-test-gerrit-trigger-patch-submitted:
+        - integration-trigger-patch-submitted:
             name: 'integration/test'
             branch: 'master'
-            project: '{project}'
+            pattern: 'csit/suites/{project}/**'
 
     builders:
         - integration-get-slave-addresses
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: '{branch}'
-        - integration-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
-            branch: 'stable/helium'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
+            branch: 'master'
 
     wrappers:
         - build-timeout
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: 'master'
-        - integration-gerrit-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$GERRIT_REFSPEC'
             branch: 'master'
 
     wrappers:
                 - '{ssh-credentials}'
 
     triggers:
-        - integration-test-gerrit-trigger-patch-submitted:
+        - integration-trigger-patch-submitted:
             name: 'integration/test'
             branch: 'master'
-            project: '{project}'
+            pattern: 'csit/suites/{project}/**'
 
     builders:
         - integration-get-slave-addresses
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: '{branch}'
-        - integration-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
             branch: 'master'
 
     wrappers:
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: '{branch}'
-        - integration-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
             branch: 'master'
 
     wrappers:
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: 'master'
-        - integration-gerrit-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$GERRIT_REFSPEC'
             branch: 'master'
 
     wrappers:
                 - '{ssh-credentials}'
 
     triggers:
-        - integration-test-gerrit-trigger-patch-submitted:
+        - integration-trigger-patch-submitted:
             name: 'integration/test'
             branch: 'master'
-            project: '{project}'
+            pattern: 'csit/suites/{project}/**'
 
     builders:
         - integration-get-slave-addresses
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: '{branch}'
-        - integration-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
             branch: 'master'
 
     wrappers:
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: '{branch}'
-        - integration-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
             branch: 'master'
 
     wrappers:
index 1a0e144613deec7b89ad2a1eda77151c4201b0d5..0aed4db9ec6eb592517b7c9df3084a9d3c8ddc6e 100644 (file)
             project: 'integration/test'
 
     scm:
-        - integration-gerrit-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$GERRIT_REFSPEC'
             branch: 'master'
 
     wrappers:
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'
             branch: 'master'
-        - integration-gerrit-test-scm:
+        - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$GERRIT_REFSPEC'
             branch: 'master'
 
     wrappers:
                 - '{ssh-credentials}'
 
     triggers:
-        - integration-csit-gerrit-trigger-patch-submitted:
+        - integration-trigger-patch-submitted:
             name: 'integration/test'
             branch: 'master'
+            pattern: 'csit/libraries/*'
 
     builders:
         - integration-get-slave-addresses
     scm:
         - integration-gerrit-scm:
             credentials-id: '{ssh-credentials}'
+            basedir: '$GERRIT_PROJECT'
+            refspec: '$GERRIT_REFSPEC'
             branch: '{branch}'
         - integration-distribution-scm:
             credentials-id: '{ssh-credentials}'