Merge "iec: Stop upstream job if IEC installation fails"
[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
140 - job-template:
141     id: akraino-project-stream-stage-config
142     name: '{project-name}-{stream}-stage-config'
143
144     ######################
145     # Default parameters #
146     ######################
147
148     archive-artifacts: >
149       **/*.log
150       **/hs_err_*.log
151       **/target/**/feature.xml
152       **/target/failsafe-reports/failsafe-summary.xml
153       **/target/surefire-reports/*-output.txt
154     build-days-to-keep: 14
155     build-timeout: 60
156     cron: '@daily'
157     disable-job: false
158     git-url: '$GIT_URL/$PROJECT'
159     github-url: 'https://github.com'
160     java-version: openjdk8
161     mvn-global-settings: global-settings
162     mvn-goals: clean deploy
163     mvn-opts: ''
164     mvn-params: ''
165     mvn-version: mvn35
166     sign-artifacts: false
167     stream: master
168     submodule-recursive: true
169     upload-files-dir: m2repo  # expected by "lftools deploy nexus-stage"
170
171     #####################
172     # Job Configuration #
173     #####################
174
175     project-type: freestyle
176     node: '{build-node}'
177
178     properties:
179       - lf-infra-properties:
180           build-days-to-keep: '{build-days-to-keep}'
181
182     parameters:
183       - lf-infra-parameters:
184           project: '{project}'
185           branch: '{branch}'
186           stream: '{stream}'
187           lftools-version: '{lftools-version}'
188       - lf-infra-maven-parameters:
189           mvn-opts: '{mvn-opts}'
190           mvn-params: '{mvn-params}'
191           mvn-version: '{mvn-version}'
192           staging-profile-id: '{staging-profile-id}'
193       - string:
194           name: ARCHIVE_ARTIFACTS
195           default: '{archive-artifacts}'
196           description: Artifacts to archive to the logs server.
197       - string:
198           name: UPLOAD_FILES_PATH
199           default: '{upload-files-dir}'
200           description: File path to generate tarball and upload to repository.
201       - string:
202           name: STAGING_PROFILE_ID
203           default: '{staging-profile-id}'
204           description: Nexus staging profile ID.
205       - string:
206           name: STAGING_BUILD
207           default: 'true'
208           description: Mark this as a staging build.
209
210     wrappers:
211       - lf-infra-wrappers:
212           build-timeout: '{build-timeout}'
213           jenkins-ssh-credential: '{jenkins-ssh-credential}'
214
215     gerrit_release_triggers:
216       - comment-added-contains-event:
217           comment-contains-value: stage-release$
218
219     disabled: '{disable-job}'
220
221     scm:
222       - lf-infra-gerrit-scm:
223           jenkins-ssh-credential: '{jenkins-ssh-credential}'
224           git-url: '{git-url}'
225           refspec: '$GERRIT_REFSPEC'
226           branch: '$GERRIT_BRANCH'
227           submodule-recursive: '{submodule-recursive}'
228           submodule-timeout: '{submodule-timeout}'
229           submodule-disable: false
230           choosing-strategy: default
231
232     triggers:
233       - timed: '{obj:cron}'
234       - gerrit:
235           server-name: '{gerrit-server-name}'
236           trigger-on: '{obj:gerrit_release_triggers}'
237           projects:
238             - project-compare-type: ANT
239               project-pattern: '{project}'
240               branches:
241                 - branch-compare-type: ANT
242                   branch-pattern: '**/{branch}'
243
244     builders:
245       - lf-infra-pre-build
246       - lf-jacoco-nojava-workaround
247       - lf-maven-install:
248           mvn-version: '{mvn-version}'
249       - lf-update-java-alternatives:
250           java-version: '{java-version}'
251       - lf-provide-maven-settings:
252           global-settings-file: '{mvn-global-settings}'
253           settings-file: '{mvn-settings}'
254       - lf-infra-create-netrc:
255           server-id: '{mvn-staging-id}'
256       - shell: !include-raw-escape:
257           - ../shell/make-tar.sh
258       - lf-sigul-sign-dir:
259           sign-artifacts: '{sign-artifacts}'
260           sign-dir: '$WORKSPACE/m2repo'
261           sign-mode: serial
262       - lf-maven-stage
263       - lf-provide-maven-settings-cleanup
264
265     publishers:
266       - lf-infra-publish
267
268 - job-template:
269     id: akraino-project-stream-verify
270     name: '{project-name}-{stream}-verify'
271     archive-artifacts: >
272       **/*.log
273     build-days-to-keep: 30
274     build-timeout: 60
275     stream: master
276     project-type: freestyle
277     submodule-recursive: true
278     node: '{build-node}'
279
280     properties:
281       - lf-infra-properties:
282           build-days-to-keep: '{build-days-to-keep}'
283
284     parameters:
285       - lf-infra-parameters:
286           project: '{project}'
287           stream: '{stream}'
288           branch: '{branch}'
289           lftools-version: '{lftools-version}'
290
291       - string:
292           name: ARCHIVE_ARTIFACTS
293           default: '{archive-artifacts}'
294           description: Artifacts to archive to the logs server.
295
296     wrappers:
297       - lf-infra-wrappers:
298           build-timeout: '{build-timeout}'
299           jenkins-ssh-credential: '{jenkins-ssh-credential}'
300
301     scm:
302       - lf-infra-gerrit-scm:
303           jenkins-ssh-credential: '{jenkins-ssh-credential}'
304           git-url: '{git-url}/{project}.git'
305           refspec: '$GERRIT_REFSPEC'
306           branch: '$GERRIT_BRANCH'
307           submodule-recursive: '{submodule-recursive}'
308           submodule-timeout: '{submodule-timeout}'
309           submodule-disable: false
310           choosing-strategy: 'gerrit'
311
312     triggers:
313       - gerrit:
314           server-name: '{gerrit-server-name}'
315           trigger-on:
316             - patchset-created-event:
317                 exclude-drafts: 'false'
318                 exclude-trivial-rebase: 'false'
319                 exclude-no-code-change: 'false'
320             - change-merged-event
321             - draft-published-event
322             - comment-added-contains-event:
323                 comment-contains-value: 'recheck'
324             - comment-added-contains-event:
325                 comment-contains-value: 'reverify'
326           projects:
327             - project-compare-type: 'ANT'
328               project-pattern: '{project}'
329               branches:
330                 - branch-compare-type: 'ANT'
331                   branch-pattern: '**/{branch}'
332               file-paths:
333                 - compare-type: ANT
334                   pattern: '**/*'
335               disable-strict-forbidden-file-verification: 'true'
336               forbidden-file-paths:
337                 - compare-type: ANT
338                   pattern: 'docs/**'
339           readable-message: true
340
341     builders:
342       - shell: !include-raw-escape:
343           - ../shell/verify.sh
344
345     publishers:
346       - lf-infra-publish
347
348 - job-template:
349     id: akraino-project-build-node-init
350     name: '{project-name}-{build-node}-init'
351     disabled: '{obj:disabled}'
352     concurrent: true
353
354     parameters:
355       - lf-infra-parameters:
356           project: '{project}'
357           stream: '{stream}'
358           branch: '{branch}'
359       - label:
360           name: '{build-node}'
361           default: '{build-node}'
362           node-eligibility: 'all'
363           all-nodes: true
364
365     gerrit_merge_triggers:
366       - change-merged-event
367       - comment-added-contains-event:
368           comment-contains-value: remerge$
369
370     gerrit_trigger_file_paths:
371       - compare-type: REG_EXP
372         pattern: 'global-jjb'
373
374     scm:
375       - lf-infra-gerrit-scm:
376           jenkins-ssh-credential: '{jenkins-ssh-credential}'
377           git-url: '{git-url}/{project}.git'
378           refspec: '$GERRIT_REFSPEC'
379           branch: '$GERRIT_BRANCH'
380           submodule-recursive: true
381           submodule-timeout: '{submodule-timeout}'
382           submodule-disable: false
383           choosing-strategy: default
384
385     triggers:
386       - gerrit:
387           server-name: '{gerrit-server-name}'
388           trigger-on: '{obj:gerrit_merge_triggers}'
389           projects:
390             - project-compare-type: ANT
391               project-pattern: '{project}'
392               branches:
393                 - branch-compare-type: ANT
394                   branch-pattern: '**/{branch}'
395               file-paths: '{obj:gerrit_trigger_file_paths}'
396
397     builders:
398       - description-setter:
399           description: "POD: $NODE_NAME"
400       - shell: |
401           #!/bin/bash -ex
402           export SWAP_SIZE=0
403           sudo -E ./global-jjb/jenkins-init-scripts/init.sh
404           sudo chown jenkins:jenkins -R archives