Merge "Add missing ubuntu1804-us label to FDIONOMAD cloud."
[ci-management.git] / jjb / global-macros.yaml
1 # Copyright (c) 2021 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 ---
15 # Global macros.
16
17 #### PARAMETERS
18 # Keep 'parameter' entries ordered alphabetically, please.
19 - parameter:
20     name: arch-parameter
21     parameters:
22       - string:
23           name: ARCH
24           default: '{arch}'
25           description: "Architecture parameter"
26
27 - parameter:
28     name: archive-artifacts-parameter
29     parameters:
30       - string:
31           name: ARCHIVE_ARTIFACTS
32           default: '{artifacts}'
33           description: "Artifacts to archive on the log server."
34
35 - parameter:
36     name: compiler-parameter
37     parameters:
38       - string:
39           name: CC
40           default: '{cc}'
41           description: "CC parameter, can be gnu or clang"
42
43 - parameter:
44     name: make-parallel-jobs-parameter
45     parameters:
46       - string:
47           name: MAKE_PARALLEL_JOBS
48           default: '{make-parallel-jobs}'
49           description: "The number of cores to use for builds."
50
51 - parameter:
52     name: csit-fail-on-crc-mismatch-parameter
53     parameters:
54       - string:
55           name: FDIO_CSIT_FAIL_ON_CRC_MISMATCH
56           default: '{fail-on-crc-mismatch}'
57           description: "If true, CRC is checked, else compatibility is tested."
58
59 - parameter:
60     name: csit-perf-trial-duration-parameter
61     parameters:
62       - string:
63           name: CSIT_PERF_TRIAL_DURATION
64           default: "{csit-perf-trial-duration}"
65           description: "Duration of a trial measurement in BMRR tests."
66
67 - parameter:
68     name: csit-perf-trial-multiplicity-parameter
69     parameters:
70       - string:
71           name: CSIT_PERF_TRIAL_MULTIPLICITY
72           default: "{csit-perf-trial-multiplicity}"
73           description: "Number of subsamples for BMRR tests."
74
75 - parameter:
76     name: gerrit-csit-refspec-parameter
77     parameters:
78       - string:
79           name: CSIT_REF
80           default: ''
81           # yamllint disable-line rule:line-length
82           description: "GERRIT_REFSPEC parameter to override separately cloned CSIT repository, leave empty for autodetection / no override."
83
84 - parameter:
85     name: gerrit-event-comment-text-parameter
86     parameters:
87       - string:
88           name: GERRIT_EVENT_COMMENT_TEXT
89           default: ''
90           # yamllint disable-line rule:line-length
91           description: "GERRIT_EVENT_COMMENT_TEXT parameter not given by trigger"
92
93 - parameter:
94     name: gerrit-event-type-parameter
95     parameters:
96       - string:
97           name: GERRIT_EVENT_TYPE
98           default: ''
99           description: "GERRIT_EVENT_TYPE parameter not given by trigger"
100
101 - parameter:
102     name: gerrit-parameter
103     parameters:
104       - string:
105           name: GERRIT_BRANCH
106           default: '{branch}'
107           description: "JJB configured GERRIT_BRANCH parameter"
108
109 - parameter:
110     name: gerrit-project-parameter
111     parameters:
112       - string:
113           name: GERRIT_PROJECT
114           default: '{project}'
115           description: "GERRIT_PROJECT parameter if not given by trigger"
116
117 - parameter:
118     name: gerrit-refspec-parameter
119     parameters:
120       - string:
121           name: GERRIT_REFSPEC
122           default: '{refspec}'
123           description: "GERRIT_REFSPEC parameter not given by trigger"
124
125 - parameter:
126     name: is-csit-vpp-job-parameter
127     parameters:
128       - string:
129           name: IS_CSIT_VPP_JOB
130           default: '{is-csit-vpp-job}'
131           description: "Parameter is True if this is a CSIT vpp job."
132
133 - parameter:
134     name: maven-exec
135     parameters:
136       - string:
137           name: MVN
138           # yamllint disable-line rule:line-length
139           default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
140           description: 'Maven selector to be used by shell scripts'
141
142 - parameter:
143     name: maven-project-parameter
144     parameters:
145       - string:
146           name: MAVEN_SELECTOR
147           default: '{maven}'
148           description: 'Maven selector to be used by shell scripts'
149
150 - parameter:
151     name: mode-parameter
152     parameters:
153       - string:
154           name: MODE
155           default: '{mode}'
156           description: "mode parameter to be used in shell scripts."
157
158 - parameter:
159     name: os-parameter
160     parameters:
161       - string:
162           name: OS
163           default: '{os}'
164           description: "OS parameter"
165
166 - parameter:
167     name: project-parameter
168     parameters:
169       - string:
170           name: PROJECT
171           default: '{project}'
172           # yamllint disable-line rule:line-length
173           description: "JJB configured PROJECT parameter to identify a Gerrit project"
174
175 - parameter:
176     name: repo-name-parameter
177     parameters:
178       - string:
179           name: REPO_NAME
180           default: '{repo-name}'
181           description: 'Name of repo to which to publish packaging'
182
183 - parameter:
184     name: stream-parameter
185     parameters:
186       - string:
187           name: STREAM
188           default: '{stream}'
189           description: "Stream job parameter to be used in shell scripts."
190
191 - parameter:
192     name: topo-parameter
193     parameters:
194       - string:
195           name: TOPO
196           default: '{topo}'
197           description: "Topology parameter"
198
199 - parameter:
200     name: workspace-archive-artifacts-parameter
201     parameters:
202       - string:
203           name: WS_ARCHIVE_ARTIFACTS
204           default: '{artifacts}'
205           description: "Artifacts to archive in $WORKSPACE/archives."
206 # [end] Keep 'parameter' entries ordered alphabetically, please.
207
208 #### SCMS
209 # Keep 'scm' entries ordered alphabetically, please.
210 - scm:
211     name: gerrit-trigger-scm
212     scm:
213       - git:
214           credentials-id: '{credentials-id}'
215           url: '$GIT_BASE'
216           refspec: '{refspec}'
217           branches:
218             - 'origin/$GERRIT_BRANCH'
219           skip-tag: true
220           choosing-strategy: '{choosing-strategy}'
221
222 - scm:
223     name: gerrit-trigger-scm-recursive
224     scm:
225       - git:
226           credentials-id: '{credentials-id}'
227           url: '$GIT_BASE'
228           refspec: '{refspec}'
229           branches:
230             - 'origin/$GERRIT_BRANCH'
231           skip-tag: true
232           choosing-strategy: '{choosing-strategy}'
233           submodule:
234             recursive: '{submodule-recursive}'
235
236 - scm:
237     name: git-scm
238     scm:
239       - git:
240           credentials-id: '{credentials-id}'
241           url: '$GIT_BASE'
242           refspec: ''
243           branches:
244             - 'origin/{branch}'
245           skip-tag: true
246           wipe-workspace: true
247 # [end] Keep 'scm' entries ordered alphabetically, please.
248
249 #### WRAPPERS
250 # Keep 'wrapper' entries ordered alphabetically, please.
251 - wrapper:
252     name: build-timeout
253     wrappers:
254       - timeout:
255           type: absolute
256           timeout: 360
257           fail: true
258
259 - wrapper:
260     # This wrapper is required for all jobs as it configures the wrappers
261     # needed by the fd.io infra.
262     name: fdio-infra-wrappers
263     wrappers:
264       - timeout:
265           type: absolute
266           timeout: '{build-timeout}'
267           timeout-var: 'BUILD_TIMEOUT'
268           fail: true
269       - timestamps
270       - ssh-agent-credentials:
271           users:
272             - 'jenkins-gerrit-credentials'
273       - jclouds:
274           single-use: true
275       - openstack:
276           single-use: true
277
278 - wrapper:
279     # This wrapper is used for all jobs that require no-activity timeouts
280     name: fdio-infra-wrappers-non-activity-timeout
281     wrappers:
282       - timeout:
283           type: no-activity
284           timeout: '{build-timeout}'
285           fail: true
286       - timestamps
287       - ssh-agent-credentials:
288           users:
289             - 'jenkins-gerrit-credentials'
290       - jclouds:
291           single-use: true
292       - openstack:
293           single-use: true
294 # [end] Keep 'wrapper' entries ordered alphabetically, please.
295
296 #### TRIGGERS
297 # Keep 'trigger' entries ordered alphabetically, please.
298 - trigger:
299     name: gerrit-trigger-checkstyle
300     # Comes from VPP, some verify jobs wait for checkstyle to pass.
301     # This macro is to be used for such verify jobs which are voting.
302     triggers:
303       - gerrit:
304           server-name: 'Primary'
305           trigger-on:
306             - comment-added-contains-event:
307                 comment-contains-value: 'checkstyle_success'
308           projects:
309             - project-compare-type: 'ANT'
310               project-pattern: '{name}'
311               branches:
312                 - branch-compare-type: 'ANT'
313                   branch-pattern: '**/{branch}'
314
315 - trigger:
316     name: gerrit-trigger-checkstyle-nonvoting
317     # Comes from VPP, some verify jobs wait for checkstyle to pass.
318     # This macro is to be used for such verify jobs which are non-voting.
319     triggers:
320       - gerrit:
321           server-name: 'Primary'
322           trigger-on:
323             - comment-added-contains-event:
324                 comment-contains-value: 'checkstyle_success'
325           projects:
326             - project-compare-type: 'ANT'
327               project-pattern: '{name}'
328               branches:
329                 - branch-compare-type: 'ANT'
330                   branch-pattern: '**/{branch}'
331           skip-vote:
332             successful: true
333             failed: true
334             unstable: true
335             notbuilt: true
336           override-votes: true
337           gerrit-build-successful-verified-value: 1
338           gerrit-build-failed-verified-value: 1
339           gerrit-build-unstable-verified-value: 1
340           gerrit-build-notbuilt-verified-value: 1
341
342 - trigger:
343     name: gerrit-trigger-csit-perftest
344     # Manual trigger common for csit-vpp and vpp-csit perf jobs.
345     triggers:
346       - gerrit:
347           server-name: 'Primary'
348           trigger-on:
349             - comment-added-contains-event:
350                 comment-contains-value: '{trigger-word}'
351           projects:
352             - project-compare-type: 'ANT'
353               project-pattern: '{project}'
354               branches:
355                 - branch-compare-type: 'ANT'
356                   branch-pattern: '**/{branch}'
357           skip-vote:
358             successful: '{skip-vote}'
359             failed: '{skip-vote}'
360             unstable: '{skip-vote}'
361             notbuilt: '{skip-vote}'
362
363 - trigger:
364     name: gerrit-trigger-csit-vpp-devicetest-full
365     # Comes from CSIT, for automatic jobs running device tests with VPP builds.
366     # The job acts as an automatic verify job for CSIT contributions.
367     triggers:
368       - gerrit:
369           server-name: 'Primary'
370           trigger-on:
371             # The main way the job is triggered automatically on patch upload.
372             # Gated by tox job, so we do not spend resources on WiP changes.
373             - comment-added-contains-event:
374                 comment-contains-value: 'tox_success'
375             # Manual trigger to allow testing WiP changes with selected tags.
376             - comment-added-contains-event:
377                 comment-contains-value: 'csit-devicetest'
378             # A comment with "recheck" restarts tox job, so no condition here.
379           projects:
380             - project-compare-type: 'ANT'
381               project-pattern: '{project}'
382               branches:
383                 - branch-compare-type: 'ANT'
384                   branch-pattern: '**/{branch}'
385           skip-vote:
386             successful: '{skip-vote}'
387             failed: '{skip-vote}'
388             unstable: '{skip-vote}'
389             notbuilt: '{skip-vote}'
390
391 - trigger:
392     name: gerrit-trigger-csit-vpp-devicetest-manual
393     # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
394     # The job acts as a manual (optional) verify job for CSIT contributions.
395     triggers:
396       - gerrit:
397           server-name: 'Primary'
398           trigger-on:
399             - comment-added-contains-event:
400                 comment-contains-value: 'csit-devicetest'
401           projects:
402             - project-compare-type: 'ANT'
403               project-pattern: '{project}'
404               branches:
405                 - branch-compare-type: 'ANT'
406                   branch-pattern: '**/{branch}'
407           skip-vote:
408             successful: '{skip-vote}'
409             failed: '{skip-vote}'
410             unstable: '{skip-vote}'
411             notbuilt: '{skip-vote}'
412
413 - trigger:
414     name: gerrit-trigger-manually-triggered
415     triggers:
416       - gerrit:
417           server-name: 'Primary'
418           trigger-on:
419             - comment-added-contains-event:
420                 comment-contains-value: '{comment-trigger-value}'
421           projects:
422             - project-compare-type: 'ANT'
423               project-pattern: '{name}'
424               branches:
425                 - branch-compare-type: 'ANT'
426                   branch-pattern: '**/{branch}'
427
428 - trigger:
429     name: gerrit-trigger-patch-merged
430     triggers:
431       - gerrit:
432           server-name: 'Primary'
433           trigger-on:
434             - change-merged-event
435             - comment-added-contains-event:
436                 comment-contains-value: 'remerge'
437           projects:
438             - project-compare-type: 'ANT'
439               project-pattern: '{name}'
440               branches:
441                 - branch-compare-type: 'ANT'
442                   branch-pattern: '**/{branch}'
443           # Force Jenkins always vote the values it should already have voted
444           # during the prior verify phase
445           override-votes: true
446           gerrit-build-started-verified-value: 1
447           gerrit-build-successful-verified-value: 1
448           gerrit-build-failed-verified-value: 1
449           gerrit-build-unstable-verified-value: 1
450           gerrit-build-notbuilt-verified-value: 1
451           gerrit-build-started-codereview-value: 0
452           gerrit-build-successful-codereview-value: 0
453           gerrit-build-failed-codereview-value: 0
454           gerrit-build-unstable-codereview-value: 0
455           gerrit-build-notbuilt-codereview-value: 0
456
457 - trigger:
458     name: gerrit-trigger-patch-submitted
459     triggers:
460       - gerrit:
461           server-name: 'Primary'
462           trigger-on:
463             - patchset-created-event:
464                 exclude-drafts: 'true'
465                 exclude-trivial-rebase: 'false'
466                 exclude-no-code-change: 'false'
467             - draft-published-event
468             - comment-added-contains-event:
469                 comment-contains-value: 'recheck'
470             - comment-added-contains-event:
471                 comment-contains-value: 'reverify'
472           projects:
473             - project-compare-type: 'ANT'
474               project-pattern: '{name}'
475               branches:
476                 - branch-compare-type: 'ANT'
477                   branch-pattern: '**/{branch}'
478
479 - trigger:
480     name: gerrit-trigger-os-patch-merged
481     triggers:
482       - gerrit:
483           server-name: 'Primary'
484           trigger-on:
485             - comment-added-contains-event:
486                 comment-contains-value: 'os-merge'
487           projects:
488             - project-compare-type: 'ANT'
489               project-pattern: '{name}'
490               branches:
491                 - branch-compare-type: 'ANT'
492                   branch-pattern: '**/{branch}'
493           # Force Jenkins always vote the values it should already have voted
494           # during the prior verify phase
495           override-votes: true
496           gerrit-build-started-verified-value: 1
497           gerrit-build-successful-verified-value: 1
498           gerrit-build-failed-verified-value: 1
499           gerrit-build-unstable-verified-value: 1
500           gerrit-build-notbuilt-verified-value: 1
501           gerrit-build-started-codereview-value: 0
502           gerrit-build-successful-codereview-value: 0
503           gerrit-build-failed-codereview-value: 0
504           gerrit-build-unstable-codereview-value: 0
505           gerrit-build-notbuilt-codereview-value: 0
506
507 - trigger:
508     name: gerrit-trigger-os-trivial-patch-submitted
509     triggers:
510       - gerrit:
511           server-name: 'Primary'
512           trigger-on:
513             - comment-added-contains-event:
514                 comment-contains-value: 'os-check'
515             - comment-added-contains-event:
516                 comment-contains-value: 'os-verify'
517           projects:
518             - project-compare-type: 'ANT'
519               project-pattern: '{name}'
520               branches:
521                 - branch-compare-type: 'ANT'
522                   branch-pattern: '**/{branch}'
523
524 - trigger:
525     name: gerrit-trigger-trivial-patch-submitted
526     triggers:
527       - gerrit:
528           server-name: 'Primary'
529           trigger-on:
530             - patchset-created-event:
531                 exclude-drafts: 'true'
532                 exclude-trivial-rebase: 'false'
533                 exclude-no-code-change: 'true'
534             - draft-published-event
535             - comment-added-contains-event:
536                 comment-contains-value: 'recheck'
537             - comment-added-contains-event:
538                 comment-contains-value: 'reverify'
539           projects:
540             - project-compare-type: 'ANT'
541               project-pattern: '{name}'
542               branches:
543                 - branch-compare-type: 'ANT'
544                   branch-pattern: '**/{branch}'
545
546 - trigger:
547     name: gerrit-trigger-trivial-patch-submitted-skip-vote
548     triggers:
549       - gerrit:
550           server-name: 'Primary'
551           trigger-on:
552             - patchset-created-event:
553                 exclude-drafts: 'true'
554                 exclude-trivial-rebase: 'false'
555                 exclude-no-code-change: 'true'
556             - draft-published-event
557             - comment-added-contains-event:
558                 comment-contains-value: 'recheck'
559             - comment-added-contains-event:
560                 comment-contains-value: 'reverify'
561           projects:
562             - project-compare-type: 'ANT'
563               project-pattern: '{name}'
564               branches:
565                 - branch-compare-type: 'ANT'
566                   branch-pattern: '**/{branch}'
567           skip-vote:
568             successful: true
569             failed: true
570             unstable: true
571             notbuilt: true
572
573 - trigger:
574     name: gerrit-trigger-vpp-csit-devicetest-full
575     # Comes from VPP, for automated jobs running "device" tests with CSIT code.
576     # The job acts as an automatic verify job for VPP contributions.
577     triggers:
578       - gerrit:
579           server-name: 'Primary'
580           trigger-on:
581             - comment-added-contains-event:
582                 comment-contains-value: 'checkstyle_success'
583             - comment-added-contains-event:
584                 comment-contains-value: 'devicetest'
585           projects:
586             - project-compare-type: 'ANT'
587               project-pattern: '{name}'
588               branches:
589                 - branch-compare-type: 'ANT'
590                   branch-pattern: '**/{branch}'
591           skip-vote:
592             successful: '{skip-vote}'
593             failed: '{skip-vote}'
594             unstable: '{skip-vote}'
595             notbuilt: '{skip-vote}'
596
597 - trigger:
598     name: gerrit-trigger-vpp-csit-devicetest-manual
599     # Comes from VPP, for manual jobs running "device" tests with CSIT code.
600     # The job acts as a manual (optional) verify job for VPP contributions.
601     triggers:
602       - gerrit:
603           server-name: 'Primary'
604           trigger-on:
605             - comment-added-contains-event:
606                 comment-contains-value: 'devicetest'
607           projects:
608             - project-compare-type: 'ANT'
609               project-pattern: '{name}'
610               branches:
611                 - branch-compare-type: 'ANT'
612                   branch-pattern: '**/{branch}'
613           skip-vote:
614             successful: '{skip-vote}'
615             failed: '{skip-vote}'
616             unstable: '{skip-vote}'
617             notbuilt: '{skip-vote}'
618 # [end] Keep 'trigger' entries ordered alphabetically, please.
619
620 #### PUBLISHERS
621 # Keep 'publisher' entries ordered alphabetically, please.
622 - publisher:
623     name: archive-artifacts
624     publishers:
625       - archive:
626           artifacts: '{artifacts}'
627           allow-empty: true
628           fingerprint: true
629           latest-only: true
630
631 - publisher:
632     name: email-notification
633     publishers:
634       - email-ext:
635           recipients: 'nobody@projectrotterdam.info'
636           reply-to: ''
637           content-type: default
638           # yamllint disable-line rule:line-length
639           subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
640           body: |
641               $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
642
643               Check console output at $BUILD_URL to view the results.
644           unstable: true
645           fixed: true
646           send-to:
647             - developers
648             - recipients
649
650 - publisher:
651     name: fdio-infra-publish
652     # macro to finish up a build.
653     #
654     # Handles the following:
655     #   - Shipping logs to Nexus or S3 logs repository
656     #   - Cleanup workspace
657     publishers:
658       - postbuildscript:
659           builders:
660             - role: BOTH
661               build-on:
662                 - ABORTED
663                 - FAILURE
664                 - NOT_BUILT
665                 - SUCCESS
666                 - UNSTABLE
667               build-steps:
668                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
669                 - shell: !include-raw: scripts/backup_upload_archives.sh
670                 - fdio-infra-ship-logs
671           mark-unstable-if-failed: true
672       - workspace-cleanup:
673           exclude:
674             # Do not clean up *.jenkins-trigger files for jobs that use a
675             # properties file as input for triggering another build.
676             - "**/*.jenkins-trigger"
677           fail-build: false
678
679 - publisher:
680     name: fdio-infra-shiplogs
681     # To archive things, the job will need to create an "archives" directory in
682     # the workspace and this macro will handle copying the contents of the
683     # archives directory.
684     #
685     # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
686     # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
687     # the archive pattern. This is a space separated list of files to archive.
688     #
689     # Also ensure that the workspace is cleaned up at the end of the build.
690     publishers:
691       - postbuildscript:
692           builders:
693             - role: BOTH
694               build-on:
695                 - ABORTED
696                 - FAILURE
697                 - NOT_BUILT
698                 - SUCCESS
699                 - UNSTABLE
700               build-steps:
701                 - shell: !include-raw: include-raw-deploy-archives.sh
702                 - shell: !include-raw: scripts/backup_upload_archives.sh
703                 - maven-target:
704                     maven-version: '{maven-version}'
705                     pom: '.archives/deploy-archives.xml'
706                     goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
707                     settings: 'jenkins-log-archives-settings'
708                     settings-type: cfp
709                     global-settings: 'global-settings'
710                     global-settings-type: cfp
711                 - description-setter:
712                     regexp: '^Build logs: .*'
713           mark-unstable-if-failed: true
714       - workspace-cleanup:
715           fail-build: false
716
717 - publisher:
718     name: jacoco-report
719     publishers:
720       - jacoco:
721           exec-pattern: '**/**.exec'
722           class-pattern: '**/classes'
723           source-pattern: '**/src/main/java'
724           # yamllint disable-line rule:line-length
725           exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
726           status-update: true
727           targets:
728             - branch:
729               healthy: 10
730               unhealthy: 20
731             - method:
732               healthy: 50
733               unhealthy: 40
734
735 - publisher:
736     name: retry-build-on-builder-error
737     publishers:
738       - naginator:
739           max-failed-builds: 1
740
741 - publisher:
742     name: robot-report
743     publishers:
744       - robot:
745           output-path: '{output-path}'
746           other-files: ''
747 # [end] Keep 'publisher' entries ordered alphabetically, please.
748
749 #### BUILDERS
750 # Keep 'builder' entries ordered alphabetically, please.
751 - builder:
752     name: ci-management-check-unicode
753     builders:
754       - shell: |
755           $WORKSPACE/scripts/check-unicode.sh jjb/
756
757 - property:
758     name: fdio-infra-properties
759     properties:
760       - build-discarder:
761           days-to-keep: '{build-days-to-keep}'
762           num-to-keep: '{build-num-to-keep}'
763
764 - builder:
765     name: fdio-infra-ship-logs
766     builders:
767       # Ensure no pre-existing .netrc files are overriding logs config
768       - lf-provide-maven-settings-cleanup
769       - config-file-provider:
770           files:
771             - file-id: "jenkins-log-archives-settings"
772               variable: "SETTINGS_FILE"
773       - conditional-step:
774           condition-kind: regex-match
775           regex: "^.*logs-s3.*"
776           label: $S3_BUCKET
777           on-evaluation-failure: dont-run
778           steps:
779             - config-file-provider:
780                 files:
781                   - file-id: "jenkins-s3-log-ship"
782                     target: $HOME/.aws/credentials
783       - lf-infra-create-netrc:
784           server-id: logs
785       - shell: !include-raw:
786           - ../global-jjb/shell/logs-deploy.sh
787       - shell: !include-raw:
788           - ../global-jjb/shell/logs-clear-credentials.sh
789       - description-setter:
790           regexp: "(^(Nexus|S3) build logs: .*)"
791
792 - builder:
793     name: packer-validate
794     builders:
795       - config-file-provider:
796           files:
797             - file-id: 'packer-cloud-env'
798               variable: 'CLOUDENV'
799       # yamllint disable rule:line-length
800       - shell: |
801           #!/bin/bash
802           cd packer
803           varfiles="../packer/vars/*"
804           templates="../packer/templates/*"
805           provision="../packer/provision/*.sh"
806           for v in $varfiles; do
807               [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
808               for t in $templates; do
809                   export PACKER_LOG="yes" && \
810                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
811                               packer.io validate -var-file=$CLOUDENV \
812                               -var-file=$v $t
813                   if [ $? -ne 0 ]; then
814                      break
815                   fi
816               done
817           done
818           for p in $provision; do
819               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
820               if [ $? -ne 0 ]; then
821                  break
822               fi
823           done
824       # yamllint enable
825
826 - builder:
827     name: packer-build
828     builders:
829       - config-file-provider:
830           files:
831             - file-id: 'packer-cloud-env'
832               variable: 'CLOUDENV'
833       - shell: |
834           #!/bin/bash
835           cd packer
836           export PACKER_LOG="yes" && \
837           export PACKER_LOG_PATH="packer-build.log" && \
838                       packer.io build -var-file=$CLOUDENV \
839                       -var-file=../packer/vars/{platform}.json \
840                       ../packer/templates/{template}.json
841
842 - builder:
843     name: provide-maven-settings
844     builders:
845       - config-file-provider:
846           files:
847             - file-id: '{global-settings-file}'
848               variable: 'GLOBAL_SETTINGS_FILE'
849             - file-id: '{settings-file}'
850               variable: 'SETTINGS_FILE'
851 # [end] Keep 'builder' entries ordered alphabetically, please.