Convert packer file-paths cfg to {obj:var} 99/6899/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Oct 2017 02:56:06 +0000 (22:56 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Oct 2017 03:14:46 +0000 (23:14 -0400)
This is a standard we are using in most jobs so let's follow it with the
CI jobs as well. Looks like the packer jobs were already documented for
this but never actually implemented the feature.

The merge job unfortunately cannot be converted to the format due to
it's use of {platform} and {template} variables unless we want to make
it use the same file-paths as the verify job is now using.

Change-Id: Ie2976506e109f0e90ae26b4b6e4492d6b112b73a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/lf-ci-jobs.yaml

index b0d699a..a83d87a 100644 (file)
             - file-id: jjbini-sandbox
               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
 
-- lf_packer_verify_file_paths: &lf_packer_verify_file_paths
-    name: lf-packer-verify-file-paths
-    file-paths:
-      # Common files for all projects
-      - compare-type: ANT
-        pattern: 'packer/vars/**.json'
-      - compare-type: ANT
-        pattern: 'packer/templates/**.json'
-      - compare-type: ANT
-        pattern: 'packer/provision/**.sh'
-      - compare-type: ANT
-        pattern: 'packer/provision/lib/**'
-
 - lf_packer_file_paths: &lf_packer_file_paths
     name: lf-packer-file-paths
     file-paths:
     #         (default: true)
     #
     #     :gerrit_verify_triggers: Override Gerrit Triggers.
-    #     :gerrit_trigger_file_paths: Override file paths which can be used to
-    #         filter which file modifications will trigger a build.
-    #         (default defined by lf_jjb_common)
 
     ######################
     # Default parameters #
     #     :gerrit_verify_triggers: Override Gerrit Triggers.
     #     :gerrit_trigger_file_paths: Override file paths which can be used to
     #         filter which file modifications will trigger a build.
-    #         (default defined by lf_jjb_common)
 
     ######################
     # Default parameters #
       - comment-added-contains-event:
           comment-contains-value: recheck$
 
+    gerrit_trigger_file_paths:
+      - compare-type: ANT
+        pattern: 'packer/vars/**.json'
+      - compare-type: ANT
+        pattern: 'packer/templates/**.json'
+      - compare-type: ANT
+        pattern: 'packer/provision/**.sh'
+      - compare-type: ANT
+        pattern: 'packer/provision/lib/**'
+
     #####################
     # Job Configuration #
     #####################
               branches:
                 - branch-compare-type: ANT
                   branch-pattern: '**/{branch}'
-              <<: *lf_packer_verify_file_paths
+              file-paths: '{obj:gerrit_trigger_file_paths}'
 
 - job-template:
     name: '{project-name}-packer-verify'