Add job to update auto update CSIT Tests 02/51102/5
authorMarcus G K Williams <marcus.williams@intel.com>
Fri, 27 Jan 2017 02:11:23 +0000 (18:11 -0800)
committerMarcus G K Williams <marcus.williams@intel.com>
Fri, 27 Jan 2017 17:49:49 +0000 (09:49 -0800)
This job adds auto update funtionality
for csit tests run by integration-distribution-test
jobs.

- Adds a variable for csit blacklist
- Add job named builder-update-csit-tests
- Adds explanitory comments to each section
- Fixed issue with default variable values
  in include-raw-integration-list-jobs.sh

Change-Id: I7363c91949e957281feda1976ac49aa976fae611
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
jjb/integration/include-raw-integration-list-jobs.sh
jjb/integration/integration-macros.yaml
jjb/releng-defaults.yaml
jjb/releng-jobs.yaml

index d8db9a05984e9715dc57be027817e23ff7ef5b83..769cbc6667d3b559c45136607bd4c9034fada7d2 100644 (file)
@@ -2,22 +2,11 @@
 # Script to filter Jenkins jobs against a blacklist
 # output: newline & comma-separated list
 
-system=releng
+system="releng"
 search_string="{search_string}"
-if [ -n "$search_string" ] ; then
-    search_string=csit
-fi
-
 blacklist_in="{blacklist}"
-if [ -n "$blacklist_in" ] ; then
-    blacklist_in="longevity gate"
-fi
 blacklist=( $(echo ${{blacklist_in}}) )
-
 stream="{stream}"
