Merge "Use include-regions to limit MVN build paths"
authorJeremy Phelps <jphelps@linuxfoundation.org>
Wed, 13 Jun 2018 21:00:15 +0000 (21:00 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Wed, 13 Jun 2018 21:00:15 +0000 (21:00 +0000)
jjb/lf-rtd-jobs.yaml
shell/package-listing.sh

index 2b7ae8a..3c21dbc 100644 (file)
     ######################
 
     gerrit_trigger_file_paths:
-      - compare-type: ANT
-        pattern: '**/*.rst'
-      - compare-type: ANT
-        pattern: '**/conf.py'
+      - compare-type: REG_EXP
+        pattern: '.*\.css'
+      - compare-type: REG_EXP
+        pattern: '.*\.html'
+      - compare-type: REG_EXP
+        pattern: '.*\.rst'
+      - compare-type: REG_EXP
+        pattern: '.*\/conf.py'
+
+    # github_included_regions MUST match gerrit_trigger_file_paths
+    github_included_regions:
+      - '.*\.css'
+      - '.*\.html'
+      - '.*\.rst'
+      - '.*\/conf.py'
 
     #####################
     # Job Configuration #
           url: '{git-url}/{github-org}/{project}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      - timed: 'H H * * *'
+      - github
+      - pollscm:
+          cron: ''
+      - github-pull-request:
           trigger-phrase: '^remerge$'
-          only-trigger-phrase: false
+          only-trigger-phrase: true
           status-context: 'RTD Merge'
-          permit-all: true
+          permit-all: false
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
-      - timed: 'H H * * *'
+          org-list:
+            - '{github-org}'
+          white-list: '{obj:github_pr_whitelist}'
+          admin-list: '{obj:github_pr_admin_list}'
+          included-regions: '{obj:github_included_regions}'
 
 #############
 # RTD VERIFY#
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      - github-pull-request:
           trigger-phrase: '^recheck$'
           only-trigger-phrase: false
           status-context: 'RTD Verify'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
+          included-regions: '{obj:github_included_regions}'
index 0c35917..b2afe33 100644 (file)
@@ -18,18 +18,19 @@ set -x # Trace commands for this script to make debugging easier
 
 OS_FAMILY=$(facter osfamily | tr '[:upper:]' '[:lower:]')
 
+# Capture the CI WORKSPACE safely in the case that it doesn't exist
+workspace="${WORKSPACE:-}"
+
 START_PACKAGES=/tmp/packages_start.txt
 END_PACKAGES=/tmp/packages_end.txt
 DIFF_PACKAGES=/tmp/packages_diff.txt
 
-# This script may be run during system boot, if that is true then there will be
-# a starting_packages file. We will want to create a diff if we have a starting
-# packages file
+# Swap to creating END_PACKAGES if we are running in a CI job (determined by if
+# we have a workspace env) or if the starting packages listing already exists.
 PACKAGES="${START_PACKAGES}"
-if [ -f "${PACKAGES}" ]
+if ( [ "${workspace}" ] || [ -f "${START_PACKAGES}" ] )
 then
     PACKAGES="${END_PACKAGES}"
-    CREATEDIFF=1
 fi
 
 case "${OS_FAMILY}" in
@@ -46,15 +47,15 @@ case "${OS_FAMILY}" in
     ;;
 esac
 
-if [ "${CREATEDIFF}" ]
+if ( [ -f "${START_PACKAGES}" ] && [ -f "${END_PACKAGES}" ] )
 then
     diff "${START_PACKAGES}" "${END_PACKAGES}" > "${DIFF_PACKAGES}"
 fi
 
 # If running in a Jenkins job, then copy the created files to the archives
 # location
-if [ "${WORKSPACE}" ]
+if [ "${workspace}" ]
 then
-    mkdir -p "${WORKSPACE}/archives/"
-    cp -f /tmp/packages_*.txt "${WORKSPACE}/archives/"
+    mkdir -p "${workspace}/archives/"
+    cp -f /tmp/packages_*.txt "${workspace}/archives/"
 fi