From: Thanh Ha Date: Mon, 11 Jun 2018 23:04:14 +0000 (-0400) Subject: Use include-regions to limit packer build paths X-Git-Tag: v0.21.0~9^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F11184%2F6;p=releng%2Fglobal-jjb.git Use include-regions to limit packer build paths Issue: RELENG-1022 Change-Id: I283400e5ac2473e2eabb883c44a2a1e705b312ee Signed-off-by: Thanh Ha --- diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 668342a3..cc4399b9 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -53,22 +53,6 @@ - file-id: jjbini-sandbox target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini' -- lf_packer_file_paths: &lf_packer_file_paths - name: lf-packer-file-paths - file-paths: - - compare-type: ANT - pattern: 'packer/vars/{platforms}.json' - - compare-type: ANT - pattern: 'packer/templates/{templates}.json' - - compare-type: ANT - pattern: 'packer/provision/*.sh' - - compare-type: ANT - pattern: 'packer/provision/{templates}.yaml' - - compare-type: ANT - pattern: 'packer/provision/local-{templates}.yaml' - - compare-type: ANT - pattern: 'packer/provision/lib/**' - - lf_packer: &lf_packer_common name: lf-packer-common # Provide configuration common in packer jobs. @@ -703,15 +687,6 @@ - lf_packer_merge: &lf_packer_merge name: lf-packer-merge - ###################### - # Default parameters # - ###################### - - gerrit_merge_triggers: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: remerge$ - ##################### # Job Configuration # ##################### @@ -733,8 +708,21 @@ # yamllint disable-line rule:key-duplicates <<: *lf_packer_merge + ###################### + # Default parameters # + ###################### + git-url: '$GIT_URL/$GERRIT_PROJECT' + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + ##################### + # Job Configuration # + ##################### + scm: - lf-infra-gerrit-scm: git-url: '{git-url}' @@ -755,7 +743,17 @@ branches: - branch-compare-type: ANT branch-pattern: '**/{branch}' - <<: *lf_packer_file_paths + file-paths: + - compare-type: REG_EXP + pattern: 'packer\/provision\/.*\.sh' + - compare-type: REG_EXP + pattern: 'packer\/provision\/{templates}\.yaml' + - compare-type: REG_EXP + pattern: 'packer\/provision\/local-{templates}\.yaml' + - compare-type: REG_EXP + pattern: 'packer\/templates\/{templates}\.json' + - compare-type: REG_EXP + pattern: 'packer\/vars\/{platforms}\.json' - job-template: name: '{project-name}-packer-merge-{platforms}-{templates}' @@ -764,6 +762,10 @@ # yamllint disable-line rule:key-duplicates <<: *lf_packer_merge + ##################### + # Job Configuration # + ##################### + properties: - github: url: '{git-url}/{github-org}/{project}' @@ -782,15 +784,24 @@ - github - pollscm: cron: '' - - lf-infra-github-pr-trigger: + + - github-pull-request: trigger-phrase: '^remerge$' only-trigger-phrase: true - status-context: 'Packer {platforms}-${templates} Merge' + status-context: 'Packer {platforms}-{templates} Merge' permit-all: false github-hooks: true - github-org: '{github-org}' - github_pr_whitelist: '{obj:github_pr_whitelist}' - github_pr_admin_list: '{obj:github_pr_admin_list}' + org-list: + - '{github-org}' + white-list: '{obj:github_pr_whitelist}' + admin-list: '{obj:github_pr_admin_list}' + # included-regions MUST match Gerrit Trigger file-paths + included-regions: + - 'packer\/provision\/.*\.sh' + - 'packer\/provision\/{templates}\.yaml' + - 'packer\/provision\/local-{templates}\.yaml' + - 'packer\/templates\/{templates}\.json' + - 'packer\/vars\/{platforms}\.json' ################# # Packer Verify # @@ -815,14 +826,12 @@ 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/**' + - compare-type: REG_EXP + pattern: 'packer\/.*' + + # github_included_regions MUST match gerrit_trigger_file_paths + github_included_regions: + - 'packer\/.*' ##################### # Job Configuration # @@ -842,8 +851,16 @@ # yamllint disable-line rule:key-duplicates <<: *lf_packer_verify + ###################### + # Default parameters # + ###################### + git-url: '$GIT_URL/$GERRIT_PROJECT' + ##################### + # Job Configuration # + ##################### + scm: - lf-infra-gerrit-scm: git-url: '{git-url}' @@ -872,6 +889,10 @@ # yamllint disable-line rule:key-duplicates <<: *lf_packer_verify + ##################### + # Job Configuration # + ##################### + properties: - github: url: '{git-url}/{github-org}/{project}' @@ -886,14 +907,10 @@ jenkins-ssh-credential: '{jenkins-ssh-credential}' triggers: - - lf-infra-github-pr-trigger: + - github-pull-request: trigger-phrase: '^recheck$' only-trigger-phrase: false status-context: 'Packer Verify' permit-all: true github-hooks: true - github-org: '' - github_pr_whitelist: - - '' - github_pr_admin_list: - - '' + included-regions: '{obj:github_included_regions}'