33035f1371ea68f6127457e1fd7defeca72c6bd8
[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}-{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           choosing-strategy: default
101
102     triggers:
103       - timed: '{obj:cron}'
104       - gerrit:
105           server-name: '{gerrit-server-name}'
106           trigger-on: '{obj:gerrit_merge_triggers}'
107           projects:
108             - project-compare-type: ANT
109               project-pattern: '{project}'
110               branches:
111                 - branch-compare-type: ANT
112                   branch-pattern: '**/{branch}'
113               file-paths: '{obj:gerrit_trigger_file_paths}'
114
115     builders:
116       - lf-infra-pre-build
117       - lf-maven-install:
118           mvn-version: '{mvn-version}'
119       - lf-update-java-alternatives:
120           java-version: '{java-version}'
121       - lf-provide-maven-settings:
122           global-settings-file: '{mvn-global-settings}'
123           settings-file: '{mvn-settings}'
124       - shell: !include-raw-escape:
125           - ../shell/make-tar.sh
126       - lf-infra-deploy-maven-file:
127           global-settings-file: '{mvn-global-settings}'
128           settings-file: '{mvn-settings}'
129           mvn-version: '{mvn-version}'
130           repo-id: '{repo-id}'
131           group-id: '{group-id}'
132           upload-files-dir: '{upload-files-dir}'
133           maven-repo-url: '{maven-repo-url}'
134
135     publishers:
136       - lf-infra-publish
137
138
139 - job-template:
140     id: akraino-project-stream-stage-config
141     name: '{project}-{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           choosing-strategy: default
229
230     triggers:
231       - timed: '{obj:cron}'
232       - gerrit:
233           server-name: '{gerrit-server-name}'
234           trigger-on: '{obj:gerrit_release_triggers}'
235           projects:
236             - project-compare-type: ANT
237               project-pattern: '{project}'
238               branches:
239                 - branch-compare-type: ANT
240                   branch-pattern: '**/{branch}'
241
242     builders:
243       - lf-infra-pre-build
244       - lf-jacoco-nojava-workaround
245       - lf-maven-install:
246           mvn-version: '{mvn-version}'
247       - lf-update-java-alternatives:
248           java-version: '{java-version}'
249       - lf-provide-maven-settings:
250           global-settings-file: '{mvn-global-settings}'
251           settings-file: '{mvn-settings}'
252       - lf-infra-create-netrc:
253           server-id: '{mvn-staging-id}'
254       - shell: !include-raw-escape:
255           - ../shell/make-tar.sh
256       - lf-sigul-sign-dir:
257           sign-artifacts: '{sign-artifacts}'
258           sign-dir: '$WORKSPACE/m2repo'
259       - lf-maven-stage
260       - lf-provide-maven-settings-cleanup
261
262     publishers:
263       - lf-infra-publish
264
265 - job-template:
266     id: akraino-project-stream-verify
267     name: '{project}-{stream}-verify'
268     archive-artifacts: >
269       **/*.log
270     build-days-to-keep: 30
271     build-timeout: 60
272     stream: master
273     project-type: freestyle
274     submodule-recursive: true
275     node: '{build-node}'
276
277     properties:
278       - lf-infra-properties:
279           build-days-to-keep: '{build-days-to-keep}'
280
281     parameters:
282       - lf-infra-parameters:
283           project: '{project}'
284           stream: '{stream}'
285           refspec: '{refspec}'
286           branch: '{branch}'
287           lftools-version: '{lftools-version}'
288
289       - string:
290           name: ARCHIVE_ARTIFACTS
291           default: '{archive-artifacts}'
292           description: Artifacts to archive to the logs server.
293
294     wrappers:
295       - lf-infra-wrappers:
296           build-timeout: '{build-timeout}'
297           jenkins-ssh-credential: '{jenkins-ssh-credential}'
298
299     scm:
300       - lf-infra-gerrit-scm:
301           jenkins-ssh-credential: '{jenkins-ssh-credential}'
302           git-url: '{git-url}/{project}.git'
303           refspec: '{refspec}'
304           branch: '{branch}'
305           submodule-recursive: '{submodule-recursive}'
306           submodule-timeout: '{submodule-timeout}'
307           choosing-strategy: default
308
309     triggers:
310       - gerrit:
311           server-name: '{gerrit-server-name}'
312           trigger-on:
313             - patchset-created-event:
314                 exclude-drafts: 'false'
315                 exclude-trivial-rebase: 'false'
316                 exclude-no-code-change: 'false'
317             - change-merged-event
318             - draft-published-event
319             - comment-added-contains-event:
320                 comment-contains-value: remerge$
321             - comment-added-contains-event:
322                 comment-contains-value: 'recheck'
323             - comment-added-contains-event:
324                 comment-contains-value: 'reverify'
325           projects:
326             - project-compare-type: 'ANT'
327               project-pattern: '{project}'
328               branches:
329                 - branch-compare-type: 'ANT'
330                   branch-pattern: '**/{branch}'
331               file-paths:
332                 - compare-type: ANT
333                   pattern: '**/*'
334               disable-strict-forbidden-file-verification: 'true'
335               forbidden-file-paths:
336                 - compare-type: ANT
337                   pattern: 'docs/**'
338           readable-message: true
339
340
341
342     builders:
343       - shell: !include-raw-escape:
344           - ../shell/eliot-verify.sh
345
346     publishers:
347       - lf-infra-publish