e0887571e7d46dbaf3d29be0e09187ffc6001e14
[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: compiler-parameter
29     parameters:
30       - string:
31           name: CC
32           default: '{cc}'
33           description: "CC parameter, can be gnu or clang"
34
35 - parameter:
36     name: make-parallel-jobs-parameter
37     parameters:
38       - string:
39           name: MAKE_PARALLEL_JOBS
40           default: '{make-parallel-jobs}'
41           description: "The number of cores to use for builds."
42
43 - parameter:
44     name: make-test-os-parameter
45     parameters:
46       - string:
47           name: MAKE_TEST_OS
48           default: '{make-test-os}'
49           description: "The OS on which 'make test' is run."
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: stream-parameter
177     parameters:
178       - string:
179           name: STREAM
180           default: '{stream}'
181           description: "Stream job parameter to be used in shell scripts."
182
183 - parameter:
184     name: topo-parameter
185     parameters:
186       - string:
187           name: TOPO
188           default: '{topo}'
189           description: "Topology parameter"
190 # [end] Keep 'parameter' entries ordered alphabetically, please.
191
192 #### SCMS
193 # Keep 'scm' entries ordered alphabetically, please.
194 - scm:
195     name: gerrit-trigger-scm
196     scm:
197       - git:
198           credentials-id: '{credentials-id}'
199           url: '$GIT_BASE'
200           refspec: '{refspec}'
201           branches:
202             - 'origin/$GERRIT_BRANCH'
203           skip-tag: true
204           choosing-strategy: '{choosing-strategy}'
205
206 - scm:
207     name: gerrit-trigger-scm-recursive
208     scm:
209       - git:
210           credentials-id: '{credentials-id}'
211           url: '$GIT_BASE'
212           refspec: '{refspec}'
213           branches:
214             - 'origin/$GERRIT_BRANCH'
215           skip-tag: true
216           choosing-strategy: '{choosing-strategy}'
217           submodule:
218             recursive: '{submodule-recursive}'
219
220 - scm:
221     name: git-scm
222     scm:
223       - git:
224           credentials-id: '{credentials-id}'
225           url: '$GIT_BASE'
226           refspec: ''
227           branches:
228             - 'origin/{branch}'
229           skip-tag: true
230           wipe-workspace: true
231 # [end] Keep 'scm' entries ordered alphabetically, please.
232
233 #### WRAPPERS
234 # Keep 'wrapper' entries ordered alphabetically, please.
235 - wrapper:
236     name: build-timeout
237     wrappers:
238       - timeout:
239           type: absolute
240           timeout: 360
241           fail: true
242
243 - wrapper:
244     # This wrapper is required for all jobs as it configures the wrappers
245     # needed by the fd.io infra.
246     name: fdio-infra-wrappers
247     wrappers:
248       - timeout:
249           type: absolute
250           timeout: '{build-timeout}'
251           timeout-var: 'BUILD_TIMEOUT'
252           fail: true
253       - timestamps
254       - ssh-agent-credentials:
255           users:
256             - 'jenkins-gerrit-credentials'
257       - jclouds:
258           single-use: true
259       - openstack:
260           single-use: true
261
262 - wrapper:
263     # This wrapper is used for all jobs that require no-activity timeouts
264     name: fdio-infra-wrappers-non-activity-timeout
265     wrappers:
266       - timeout:
267           type: no-activity
268           timeout: '{build-timeout}'
269           fail: true
270       - timestamps
271       - ssh-agent-credentials:
272           users:
273             - 'jenkins-gerrit-credentials'
274       - jclouds:
275           single-use: true
276       - openstack:
277           single-use: true
278 # [end] Keep 'wrapper' entries ordered alphabetically, please.
279
280 #### TRIGGERS
281 # Keep 'trigger' entries ordered alphabetically, please.
282 - trigger:
283     name: gerrit-trigger-build
284     # Comes from hicn, some verify jobs wait for build to pass.
285     triggers:
286       - gerrit:
287           server-name: 'Primary'
288           trigger-on:
289             - comment-added-contains-event:
290                 comment-contains-value: 'build_success-{stream}-{os}-{executor-arch}'
291           projects:
292             - project-compare-type: 'ANT'
293               project-pattern: '{name}'
294               branches:
295                 - branch-compare-type: 'ANT'
296                   branch-pattern: '**/{branch}'
297
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: csit-trending-failed
633     publishers:
634       - email-ext:
635           # yamllint disable-line rule:line-length
636           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
637           reply-to: ''
638           content-type: 'text'
639           subject: '{branch}: Failed tests as of $BUILD_TIMESTAMP'
640           # yamllint disable-line rule:line-length
641           body: |
642               Following tests failed in the last trending job runs, listed per testbed type.
643
644               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-failed-tests.txt"}}
645           failure: false
646           success: true
647
648 - publisher:
649     name: csit-trending-failed-job
650     publishers:
651       - email-ext:
652           # yamllint disable-line rule:line-length
653           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
654           reply-to: ''
655           content-type: 'text'
656           subject: '{branch}: The build number $BUILD_NUMBER of the job $JOB_NAME failed'
657           # yamllint disable-line rule:line-length
658           body: |
659               For more information see $BUILD_URL.
660           failure: true
661           success: false
662
663 - publisher:
664     name: csit-trending-progressions
665     publishers:
666       - email-ext:
667           # yamllint disable-line rule:line-length
668           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
669           reply-to: ''
670           content-type: 'text'
671           subject: '{branch}: Progressions as of $BUILD_TIMESTAMP'
672           # yamllint disable-line rule:line-length
673           body: |
674               Following progressions occured in the last trending job runs, listed per testbed type.
675
676               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-progressions.txt"}}
677           failure: false
678           success: true
679
680 - publisher:
681     name: csit-trending-regressions
682     publishers:
683       - email-ext:
684           # yamllint disable-line rule:line-length
685           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
686           reply-to: ''
687           content-type: 'text'
688           subject: '{branch}: Regressions as of $BUILD_TIMESTAMP'
689           # yamllint disable-line rule:line-length
690           body: |
691               Following regressions occured in the last trending job runs, listed per testbed type.
692
693               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-regressions.txt"}}
694           failure: false
695           success: true
696
697 - publisher:
698     name: email-notification
699     publishers:
700       - email-ext:
701           recipients: 'nobody@projectrotterdam.info'
702           reply-to: ''
703           content-type: default
704           # yamllint disable-line rule:line-length
705           subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
706           body: |
707               $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
708
709               Check console output at $BUILD_URL to view the results.
710           unstable: true
711           fixed: true
712           send-to:
713             - developers
714             - recipients
715
716 - publisher:
717     name: fdio-infra-publish-docs
718     # macro to finish up a build.
719     #
720     # Handles the following:
721     #   - Shipping docs S3 logs repository
722     #   - Cleanup workspace
723     publishers:
724       - postbuildscript:
725           builders:
726             - role: BOTH
727               build-on:
728                 - ABORTED
729                 - FAILURE
730                 - NOT_BUILT
731                 - SUCCESS
732                 - UNSTABLE
733               build-steps:
734                 - fdio-infra-ship-docs
735           mark-unstable-if-failed: true
736       - workspace-cleanup:
737           exclude:
738             # Do not clean up *.jenkins-trigger files for jobs that use a
739             # properties file as input for triggering another build.
740             - "**/*.jenkins-trigger"
741           fail-build: false
742
743 - publisher:
744     name: fdio-infra-publish
745     # macro to finish up a build.
746     #
747     # Handles the following:
748     #   - Shipping logs to S3 logs repository
749     #   - Cleanup workspace
750     publishers:
751       - postbuildscript:
752           builders:
753             - role: BOTH
754               build-on:
755                 - ABORTED
756                 - FAILURE
757                 - NOT_BUILT
758                 - SUCCESS
759                 - UNSTABLE
760               build-steps:
761                 - shell: !include-raw: scripts/post_build_executor_info.sh
762                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
763                 - fdio-infra-ship-logs
764           mark-unstable-if-failed: true
765       - workspace-cleanup:
766           exclude:
767             # Do not clean up *.jenkins-trigger files for jobs that use a
768             # properties file as input for triggering another build.
769             - "**/*.jenkins-trigger"
770           fail-build: false
771
772 - publisher:
773     name: jacoco-report
774     publishers:
775       - jacoco:
776           exec-pattern: '**/**.exec'
777           class-pattern: '**/classes'
778           source-pattern: '**/src/main/java'
779           # yamllint disable-line rule:line-length
780           exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
781           status-update: true
782           targets:
783             - branch:
784               healthy: 10
785               unhealthy: 20
786             - method:
787               healthy: 50
788               unhealthy: 40
789
790 - publisher:
791     name: retry-build-on-builder-error
792     publishers:
793       - naginator:
794           max-failed-builds: 1
795
796 - publisher:
797     name: robot-report
798     publishers:
799       - robot:
800           output-path: '{output-path}'
801           other-files: ''
802
803 # [end] Keep 'publisher' entries ordered alphabetically, please.
804
805 #### BUILDERS
806 # Keep 'builder' entries ordered alphabetically, please.
807 - builder:
808     name: ci-management-check-unicode
809     builders:
810       - shell: |
811           $WORKSPACE/scripts/check-unicode.sh jjb/
812
813 - builder:
814     name: fdio-infra-ship-docs
815     builders:
816       - config-file-provider:
817           files:
818             - file-id: "jenkins-s3-docs-ship"
819               target: $HOME/.aws/credentials
820       - shell: !include-raw:
821           - scripts/terraform_s3_docs_ship.sh
822       - shell: !include-raw:
823           - scripts/publish_docs.sh
824       - shell: !include-raw:
825           - ../global-jjb/shell/logs-clear-credentials.sh
826
827 - builder:
828     name: fdio-infra-ship-logs
829     builders:
830       - config-file-provider:
831           files:
832             - file-id: "jenkins-s3-log-ship"
833               target: $HOME/.aws/credentials
834       - shell: !include-raw:
835           - scripts/publish_library_py.sh
836       - shell: !include-raw:
837           - scripts/publish_logs.sh
838       - shell: !include-raw:
839           - ../global-jjb/shell/logs-clear-credentials.sh
840       - description-setter:
841           regexp: "(^S3 build logs: .*)"
842
843 - builder:
844     name: packer-validate
845     builders:
846       - config-file-provider:
847           files:
848             - file-id: 'packer-cloud-env'
849               variable: 'CLOUDENV'
850       # yamllint disable rule:line-length
851       - shell: |
852           #!/bin/bash
853           cd packer
854           varfiles="../packer/vars/*"
855           templates="../packer/templates/*"
856           provision="../packer/provision/*.sh"
857           for v in $varfiles; do
858               [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
859               for t in $templates; do
860                   export PACKER_LOG="yes" && \
861                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
862                               packer.io validate -var-file=$CLOUDENV \
863                               -var-file=$v $t
864                   if [ $? -ne 0 ]; then
865                      break
866                   fi
867               done
868           done
869           for p in $provision; do
870               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
871               if [ $? -ne 0 ]; then
872                  break
873               fi
874           done
875       # yamllint enable
876
877 - builder:
878     name: packer-build
879     builders:
880       - config-file-provider:
881           files:
882             - file-id: 'packer-cloud-env'
883               variable: 'CLOUDENV'
884       - shell: |
885           #!/bin/bash
886           cd packer
887           export PACKER_LOG="yes" && \
888           export PACKER_LOG_PATH="packer-build.log" && \
889                       packer.io build -var-file=$CLOUDENV \
890                       -var-file=../packer/vars/{platform}.json \
891                       ../packer/templates/{template}.json
892
893 - builder:
894     name: provide-maven-settings
895     builders:
896       - config-file-provider:
897           files:
898             - file-id: '{global-settings-file}'
899               variable: 'GLOBAL_SETTINGS_FILE'
900             - file-id: '{settings-file}'
901               variable: 'SETTINGS_FILE'
902 # [end] Keep 'builder' entries ordered alphabetically, please.