-if [ -n "$stream" ] ; then
-    stream=carbon
-fi
 
 wget --quiet -O jenkins-jobs.xml https://jenkins.opendaylight.org/$system/api/xml
 jobs=$(xmlstarlet sel -t -m '//hudson/job' \
index d92bfd5698b993673447719c93f119e0d89228cf..8e99a610aa9c160d9adef1e7a02b2d65ff2d5c40 100644 (file)
 #   {blacklist}         List of sub-projects to filter out (e.g. longevity)
 #   {stream}            Development release name (e.g. boron)
 #   {jobs-filename}     Filename to write list into (e.g. carbon-jobs.lst)
+# NOTE: Requires xmlstarlet installed on node.
 
 - builder:
     name: integration-list-jobs
index cb245e9bca1ad86645cede91c4734e0e9fd1ccdb..0dcb20ec53ae79c8046078f3e47b917f52e7c67e 100644 (file)
     10-inclusion-flag: 'off'
     10-exclude-value: ''
 
-    # CSIT Test Lists
+    ### CSIT Test List Variables
+    # Space seperated strings to exclude from CSIT lists
+    csit-list-blacklist: 'longevity gate'
+    # Auto Generated CSIT job lists used
+    # in integration-distribution-test jobs
     csit-list-carbon: >
         controller-csit-3node-clustering-only-carbon,
         controller-csit-3node-clustering-all-carbon,
index 4d892c74f99814c5109a82e1f15a5c4fcbd3cc36..854bd18dc10e5e1ca3820505a1671e3cb83ad0eb 100644 (file)
@@ -9,6 +9,7 @@
         - 'builder-verify-packer'
         - 'builder-merge-packer-{platforms}-{templates}'
         - 'builder-delete-stale-stacks'
+        - 'builder-update-csit-tests'
 
     platforms:
         - centos
                       pattern: jjb/**
 
     builders:
-        - shell: |
-            git checkout -b auto-update-csit-jobs
-        - integration-list-jobs:
-            blacklist: "longevity gate"
-            search_string: "csit"
-            stream: "carbon"
-            jobs-filename: "csit_jobs_carbon.lst"
-        - integration-list-jobs:
-            blacklist: "longevity gate"
-            search_string: "csit"
-            stream: "boron"
-            jobs-filename: "csit_jobs_boron.lst"
-        - integration-list-jobs:
-            blacklist: "longevity gate"
-            search_string: "csit"
-            stream: "beryllium"
-            jobs-filename: "csit_jobs_beryllium.lst"
-        - integration-replace-block-text:
-            starting-regex: "'csit-list-carbon: >'"
-            ending-regex: "'csit-list-boron: >'"
-            file-with-changes-to-insert: "'csit_jobs_carbon.lst'"
-            file-to-change: "'jjb/releng-defaults.yaml'"
-        - integration-replace-block-text:
-            starting-regex: "'csit-list-boron: >'"
-            ending-regex: "'csit-list-beryllium: >'"
-            file-with-changes-to-insert: "'csit_jobs_boron.lst'"
-            file-to-change: "'jjb/releng-defaults.yaml'"
-        - integration-replace-block-text:
-            starting-regex: "'csit-list-beryllium: >'"
-            ending-regex: "'# CSIT TESTS END SED MARKER'"
-            file-with-changes-to-insert: "'csit_jobs_beryllium.lst'"
-            file-to-change: "'jjb/releng-defaults.yaml'"
-        - shell: |
-            git status
-            git add jjb/releng-defaults.yaml
-        - opendaylight-infra-push-gerrit-patch:
-            project: "releng/builder"
-            gerrit-topic: "auto-update-csit-jobs"
-            gerrit-commit-message: "Auto Update CSIT Jobs to run"
-        - shell: |
-            git checkout master
         - shell: |
             pip freeze
             jenkins-jobs --version
             email-prefix: '[{project}]'
         - opendaylight-infra-shiplogs:
             maven-version: 'mvn33'
+
+- job-template:
+    name: 'builder-update-csit-tests'
+    node: centos7-java-builder-2c-8g
+
+    # builder-update-csit-tests job
+    #
+    # This job's purpose is to update csit
+    # tests to run in integration-distribution-test-{stream}
+    # by updating releng-defaults variables: csit-list-carbon,
+    # csit-list-boron, csit-list-beryllium
+
+    project-type: freestyle
+
+    properties:
+        - opendaylight-infra-properties:
+            build-days-to-keep: 14
+
+    wrappers:
+        - opendaylight-infra-wrappers:
+            build-timeout: '{build-timeout}'
+
+    triggers:
+        - reverse:
+               jobs: 'build-merge'
+
+    builders:
+        - shell: |
+            git checkout -b auto-update-csit-jobs
+        - integration-list-jobs:
+            blacklist: '{csit-list-blacklist}'
+            search_string: "csit"
+            stream: "carbon"
+            jobs-filename: "csit_jobs_carbon.lst"
+        - integration-list-jobs:
+            blacklist: '{csit-list-blacklist}'
+            search_string: "csit"
+            stream: "boron"
+            jobs-filename: "csit_jobs_boron.lst"
+        - integration-list-jobs:
+            blacklist: '{csit-list-blacklist}'
+            search_string: "csit"
+            stream: "beryllium"
+            jobs-filename: "csit_jobs_beryllium.lst"
+        - integration-replace-block-text:
+            starting-regex: "'csit-list-carbon: >'"
+            ending-regex: "'csit-list-boron: >'"
+            file-with-changes-to-insert: "'csit_jobs_carbon.lst'"
+            file-to-change: "'jjb/releng-defaults.yaml'"
+        - integration-replace-block-text:
+            starting-regex: "'csit-list-boron: >'"
+            ending-regex: "'csit-list-beryllium: >'"
+            file-with-changes-to-insert: "'csit_jobs_boron.lst'"
+            file-to-change: "'jjb/releng-defaults.yaml'"
+        - integration-replace-block-text:
+            starting-regex: "'csit-list-beryllium: >'"
+            ending-regex: "'# CSIT TESTS END SED MARKER'"
+            file-with-changes-to-insert: "'csit_jobs_beryllium.lst'"
+            file-to-change: "'jjb/releng-defaults.yaml'"
+        - shell: |
+            git status
+            git add jjb/releng-defaults.yaml
+        - opendaylight-infra-push-gerrit-patch:
+            project: "releng/builder"
+            gerrit-topic: "auto-update-csit-jobs"
+            gerrit-commit-message: "Auto Update CSIT Jobs to run"
+
+    publishers:
+        - email-notification:
+            email-recipients: '{email-recipients}'
+            email-prefix: '[releng]'
+        - opendaylight-infra-shiplogs:
+            maven-version: 'mvn33'