lf-ci-jobs: Add git-validate-jira-urls.sh
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-ci-jobs'
4
5     # This job group contains all the recommended jobs that should be deployed
6     # for any project ci.
7
8     jjb-version: 1.6.2
9
10     jobs:
11       - gerrit-jjb-merge
12       - gerrit-jjb-verify
13
14 - job-group:
15     name: '{project-name}-github-ci-jobs'
16
17     # This job group contains all the recommended jobs that should be deployed
18     # for any project ci that is using github.
19
20     jjb-version: 1.6.2
21
22     jobs:
23       - 'github-jjb-merge'
24       - 'github-jjb-verify'
25
26
27 ####################
28 # Anchors & Macros #
29 ####################
30
31 - builder:
32     name: lf-infra-jjbini
33     builders:
34       - config-file-provider:
35           files:
36             - file-id: jjbini
37               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
38
39 - lf_jjb_file_paths: &lf_jjb_file_paths
40     name: lf-jjb-file-paths
41     file-paths:
42       - compare-type: ANT
43         pattern: '**/*.sh'
44       - compare-type: ANT
45         pattern: '**/*.yaml'
46
47 - lf_jjb_merge_builders: &lf_jjb_merge_builders
48     name: lf-jjb-merge-builders
49     builders:
50       - lf-infra-jjbini
51       - shell: !include-raw-escape:
52           - ../shell/jjb-install.sh
53           - ../shell/jjb-merge-job.sh
54
55 - lf_jjb_verify_builders: &lf_jjb_verify_builders
56     name: lf-jjb-verfy-builders
57     builders:
58       - lf-infra-jjbini
59       - shell: !include-raw-escape:
60           - ../shell/git-validate-jira-urls.sh
61           - ../shell/jjb-install.sh
62           - ../shell/jjb-verify-job.sh
63           - ../shell/jjb-check-unicode.sh
64       - lf-infra-gpg-verify-git-signature
65
66 - parameter:
67     name: lf-infra-jjb-parameters
68     parameters:
69       - string:
70           name: JJB_VERSION
71           default: '{jjb-version}'
72           description: Jenkins Job Builder version to download and install.
73
74 #################
75 # Job Templates #
76 #################
77
78 # JJB verify and merge jobs are the same except for their scm, trigger, and
79 # builders definition. This anchor is the common template
80 - lf_jjb_verify_merge: &lf_jjb_verify_merge
81     name: lf-jjb-verify-merge
82     project-type: freestyle
83
84     node: '{build-node}'
85
86     ######################
87     # Default parameters #
88     ######################
89
90     branch: master
91     submodule-recursive: true
92
93     #####################
94     # Job Configuration #
95     #####################
96
97     properties:
98       - lf-infra-properties:
99           project: '{project}'
100           build-days-to-keep: 7
101
102     parameters:
103       - lf-infra-parameters:
104           project: '{project}'
105           branch: '{branch}'
106       - lf-infra-jjb-parameters:
107           jjb-version: '{jjb-version}'
108
109     wrappers:
110       - lf-infra-wrappers:
111           build-timeout: 10
112           jenkins-ssh-credential: '{jenkins-ssh-credential}'
113
114     publishers:
115       - lf-infra-publish
116
117 - job-template:
118     name: '{project-name}-jjb-merge'
119     id: gerrit-jjb-merge
120     <<: *lf_jjb_verify_merge
121     # yamllint disable-line rule:key-duplicates
122     <<: *lf_jjb_merge_builders
123
124     ######################
125     # Default parameters #
126     ######################
127
128     git-url: '$GIT_URL/$GERRIT_PROJECT'
129
130     #####################
131     # Job Configuration #
132     #####################
133
134     scm:
135       - lf-infra-gerrit-scm:
136           git-url: '{git-url}'
137           refspec: ''
138           branch: '{branch}'
139           submodule-recursive: '{submodule-recursive}'
140           choosing-strategy: default
141           jenkins-ssh-credential: '{jenkins-ssh-credential}'
142
143     triggers:
144       - gerrit:
145           server-name: '{gerrit-server-name}'
146           trigger-on:
147             - change-merged-event
148             - comment-added-contains-event:
149                 comment-contains-value: remerge$
150           projects:
151             - project-compare-type: ANT
152               project-pattern: '{project}'
153               branches:
154                 - branch-compare-type: ANT
155                   branch-pattern: '**/{branch}'
156               <<: *lf_jjb_file_paths
157
158 - job-template:
159     name: '{project-name}-jjb-verify'
160     id: gerrit-jjb-verify
161     concurrent: true
162     <<: *lf_jjb_verify_merge
163     # yamllint disable-line rule:key-duplicates
164     <<: *lf_jjb_verify_builders
165
166     ######################
167     # Default parameters #
168     ######################
169
170     git-url: '$GIT_URL/$GERRIT_PROJECT'
171
172     #####################
173     # Job Configuration #
174     #####################
175
176     scm:
177       - lf-infra-gerrit-scm:
178           git-url: '{git-url}'
179           refspec: '$GERRIT_REFSPEC'
180           branch: '$GERRIT_BRANCH'
181           submodule-recursive: '{submodule-recursive}'
182           choosing-strategy: gerrit
183           jenkins-ssh-credential: '{jenkins-ssh-credential}'
184
185     triggers:
186       - gerrit:
187           server-name: '{gerrit-server-name}'
188           trigger-on:
189             - patchset-created-event:
190                 exclude-drafts: false
191                 exclude-trivial-rebase: false
192                 exclude-no-code-change: false
193             - draft-published-event
194             - comment-added-contains-event:
195                 comment-contains-value: recheck$
196           projects:
197             - project-compare-type: ANT
198               project-pattern: '{project}'
199               branches:
200                 - branch-compare-type: ANT
201                   branch-pattern: '**/{branch}'
202               <<: *lf_jjb_file_paths
203
204 - job-template:
205     name: '{project-name}-jjb-merge'
206     id: github-jjb-merge
207     <<: *lf_jjb_verify_merge
208     # yamllint disable-line rule:key-duplicates
209     <<: *lf_jjb_merge_builders
210
211     #####################
212     # Job Configuration #
213     #####################
214
215     properties:
216       - github:
217           url: '{git-url}/{github-org}/{project}'
218
219     scm:
220       - lf-infra-github-scm:
221           url: '{git-clone-url}{github-org}/{project}'
222           refspec: ''
223           branch: '{branch}'
224           submodule-recursive: '{submodule-recursive}'
225           choosing-strategy: default
226           jenkins-ssh-credential: '{jenkins-ssh-credential}'
227
228     triggers:
229       - github
230       - pollscm:
231           cron: ''
232       - github-pull-request:
233           trigger-phrase: '^remerge$'
234           only-trigger-phrase: true
235           status-context: 'JJB Merge'
236           permit-all: false
237           github-hooks: true
238           auto-close-on-fail: false
239           org-list:
240             - '{github-org}'
241
242 - job-template:
243     name: '{project-name}-jjb-verify'
244     id: github-jjb-verify
245     concurrent: true
246     <<: *lf_jjb_verify_merge
247     # yamllint disable-line rule:key-duplicates
248     <<: *lf_jjb_verify_builders
249
250     #####################
251     # Job Configuration #
252     #####################
253
254     properties:
255       - github:
256           url: '{git-url}/{github-org}/{project}'
257
258     scm:
259       - lf-infra-github-scm:
260           url: '{git-clone-url}{github-org}/{project}'
261           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
262           branch: '{branch}'
263           submodule-recursive: '{submodule-recursive}'
264           choosing-strategy: default
265           jenkins-ssh-credential: '{jenkins-ssh-credential}'
266
267     triggers:
268       - github-pull-request:
269           trigger-phrase: '^recheck$'
270           only-trigger-phrase: false
271           status-context: 'JJB Verify'
272           permit-all: true
273           github-hooks: true
274           auto-close-on-fail: false