Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / jjb / lf-pipeline-jobs.yaml
1 ---
2 ####################
3 # COMMON FUNCTIONS #
4 ####################
5
6 - _lf_pipeline_common: &lf_pipeline_common
7     name: lf-pipeline-common
8
9     ######################
10     # Default parameters #
11     ######################
12
13     gerrit_trigger_file_paths:
14       - compare-type: REG_EXP
15         pattern: "Jenkinsfile.*"
16
17     # github_included_regions MUST match gerrit_trigger_file_paths
18     github_included_regions:
19       - "Jenkinsfile.*"
20
21     #####################
22     # Job Configuration #
23     #####################
24
25     project-type: freestyle
26     node: "{build-node}"
27
28     properties:
29       - lf-infra-properties:
30           build-days-to-keep: 7
31
32     parameters:
33       - lf-infra-parameters:
34           project: "{project}"
35           branch: "{branch}"
36           refspec: "refs/heads/{branch}"
37           stream: "{stream}"
38
39     wrappers:
40       - lf-infra-wrappers:
41           build-timeout: "{build-timeout}"
42           jenkins-ssh-credential: "{jenkins-ssh-credential}"
43
44     publishers:
45       - lf-infra-publish
46
47 ##################
48 # PIPELINE VERIFY#
49 ##################
50
51 - _lf_pipeline_verify: &lf_pipeline_verify
52     name: lf-pipeline-verify
53
54     ######################
55     # Default parameters #
56     ######################
57
58     branch: master
59     build-days-to-keep: 7
60     build-timeout: 15
61     disable-job: false
62     git-url: "$GIT_URL/$PROJECT"
63     github-url: "https://github.com"
64     project-pattern: "**"
65     stream: master
66     submodule-recursive: true
67     submodule-timeout: 10
68     submodule-disable: false
69
70     gerrit_verify_triggers:
71       - patchset-created-event:
72           exclude-drafts: true
73           exclude-trivial-rebase: false
74           exclude-no-code-change: false
75       - draft-published-event
76       - comment-added-contains-event:
77           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
78
79     #####################
80     # Job Configuration #
81     #####################
82
83     disabled: "{disable-job}"
84
85     builders:
86       - lf-infra-pipeline-verify
87
88 - job-template:
89     name: "{project-name}-pipeline-verify-{stream}"
90     id: gerrit-pipeline-verify
91     concurrent: true
92     <<: *lf_pipeline_common
93     # yamllint disable-line rule:key-duplicates
94     <<: *lf_pipeline_verify
95
96     scm:
97       - lf-infra-gerrit-scm:
98           branch: "$GERRIT_BRANCH"
99           jenkins-ssh-credential: "{jenkins-ssh-credential}"
100           git-url: "{git-url}"
101           refspec: "$GERRIT_REFSPEC"
102           submodule-recursive: "{submodule-recursive}"
103           submodule-timeout: "{submodule-timeout}"
104           submodule-disable: "{submodule-disable}"
105           choosing-strategy: gerrit
106
107     triggers:
108       - gerrit:
109           server-name: "{gerrit-server-name}"
110           trigger-on: "{obj:gerrit_verify_triggers}"
111           projects:
112             - project-compare-type: "ANT"
113               project-pattern: "{project-pattern}"
114               branches:
115                 - branch-compare-type: "ANT"
116                   branch-pattern: "**/{branch}"
117               file-paths: "{obj:gerrit_trigger_file_paths}"
118
119 - job-template:
120     name: "{project-name}-pipeline-verify-{stream}"
121     id: github-pipeline-verify
122     concurrent: true
123     <<: *lf_pipeline_common
124     # yamllint disable-line rule:key-duplicates
125     <<: *lf_pipeline_verify
126
127     properties:
128       - lf-infra-properties:
129           build-days-to-keep: "{build-days-to-keep}"
130       - github:
131           url: "{github-url}/{github-org}/{project}"
132
133     scm:
134       - lf-infra-github-scm:
135           url: "{git-clone-url}{github-org}/{project}"
136           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
137           branch: "$sha1"
138           submodule-recursive: "{submodule-recursive}"
139           submodule-timeout: "{submodule-timeout}"
140           submodule-disable: "{submodule-disable}"
141           choosing-strategy: default
142           jenkins-ssh-credential: "{jenkins-ssh-credential}"
143
144     triggers:
145       - github-pull-request:
146           trigger-phrase: "^(recheck|reverify)$"
147           only-trigger-phrase: false
148           status-context: "Pipeline Verify"
149           permit-all: true
150           github-hooks: true
151           included-regions: "{obj:github_included_regions}"
152           white-list-target-branches:
153             - "{branch}"