f4b009afe30a965b657e88821ae34a6f6c0810d8
[ci-management.git] / jjb / global-macros.yaml
1 # Copyright (c) 2020 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             - patchset-created-event:
372                 exclude-drafts: 'true'
373                 exclude-trivial-rebase: 'false'
374                 exclude-no-code-change: 'false'
375             - draft-published-event
376             - comment-added-contains-event:
377                 comment-contains-value: 'recheck'
378             - comment-added-contains-event:
379                 comment-contains-value: 'reverify'
380             - comment-added-contains-event:
381                 comment-contains-value: 'csit-devicetest'
382           projects:
383             - project-compare-type: 'ANT'
384               project-pattern: '{project}'
385               branches:
386                 - branch-compare-type: 'ANT'
387                   branch-pattern: '**/{branch}'
388           skip-vote:
389             successful: '{skip-vote}'
390             failed: '{skip-vote}'
391             unstable: '{skip-vote}'
392             notbuilt: '{skip-vote}'
393
394 - trigger:
395     name: gerrit-trigger-csit-vpp-devicetest-manual
396     # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
397     # The job acts as a manual (optional) verify job for CSIT contributions.
398     triggers:
399       - gerrit:
400           server-name: 'Primary'
401           trigger-on:
402             - comment-added-contains-event:
403                 comment-contains-value: 'csit-devicetest'
404           projects:
405             - project-compare-type: 'ANT'
406               project-pattern: '{project}'
407               branches:
408                 - branch-compare-type: 'ANT'
409                   branch-pattern: '**/{branch}'
410           skip-vote:
411             successful: '{skip-vote}'
412             failed: '{skip-vote}'
413             unstable: '{skip-vote}'
414             notbuilt: '{skip-vote}'
415
416 - trigger:
417     name: gerrit-trigger-manually-triggered
418     triggers:
419       - gerrit:
420           server-name: 'Primary'
421           trigger-on:
422             - comment-added-contains-event:
423                 comment-contains-value: '{comment-trigger-value}'
424           projects:
425             - project-compare-type: 'ANT'
426               project-pattern: '{name}'
427               branches:
428                 - branch-compare-type: 'ANT'
429                   branch-pattern: '**/{branch}'
430
431 - trigger:
432     name: gerrit-trigger-patch-merged
433     triggers:
434       - gerrit:
435           server-name: 'Primary'
436           trigger-on:
437             - change-merged-event
438             - comment-added-contains-event:
439                 comment-contains-value: 'remerge'
440           projects:
441             - project-compare-type: 'ANT'
442               project-pattern: '{name}'
443               branches:
444                 - branch-compare-type: 'ANT'
445                   branch-pattern: '**/{branch}'
446           # Force Jenkins always vote the values it should already have voted
447           # during the prior verify phase
448           override-votes: true
449           gerrit-build-started-verified-value: 1
450           gerrit-build-successful-verified-value: 1
451           gerrit-build-failed-verified-value: 1
452           gerrit-build-unstable-verified-value: 1
453           gerrit-build-notbuilt-verified-value: 1
454           gerrit-build-started-codereview-value: 0
455           gerrit-build-successful-codereview-value: 0
456           gerrit-build-failed-codereview-value: 0
457           gerrit-build-unstable-codereview-value: 0
458           gerrit-build-notbuilt-codereview-value: 0
459
460 - trigger:
461     name: gerrit-trigger-patch-submitted
462     triggers:
463       - gerrit:
464           server-name: 'Primary'
465           trigger-on:
466             - patchset-created-event:
467                 exclude-drafts: 'true'
468                 exclude-trivial-rebase: 'false'
469                 exclude-no-code-change: 'false'
470             - draft-published-event
471             - comment-added-contains-event:
472                 comment-contains-value: 'recheck'
473             - comment-added-contains-event:
474                 comment-contains-value: 'reverify'
475           projects:
476             - project-compare-type: 'ANT'
477               project-pattern: '{name}'
478               branches:
479                 - branch-compare-type: 'ANT'
480                   branch-pattern: '**/{branch}'
481
482 - trigger:
483     name: gerrit-trigger-os-patch-merged
484     triggers:
485       - gerrit:
486           server-name: 'Primary'
487           trigger-on:
488             - comment-added-contains-event:
489                 comment-contains-value: 'os-merge'
490           projects:
491             - project-compare-type: 'ANT'
492               project-pattern: '{name}'
493               branches:
494                 - branch-compare-type: 'ANT'
495                   branch-pattern: '**/{branch}'
496           # Force Jenkins always vote the values it should already have voted
497           # during the prior verify phase
498           override-votes: true
499           gerrit-build-started-verified-value: 1
500           gerrit-build-successful-verified-value: 1
501           gerrit-build-failed-verified-value: 1
502           gerrit-build-unstable-verified-value: 1
503           gerrit-build-notbuilt-verified-value: 1
504           gerrit-build-started-codereview-value: 0
505           gerrit-build-successful-codereview-value: 0
506           gerrit-build-failed-codereview-value: 0
507           gerrit-build-unstable-codereview-value: 0
508           gerrit-build-notbuilt-codereview-value: 0
509
510 - trigger:
511     name: gerrit-trigger-os-trivial-patch-submitted
512     triggers:
513       - gerrit:
514           server-name: 'Primary'
515           trigger-on:
516             - comment-added-contains-event:
517                 comment-contains-value: 'os-check'
518             - comment-added-contains-event:
519                 comment-contains-value: 'os-verify'
520           projects:
521             - project-compare-type: 'ANT'
522               project-pattern: '{name}'
523               branches:
524                 - branch-compare-type: 'ANT'
525                   branch-pattern: '**/{branch}'
526
527 - trigger:
528     name: gerrit-trigger-trivial-patch-submitted
529     triggers:
530       - gerrit:
531           server-name: 'Primary'
532           trigger-on:
533             - patchset-created-event:
534                 exclude-drafts: 'true'
535                 exclude-trivial-rebase: 'false'
536                 exclude-no-code-change: 'true'
537             - draft-published-event
538             - comment-added-contains-event:
539                 comment-contains-value: 'recheck'
540             - comment-added-contains-event:
541                 comment-contains-value: 'reverify'
542           projects:
543             - project-compare-type: 'ANT'
544               project-pattern: '{name}'
545               branches:
546                 - branch-compare-type: 'ANT'
547                   branch-pattern: '**/{branch}'
548
549 - trigger:
550     name: gerrit-trigger-trivial-patch-submitted-skip-vote
551     triggers:
552       - gerrit:
553           server-name: 'Primary'
554           trigger-on:
555             - patchset-created-event:
556                 exclude-drafts: 'true'
557                 exclude-trivial-rebase: 'false'
558                 exclude-no-code-change: 'true'
559             - draft-published-event
560             - comment-added-contains-event:
561                 comment-contains-value: 'recheck'
562             - comment-added-contains-event:
563                 comment-contains-value: 'reverify'
564           projects:
565             - project-compare-type: 'ANT'
566               project-pattern: '{name}'
567               branches:
568                 - branch-compare-type: 'ANT'
569                   branch-pattern: '**/{branch}'
570           skip-vote:
571             successful: true
572             failed: true
573             unstable: true
574             notbuilt: true
575
576 - trigger:
577     name: gerrit-trigger-vpp-csit-devicetest-full
578     # Comes from VPP, for automated jobs running "device" tests with CSIT code.
579     # The job acts as an automatic verify job for VPP contributions.
580     triggers:
581       - gerrit:
582           server-name: 'Primary'
583           trigger-on:
584             - comment-added-contains-event:
585                 comment-contains-value: 'checkstyle_success'
586             - comment-added-contains-event:
587                 comment-contains-value: 'devicetest'
588           projects:
589             - project-compare-type: 'ANT'
590               project-pattern: '{name}'
591               branches:
592                 - branch-compare-type: 'ANT'
593                   branch-pattern: '**/{branch}'
594           skip-vote:
595             successful: '{skip-vote}'
596             failed: '{skip-vote}'
597             unstable: '{skip-vote}'
598             notbuilt: '{skip-vote}'
599
600 - trigger:
601     name: gerrit-trigger-vpp-csit-devicetest-manual
602     # Comes from VPP, for manual jobs running "device" tests with CSIT code.
603     # The job acts as a manual (optional) verify job for VPP contributions.
604     triggers:
605       - gerrit:
606           server-name: 'Primary'
607           trigger-on:
608             - comment-added-contains-event:
609                 comment-contains-value: 'devicetest'
610           projects:
611             - project-compare-type: 'ANT'
612               project-pattern: '{name}'
613               branches:
614                 - branch-compare-type: 'ANT'
615                   branch-pattern: '**/{branch}'
616           skip-vote:
617             successful: '{skip-vote}'
618             failed: '{skip-vote}'
619             unstable: '{skip-vote}'
620             notbuilt: '{skip-vote}'
621 # [end] Keep 'trigger' entries ordered alphabetically, please.
622
623 #### PUBLISHERS
624 # Keep 'publisher' entries ordered alphabetically, please.
625 - publisher:
626     name: archive-artifacts
627     publishers:
628       - archive:
629           artifacts: '{artifacts}'
630           allow-empty: true
631           fingerprint: true
632           latest-only: true
633
634 - publisher:
635     name: email-notification
636     publishers:
637       - email-ext:
638           recipients: 'nobody@projectrotterdam.info'
639           reply-to: ''
640           content-type: default
641           # yamllint disable-line rule:line-length
642           subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
643           body: |
644               $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
645
646               Check console output at $BUILD_URL to view the results.
647           unstable: true
648           fixed: true
649           send-to:
650             - developers
651             - recipients
652
653 - publisher:
654     name: fdio-infra-publish
655     # macro to finish up a build.
656     #
657     # Handles the following:
658     #   - Shipping logs to Nexus or S3 logs repository
659     #   - Cleanup workspace
660     publishers:
661       - postbuildscript:
662           builders:
663             - role: BOTH
664               build-on:
665                 - ABORTED
666                 - FAILURE
667                 - NOT_BUILT
668                 - SUCCESS
669                 - UNSTABLE
670               build-steps:
671                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
672                 - fdio-infra-ship-logs
673           mark-unstable-if-failed: true
674       - workspace-cleanup:
675           exclude:
676             # Do not clean up *.jenkins-trigger files for jobs that use a
677             # properties file as input for triggering another build.
678             - "**/*.jenkins-trigger"
679           fail-build: false
680
681 - publisher:
682     name: fdio-infra-shiplogs
683     # To archive things, the job will need to create an "archives" directory in
684     # the workspace and this macro will handle copying the contents of the
685     # archives directory.
686     #
687     # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
688     # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
689     # the archive pattern. This is a space separated list of files to archive.
690     #
691     # Also ensure that the workspace is cleaned up at the end of the build.
692     publishers:
693       - postbuildscript:
694           builders:
695             - role: BOTH
696               build-on:
697                 - ABORTED
698                 - FAILURE
699                 - NOT_BUILT
700                 - SUCCESS
701                 - UNSTABLE
702               build-steps:
703                 - shell: !include-raw: include-raw-deploy-archives.sh
704                 - maven-target:
705                     maven-version: '{maven-version}'
706                     pom: '.archives/deploy-archives.xml'
707                     goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
708                     settings: 'jenkins-log-archives-settings'
709                     settings-type: cfp
710                     global-settings: 'global-settings'
711                     global-settings-type: cfp
712                 - description-setter:
713                     regexp: '^Build logs: .*'
714           mark-unstable-if-failed: true
715       - workspace-cleanup:
716           fail-build: false
717
718 - publisher:
719     name: jacoco-report
720     publishers:
721       - jacoco:
722           exec-pattern: '**/**.exec'
723           class-pattern: '**/classes'
724           source-pattern: '**/src/main/java'
725           # yamllint disable-line rule:line-length
726           exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
727           status-update: true
728           targets:
729             - branch:
730               healthy: 10
731               unhealthy: 20
732             - method:
733               healthy: 50
734               unhealthy: 40
735
736 - publisher:
737     name: retry-build-on-builder-error
738     publishers:
739       - naginator:
740           max-failed-builds: 1
741
742 - publisher:
743     name: robot-report
744     publishers:
745       - robot:
746           output-path: '{output-path}'
747           other-files: ''
748 # [end] Keep 'publisher' entries ordered alphabetically, please.
749
750 #### BUILDERS
751 # Keep 'builder' entries ordered alphabetically, please.
752 - builder:
753     name: ci-management-check-unicode
754     builders:
755       - shell: |
756           $WORKSPACE/scripts/check-unicode.sh jjb/
757
758 - property:
759     name: fdio-infra-properties
760     properties:
761       - build-discarder:
762           days-to-keep: '{build-days-to-keep}'
763           num-to-keep: '{build-num-to-keep}'
764
765 - builder:
766     name: fdio-infra-ship-logs
767     builders:
768       # Ensure no pre-existing .netrc files are overriding logs config
769       - lf-provide-maven-settings-cleanup
770       - config-file-provider:
771           files:
772             - file-id: "jenkins-log-archives-settings"
773               variable: "SETTINGS_FILE"
774       - conditional-step:
775           condition-kind: regex-match
776           regex: "^.*logs-s3.*"
777           label: $S3_BUCKET
778           on-evaluation-failure: dont-run
779           steps:
780             - config-file-provider:
781                 files:
782                   - file-id: "jenkins-s3-log-ship"
783                     target: $HOME/.aws/credentials
784       - lf-infra-create-netrc:
785           server-id: logs
786       - shell: !include-raw:
787           - ../global-jjb/shell/logs-deploy.sh
788       - shell: !include-raw:
789           - ../global-jjb/shell/logs-clear-credentials.sh
790       - description-setter:
791           regexp: "(^(Nexus|S3) build logs: .*)"
792
793 - builder:
794     name: packer-validate
795     builders:
796       - config-file-provider:
797           files:
798             - file-id: 'packer-cloud-env'
799               variable: 'CLOUDENV'
800       # yamllint disable rule:line-length
801       - shell: |
802           #!/bin/bash
803           cd packer
804           varfiles="../packer/vars/*"
805           templates="../packer/templates/*"
806           provision="../packer/provision/*.sh"
807           for v in $varfiles; do
808               [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
809               for t in $templates; do
810                   export PACKER_LOG="yes" && \
811                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
812                               packer.io validate -var-file=$CLOUDENV \
813                               -var-file=$v $t
814                   if [ $? -ne 0 ]; then
815                      break
816                   fi
817               done
818           done
819           for p in $provision; do
820               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
821               if [ $? -ne 0 ]; then
822                  break
823               fi
824           done
825       # yamllint enable
826
827 - builder:
828     name: packer-build
829     builders:
830       - config-file-provider:
831           files:
832             - file-id: 'packer-cloud-env'
833               variable: 'CLOUDENV'
834       - shell: |
835           #!/bin/bash
836           cd packer
837           export PACKER_LOG="yes" && \
838           export PACKER_LOG_PATH="packer-build.log" && \
839                       packer.io build -var-file=$CLOUDENV \
840                       -var-file=../packer/vars/{platform}.json \
841                       ../packer/templates/{template}.json
842
843 - builder:
844     name: provide-maven-settings
845     builders:
846       - config-file-provider:
847           files:
848             - file-id: '{global-settings-file}'
849               variable: 'GLOBAL_SETTINGS_FILE'
850             - file-id: '{settings-file}'
851               variable: 'SETTINGS_FILE'
852 # [end] Keep 'builder' entries ordered alphabetically, please.