Revert "CI: Rename global-settings to mvn-glob..."
[ci-management.git] / jjb / akraino-templates / akraino-jjb-templates.yaml
1 ---
2 #
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 # not use this file except in compliance with the License.
7 #
8 # You may obtain a copy of the License at
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 - job-template:
18     id: akraino-project-stream-release-config
19     name: "{project-name}-{stream}-release-config"
20
21     ######################
22     # Default parameters #
23     ######################
24
25     archive-artifacts: >
26       **/*.log
27       **/hs_err_*.log
28       **/target/**/feature.xml
29       **/target/failsafe-reports/failsafe-summary.xml
30       **/target/surefire-reports/*-output.txt
31     build-days-to-keep: 30
32     build-timeout: 60
33     java-version: openjdk8
34     maven-repo-url: "$NEXUS_URL/content/repositories/snapshots"
35     mvn-global-settings: global-settings
36     mvn-opts: ""
37     mvn-params: ""
38     mvn-version: mvn35
39     nexus-shapshot-repo: snapshots
40     repo-id: snapshots
41     staging-profile-id: "" # Unused by this job.
42     stream: master
43     submodule-recursive: true
44     upload-files-dir: /tmp/tardir
45
46     #####################
47     # Job Configuration #
48     #####################
49
50     project-type: freestyle
51     node: "{build-node}"
52
53     properties:
54       - lf-infra-properties:
55           build-days-to-keep: "{build-days-to-keep}"
56
57     parameters:
58       - lf-infra-parameters:
59           project: "{project}"
60           branch: "{branch}"
61           stream: "{stream}"
62           lftools-version: "{lftools-version}"
63       - lf-infra-maven-parameters:
64           mvn-opts: "{mvn-opts}"
65           mvn-params: "{mvn-params}"
66           mvn-version: "{mvn-version}"
67           # Staging repos do not make sense for CLM jobs so set it blank.
68           staging-profile-id: "{staging-profile-id}"
69       - string:
70           name: ARCHIVE_ARTIFACTS
71           default: "{archive-artifacts}"
72           description: Artifacts to archive to the logs server.
73       - string:
74           name: UPLOAD_FILES_PATH
75           default: "{upload-files-dir}"
76           description: File path to generate tarball and upload to repository.
77
78     wrappers:
79       - lf-infra-wrappers:
80           build-timeout: "{build-timeout}"
81           jenkins-ssh-credential: "{jenkins-ssh-credential}"
82
83     gerrit_merge_triggers:
84       - change-merged-event
85       - comment-added-contains-event:
86           comment-contains-value: remerge$
87
88     gerrit_trigger_file_paths:
89       - compare-type: REG_EXP
90         pattern: ".*"
91
92     scm:
93       - lf-infra-gerrit-scm:
94           jenkins-ssh-credential: "{jenkins-ssh-credential}"
95           git-url: "{git-url}/{project}.git"
96           refspec: "{refspec}"
97           branch: "{branch}"
98           submodule-recursive: "{submodule-recursive}"
99           submodule-timeout: "{submodule-timeout}"
100           submodule-disable: false
101           choosing-strategy: default
102
103     triggers:
104       - timed: "{obj:cron}"
105       - gerrit:
106           server-name: "{gerrit-server-name}"
107           trigger-on: "{obj:gerrit_merge_triggers}"
108           projects:
109             - project-compare-type: ANT
110               project-pattern: "{project}"
111               branches:
112                 - branch-compare-type: ANT
113                   branch-pattern: "**/{branch}"
114               file-paths: "{obj:gerrit_trigger_file_paths}"
115
116     builders:
117       - lf-infra-pre-build
118       - lf-maven-install:
119           mvn-version: "{mvn-version}"
120       - lf-update-java-alternatives:
121           java-version: "{java-version}"
122       - lf-provide-maven-settings:
123           global-settings-file: "{mvn-global-settings}"
124           settings-file: "{mvn-settings}"
125       - shell: !include-raw-escape:
126           - ../shell/make-tar.sh
127       - lf-infra-deploy-maven-file:
128           global-settings-file: "{mvn-global-settings}"
129           settings-file: "{mvn-settings}"
130           mvn-version: "{mvn-version}"
131           repo-id: "{repo-id}"
132           group-id: "{group-id}"
133           upload-files-dir: "{upload-files-dir}"
134           maven-repo-url: "{maven-repo-url}"
135
136     publishers:
137       - lf-infra-publish
138
139 - job-template:
140     id: akraino-project-stream-stage-config
141     name: "{project-name}-{stream}-stage-config"
142
143     ######################
144     # Default parameters #
145     ######################
146
147     archive-artifacts: >
148       **/*.log
149       **/hs_err_*.log
150       **/target/**/feature.xml
151       **/target/failsafe-reports/failsafe-summary.xml
152       **/target/surefire-reports/*-output.txt
153     build-days-to-keep: 14
154     build-timeout: 60
155     cron: "@daily"
156     disable-job: false
157     git-url: "$GIT_URL/$PROJECT"
158     github-url: "https://github.com"
159     java-version: openjdk8
160     mvn-global-settings: global-settings
161     mvn-goals: clean deploy
162     mvn-opts: ""
163     mvn-params: ""
164     mvn-version: mvn35
165     sign-artifacts: false
166     stream: master
167     submodule-recursive: true
168     upload-files-dir: m2repo # expected by "lftools deploy nexus-stage"
169
170     #####################
171     # Job Configuration #
172     #####################
173
174     project-type: freestyle
175     node: "{build-node}"
176
177     properties:
178       - lf-infra-properties:
179           build-days-to-keep: "{build-days-to-keep}"
180
181     parameters:
182       - lf-infra-parameters:
183           project: "{project}"
184           branch: "{branch}"
185           stream: "{stream}"
186           lftools-version: "{lftools-version}"
187       - lf-infra-maven-parameters:
188           mvn-opts: "{mvn-opts}"
189           mvn-params: "{mvn-params}"
190           mvn-version: "{mvn-version}"
191           staging-profile-id: "{staging-profile-id}"
192       - string:
193           name: ARCHIVE_ARTIFACTS
194           default: "{archive-artifacts}"
195           description: Artifacts to archive to the logs server.
196       - string:
197           name: UPLOAD_FILES_PATH
198           default: "{upload-files-dir}"
199           description: File path to generate tarball and upload to repository.
200       - string:
201           name: STAGING_PROFILE_ID
202           default: "{staging-profile-id}"
203           description: Nexus staging profile ID.
204       - string:
205           name: STAGING_BUILD
206           default: "true"
207           description: Mark this as a staging build.
208
209     wrappers:
210       - lf-infra-wrappers:
211           build-timeout: "{build-timeout}"
212           jenkins-ssh-credential: "{jenkins-ssh-credential}"
213
214     gerrit_release_triggers:
215       - comment-added-contains-event:
216           comment-contains-value: stage-release$
217
218     disabled: "{disable-job}"
219
220     scm:
221       - lf-infra-gerrit-scm:
222           jenkins-ssh-credential: "{jenkins-ssh-credential}"
223           git-url: "{git-url}"
224           refspec: "$GERRIT_REFSPEC"
225           branch: "$GERRIT_BRANCH"
226           submodule-recursive: "{submodule-recursive}"
227           submodule-timeout: "{submodule-timeout}"
228           submodule-disable: false
229           choosing-strategy: default
230
231     triggers:
232       - timed: "{obj:cron}"
233       - gerrit:
234           server-name: "{gerrit-server-name}"
235           trigger-on: "{obj:gerrit_release_triggers}"
236           projects:
237             - project-compare-type: ANT
238               project-pattern: "{project}"
239               branches:
240                 - branch-compare-type: ANT
241                   branch-pattern: "**/{branch}"
242
243     builders:
244       - lf-infra-pre-build
245       - lf-jacoco-nojava-workaround
246       - lf-maven-install:
247           mvn-version: "{mvn-version}"
248       - lf-update-java-alternatives:
249           java-version: "{java-version}"
250       - lf-provide-maven-settings:
251           global-settings-file: "{mvn-global-settings}"
252           settings-file: "{mvn-settings}"
253       - lf-infra-create-netrc:
254           server-id: "{mvn-staging-id}"
255       - shell: !include-raw-escape:
256           - ../shell/make-tar.sh
257       - lf-sigul-sign-dir:
258           sign-artifacts: "{sign-artifacts}"
259           sign-dir: "$WORKSPACE/m2repo"
260           sign-mode: serial
261       - lf-maven-stage:
262           mvn-global-settings: "global-settings"
263           mvn-settings: ""
264           mvn-staging-id: ""
265       - lf-provide-maven-settings-cleanup
266
267     publishers:
268       - lf-infra-publish
269
270 - job-template:
271     id: akraino-project-stream-verify
272     name: "{project-name}-{stream}-verify"
273     archive-artifacts: >
274       **/*.log
275     build-days-to-keep: 30
276     build-timeout: 60
277     stream: master
278     project-type: freestyle
279     submodule-recursive: true
280     node: "{build-node}"
281
282     properties:
283       - lf-infra-properties:
284           build-days-to-keep: "{build-days-to-keep}"
285
286     parameters:
287       - lf-infra-parameters:
288           project: "{project}"
289           stream: "{stream}"
290           branch: "{branch}"
291           lftools-version: "{lftools-version}"
292
293       - string:
294           name: ARCHIVE_ARTIFACTS
295           default: "{archive-artifacts}"
296           description: Artifacts to archive to the logs server.
297
298     wrappers:
299       - lf-infra-wrappers:
300           build-timeout: "{build-timeout}"
301           jenkins-ssh-credential: "{jenkins-ssh-credential}"
302
303     scm:
304       - lf-infra-gerrit-scm:
305           jenkins-ssh-credential: "{jenkins-ssh-credential}"
306           git-url: "{git-url}/{project}.git"
307           refspec: "$GERRIT_REFSPEC"
308           branch: "$GERRIT_BRANCH"
309           submodule-recursive: "{submodule-recursive}"
310           submodule-timeout: "{submodule-timeout}"
311           submodule-disable: false
312           choosing-strategy: "gerrit"
313
314     triggers:
315       - gerrit:
316           server-name: "{gerrit-server-name}"
317           trigger-on:
318             - patchset-created-event:
319                 exclude-drafts: "false"
320                 exclude-trivial-rebase: "false"
321                 exclude-no-code-change: "false"
322             - change-merged-event
323             - draft-published-event
324             - comment-added-contains-event:
325                 comment-contains-value: "recheck"
326             - comment-added-contains-event:
327                 comment-contains-value: "reverify"
328           projects:
329             - project-compare-type: "ANT"
330               project-pattern: "{project}"
331               branches:
332                 - branch-compare-type: "ANT"
333                   branch-pattern: "**/{branch}"
334               file-paths:
335                 - compare-type: ANT
336                   pattern: "**/*"
337               disable-strict-forbidden-file-verification: "true"
338               forbidden-file-paths:
339                 - compare-type: ANT
340                   pattern: "docs/**"
341           readable-message: true
342
343     builders:
344       - shell: !include-raw-escape:
345           - ../shell/verify.sh
346
347     publishers:
348       - lf-infra-publish
349
350 - job-template:
351     id: akraino-project-build-node-init
352     name: "{project-name}-{build-node}-init"
353     # disable_job: false
354     disabled: "{obj:disable_job}"
355     concurrent: true
356
357     parameters:
358       - lf-infra-parameters:
359           project: "{project}"
360           stream: "{stream}"
361           branch: "{branch}"
362       - label:
363           name: "{build-node}"
364           default: "{build-node}"
365           node-eligibility: "all"
366           all-nodes: true
367
368     gerrit_merge_triggers:
369       - change-merged-event
370       - comment-added-contains-event:
371           comment-contains-value: remerge$
372
373     gerrit_trigger_file_paths:
374       - compare-type: REG_EXP
375         pattern: "global-jjb"
376
377     scm:
378       - lf-infra-gerrit-scm:
379           jenkins-ssh-credential: "{jenkins-ssh-credential}"
380           git-url: "{git-url}/{project}.git"
381           refspec: "$GERRIT_REFSPEC"
382           branch: "$GERRIT_BRANCH"
383           submodule-recursive: true
384           submodule-timeout: "{submodule-timeout}"
385           submodule-disable: false
386           choosing-strategy: default
387
388     triggers:
389       - gerrit:
390           server-name: "{gerrit-server-name}"
391           trigger-on: "{obj:gerrit_merge_triggers}"
392           projects:
393             - project-compare-type: ANT
394               project-pattern: "{project}"
395               branches:
396                 - branch-compare-type: ANT
397                   branch-pattern: "**/{branch}"
398               file-paths: "{obj:gerrit_trigger_file_paths}"
399
400     builders:
401       - description-setter:
402           description: "POD: $NODE_NAME"
403       - shell: |
404           #!/bin/bash -ex
405           export SWAP_SIZE=0
406           sudo -E ./global-jjb/jenkins-init-scripts/init.sh
407           sudo chown jenkins:jenkins -R archives
408
409     publishers:
410       - lf-infra-publish