Merge "xci: Create periodic bifrost jobs to find working version"
[releng.git] / jjb / global / releng-macros.yml
index 60fa22d..ced335c 100644 (file)
             name: GS_BASE_PROXY
             default: build.opnfv.org/artifacts.opnfv.org/$PROJECT
             description: "URL to Google Storage proxy"
-
-- parameter:
-    name: gerrit-parameter
-    parameters:
+        - string:
+            name: BRANCH
+            default: '{branch}'
+            description: "JJB configured BRANCH parameter (e.g. master, stable/danube)"
         - string:
             name: GERRIT_BRANCH
             default: '{branch}'
-            description: "JJB configured GERRIT_BRANCH parameter"
+            description: "JJB configured GERRIT_BRANCH parameter (deprecated)"
 
 - property:
     name: logrotate-default
@@ -51,7 +51,7 @@
             credentials-id: '$SSH_CREDENTIAL_ID'
             url: '$GIT_BASE'
             branches:
-                - 'origin/$GERRIT_BRANCH'
+                - 'origin/$BRANCH'
             timeout: 15
 
 - scm:
             choosing-strategy: 'gerrit'
             refspec: '$GERRIT_REFSPEC'
             <<: *git-scm-defaults
-
+- scm:
+    name: git-scm-with-submodules
+    scm:
+        - git:
+            credentials-id: '$SSH_CREDENTIAL_ID'
+            url: '$GIT_BASE'
+            refspec: ''
+            branches:
+                - 'refs/heads/{branch}'
+            skip-tag: true
+            wipe-workspace: true
+            submodule:
+                recursive: true
+                timeout: 20
 - trigger:
     name: 'daily-trigger-disabled'
     triggers:
@@ -72,9 +85,8 @@
     triggers:
         - timed: ''
 
-# NOTE: unused macro, but we may use this for some jobs.
 - trigger:
-    name: gerrit-trigger-patch-submitted
+    name: gerrit-trigger-patchset-created
     triggers:
         - gerrit:
             server-name: 'gerrit.opnfv.org'
                 - 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}'
+                project-pattern: '{project}'
                 branches:
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/{branch}'
+                file-paths:
+                  - compare-type: 'ANT'
+                    pattern: '{files}'
+            skip-vote:
+                successful: false
+                failed: false
+                unstable: false
+                notbuilt: false
 
-# NOTE: unused macro, but we may use this for some jobs.
 - trigger:
-    name: gerrit-trigger-patch-merged
+    name: gerrit-trigger-change-merged
     triggers:
         - gerrit:
             server-name: 'gerrit.opnfv.org'
                     comment-contains-value: 'remerge'
             projects:
               - project-compare-type: 'ANT'
-                project-pattern: '{name}'
+                project-pattern: '{project}'
                 branches:
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/{branch}'
+                file-paths:
+                  - compare-type: 'ANT'
+                    pattern: '{files}'
 
 - trigger:
     name: 'experimental'
             users:
                 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
 
+- wrapper:
+    name: fix-workspace-permissions
+    wrappers:
+        - pre-scm-buildstep:
+          - shell: |
+                #!/bin/bash
+                sudo chown -R $USER $WORKSPACE || exit 1
+
 - builder:
     name: build-html-and-pdf-docs-output
     builders:
               sed -r -i '4,$s/^/ /g' lint.log
             fi
 
+- builder:
+    name: clean-workspace-log
+    builders:
+        - shell: |
+            find $WORKSPACE -type f -name '*.log' | xargs rm -f
+
 - publisher:
     name: archive-artifacts
     publishers:
             allow-empty: true
             fingerprint: true
             latest-only: true
+
+- publisher:
+    name: publish-coverage
+    publishers:
+      - cobertura:
+          report-file: "coverage.xml"
+          only-stable: "true"
+          health-auto-update: "false"
+          stability-auto-update: "false"
+          zoom-coverage-chart: "true"
+          targets:
+            - files:
+                healthy: 10
+                unhealthy: 20
+                failing: 30
+            - method:
+                healthy: 50
+                unhealthy: 40
+                failing: 30
+