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