Nexus retirement CI job clean up
[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-checkstyle
284     # Comes from VPP, some verify jobs wait for checkstyle to pass.
285     # This macro is to be used for such verify jobs which are voting.
286     triggers:
287       - gerrit:
288           server-name: 'Primary'
289           trigger-on:
290             - comment-added-contains-event:
291                 comment-contains-value: 'checkstyle_success'
292           projects:
293             - project-compare-type: 'ANT'
294               project-pattern: '{name}'
295               branches:
296                 - branch-compare-type: 'ANT'
297                   branch-pattern: '**/{branch}'
298
299 - trigger:
300     name: gerrit-trigger-checkstyle-nonvoting
301     # Comes from VPP, some verify jobs wait for checkstyle to pass.
302     # This macro is to be used for such verify jobs which are non-voting.
303     triggers:
304       - gerrit:
305           server-name: 'Primary'
306           trigger-on:
307             - comment-added-contains-event:
308                 comment-contains-value: 'checkstyle_success'
309           projects:
310             - project-compare-type: 'ANT'
311               project-pattern: '{name}'
312               branches:
313                 - branch-compare-type: 'ANT'
314                   branch-pattern: '**/{branch}'
315           skip-vote:
316             successful: true
317             failed: true
318             unstable: true
319             notbuilt: true
320           override-votes: true
321           gerrit-build-successful-verified-value: 1
322           gerrit-build-failed-verified-value: 1
323           gerrit-build-unstable-verified-value: 1
324           gerrit-build-notbuilt-verified-value: 1
325
326 - trigger:
327     name: gerrit-trigger-csit-perftest
328     # Manual trigger common for csit-vpp and vpp-csit perf jobs.
329     triggers:
330       - gerrit:
331           server-name: 'Primary'
332           trigger-on:
333             - comment-added-contains-event:
334                 comment-contains-value: '{trigger-word}'
335           projects:
336             - project-compare-type: 'ANT'
337               project-pattern: '{project}'
338               branches:
339                 - branch-compare-type: 'ANT'
340                   branch-pattern: '**/{branch}'
341           skip-vote:
342             successful: '{skip-vote}'
343             failed: '{skip-vote}'
344             unstable: '{skip-vote}'
345             notbuilt: '{skip-vote}'
346
347 - trigger:
348     name: gerrit-trigger-csit-vpp-devicetest-full
349     # Comes from CSIT, for automatic jobs running device tests with VPP builds.
350     # The job acts as an automatic verify job for CSIT contributions.
351     triggers:
352       - gerrit:
353           server-name: 'Primary'
354           trigger-on:
355             # The main way the job is triggered automatically on patch upload.
356             # Gated by tox job, so we do not spend resources on WiP changes.
357             - comment-added-contains-event:
358                 comment-contains-value: 'tox_success'
359             # Manual trigger to allow testing WiP changes with selected tags.
360             - comment-added-contains-event:
361                 comment-contains-value: 'csit-devicetest'
362             # A comment with "recheck" restarts tox job, so no condition here.
363           projects:
364             - project-compare-type: 'ANT'
365               project-pattern: '{project}'
366               branches:
367                 - branch-compare-type: 'ANT'
368                   branch-pattern: '**/{branch}'
369           skip-vote:
370             successful: '{skip-vote}'
371             failed: '{skip-vote}'
372             unstable: '{skip-vote}'
373             notbuilt: '{skip-vote}'
374
375 - trigger:
376     name: gerrit-trigger-csit-vpp-devicetest-manual
377     # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
378     # The job acts as a manual (optional) verify job for CSIT contributions.
379     triggers:
380       - gerrit:
381           server-name: 'Primary'
382           trigger-on:
383             - comment-added-contains-event:
384                 comment-contains-value: 'csit-devicetest'
385           projects:
386             - project-compare-type: 'ANT'
387               project-pattern: '{project}'
388               branches:
389                 - branch-compare-type: 'ANT'
390                   branch-pattern: '**/{branch}'
391           skip-vote:
392             successful: '{skip-vote}'
393             failed: '{skip-vote}'
394             unstable: '{skip-vote}'
395             notbuilt: '{skip-vote}'
396
397 - trigger:
398     name: gerrit-trigger-manually-triggered
399     triggers:
400       - gerrit:
401           server-name: 'Primary'
402           trigger-on:
403             - comment-added-contains-event:
404                 comment-contains-value: '{comment-trigger-value}'
405           projects:
406             - project-compare-type: 'ANT'
407               project-pattern: '{name}'
408               branches:
409                 - branch-compare-type: 'ANT'
410                   branch-pattern: '**/{branch}'
411
412 - trigger:
413     name: gerrit-trigger-patch-merged
414     triggers:
415       - gerrit:
416           server-name: 'Primary'
417           trigger-on:
418             - change-merged-event
419             - comment-added-contains-event:
420                 comment-contains-value: 'remerge'
421           projects:
422             - project-compare-type: 'ANT'
423               project-pattern: '{name}'
424               branches:
425                 - branch-compare-type: 'ANT'
426                   branch-pattern: '**/{branch}'
427           # Force Jenkins always vote the values it should already have voted
428           # during the prior verify phase
429           override-votes: true
430           gerrit-build-started-verified-value: 1
431           gerrit-build-successful-verified-value: 1
432           gerrit-build-failed-verified-value: 1
433           gerrit-build-unstable-verified-value: 1
434           gerrit-build-notbuilt-verified-value: 1
435           gerrit-build-started-codereview-value: 0
436           gerrit-build-successful-codereview-value: 0
437           gerrit-build-failed-codereview-value: 0
438           gerrit-build-unstable-codereview-value: 0
439           gerrit-build-notbuilt-codereview-value: 0
440
441 - trigger:
442     name: gerrit-trigger-patch-submitted
443     triggers:
444       - gerrit:
445           server-name: 'Primary'
446           trigger-on:
447             - patchset-created-event:
448                 exclude-drafts: 'true'
449                 exclude-trivial-rebase: 'false'
450                 exclude-no-code-change: 'false'
451             - draft-published-event
452             - comment-added-contains-event:
453                 comment-contains-value: 'recheck'
454             - comment-added-contains-event:
455                 comment-contains-value: 'reverify'
456           projects:
457             - project-compare-type: 'ANT'
458               project-pattern: '{name}'
459               branches:
460                 - branch-compare-type: 'ANT'
461                   branch-pattern: '**/{branch}'
462
463 - trigger:
464     name: gerrit-trigger-os-patch-merged
465     triggers:
466       - gerrit:
467           server-name: 'Primary'
468           trigger-on:
469             - comment-added-contains-event:
470                 comment-contains-value: 'os-merge'
471           projects:
472             - project-compare-type: 'ANT'
473               project-pattern: '{name}'
474               branches:
475                 - branch-compare-type: 'ANT'
476                   branch-pattern: '**/{branch}'
477           # Force Jenkins always vote the values it should already have voted
478           # during the prior verify phase
479           override-votes: true
480           gerrit-build-started-verified-value: 1
481           gerrit-build-successful-verified-value: 1
482           gerrit-build-failed-verified-value: 1
483           gerrit-build-unstable-verified-value: 1
484           gerrit-build-notbuilt-verified-value: 1
485           gerrit-build-started-codereview-value: 0
486           gerrit-build-successful-codereview-value: 0
487           gerrit-build-failed-codereview-value: 0
488           gerrit-build-unstable-codereview-value: 0
489           gerrit-build-notbuilt-codereview-value: 0
490
491 - trigger:
492     name: gerrit-trigger-os-trivial-patch-submitted
493     triggers:
494       - gerrit:
495           server-name: 'Primary'
496           trigger-on:
497             - comment-added-contains-event:
498                 comment-contains-value: 'os-check'
499             - comment-added-contains-event:
500                 comment-contains-value: 'os-verify'
501           projects:
502             - project-compare-type: 'ANT'
503               project-pattern: '{name}'
504               branches:
505                 - branch-compare-type: 'ANT'
506                   branch-pattern: '**/{branch}'
507
508 - trigger:
509     name: gerrit-trigger-trivial-patch-submitted
510     triggers:
511       - gerrit:
512           server-name: 'Primary'
513           trigger-on:
514             - patchset-created-event:
515                 exclude-drafts: 'true'
516                 exclude-trivial-rebase: 'false'
517                 exclude-no-code-change: 'true'
518             - draft-published-event
519             - comment-added-contains-event:
520                 comment-contains-value: 'recheck'
521             - comment-added-contains-event:
522                 comment-contains-value: 'reverify'
523           projects:
524             - project-compare-type: 'ANT'
525               project-pattern: '{name}'
526               branches:
527                 - branch-compare-type: 'ANT'
528                   branch-pattern: '**/{branch}'
529
530 - trigger:
531     name: gerrit-trigger-trivial-patch-submitted-skip-vote
532     triggers:
533       - gerrit:
534           server-name: 'Primary'
535           trigger-on:
536             - patchset-created-event:
537                 exclude-drafts: 'true'
538                 exclude-trivial-rebase: 'false'
539                 exclude-no-code-change: 'true'
540             - draft-published-event
541             - comment-added-contains-event:
542                 comment-contains-value: 'recheck'
543             - comment-added-contains-event:
544                 comment-contains-value: 'reverify'
545           projects:
546             - project-compare-type: 'ANT'
547               project-pattern: '{name}'
548               branches:
549                 - branch-compare-type: 'ANT'
550                   branch-pattern: '**/{branch}'
551           skip-vote:
552             successful: true
553             failed: true
554             unstable: true
555             notbuilt: true
556
557 - trigger:
558     name: gerrit-trigger-vpp-csit-devicetest-full
559     # Comes from VPP, for automated jobs running "device" tests with CSIT code.
560     # The job acts as an automatic verify job for VPP contributions.
561     triggers:
562       - gerrit:
563           server-name: 'Primary'
564           trigger-on:
565             - comment-added-contains-event:
566                 comment-contains-value: 'checkstyle_success'
567             - comment-added-contains-event:
568                 comment-contains-value: 'devicetest'
569           projects:
570             - project-compare-type: 'ANT'
571               project-pattern: '{name}'
572               branches:
573                 - branch-compare-type: 'ANT'
574                   branch-pattern: '**/{branch}'
575           skip-vote:
576             successful: '{skip-vote}'
577             failed: '{skip-vote}'
578             unstable: '{skip-vote}'
579             notbuilt: '{skip-vote}'
580
581 - trigger:
582     name: gerrit-trigger-vpp-csit-devicetest-manual
583     # Comes from VPP, for manual jobs running "device" tests with CSIT code.
584     # The job acts as a manual (optional) verify job for VPP contributions.
585     triggers:
586       - gerrit:
587           server-name: 'Primary'
588           trigger-on:
589             - comment-added-contains-event:
590                 comment-contains-value: 'devicetest'
591           projects:
592             - project-compare-type: 'ANT'
593               project-pattern: '{name}'
594               branches:
595                 - branch-compare-type: 'ANT'
596                   branch-pattern: '**/{branch}'
597           skip-vote:
598             successful: '{skip-vote}'
599             failed: '{skip-vote}'
600             unstable: '{skip-vote}'
601             notbuilt: '{skip-vote}'
602 # [end] Keep 'trigger' entries ordered alphabetically, please.
603
604 #### PUBLISHERS
605 # Keep 'publisher' entries ordered alphabetically, please.
606 - publisher:
607     name: archive-artifacts
608     publishers:
609       - archive:
610           artifacts: '{artifacts}'
611           allow-empty: true
612           fingerprint: true
613           latest-only: true
614
615 - publisher:
616     name: csit-trending-failed
617     publishers:
618       - email-ext:
619           # yamllint disable-line rule:line-length
620           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
621           reply-to: ''
622           content-type: 'text'
623           subject: '{branch}: Failed tests as of $BUILD_TIMESTAMP'
624           # yamllint disable-line rule:line-length
625           body: |
626               Following tests failed in the last trending job runs, listed per testbed type.
627
628               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-failed-tests.txt"}}
629           failure: false
630           success: true
631
632 - publisher:
633     name: csit-trending-failed-job
634     publishers:
635       - email-ext:
636           # yamllint disable-line rule:line-length
637           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
638           reply-to: ''
639           content-type: 'text'
640           subject: '{branch}: The build number $BUILD_NUMBER of the job $JOB_NAME failed'
641           # yamllint disable-line rule:line-length
642           body: |
643               For more information see $BUILD_URL.
644           failure: true
645           success: false
646
647 - publisher:
648     name: csit-trending-progressions
649     publishers:
650       - email-ext:
651           # yamllint disable-line rule:line-length
652           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
653           reply-to: ''
654           content-type: 'text'
655           subject: '{branch}: Progressions as of $BUILD_TIMESTAMP'
656           # yamllint disable-line rule:line-length
657           body: |
658               Following progressions occured in the last trending job runs, listed per testbed type.
659
660               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-progressions.txt"}}
661           failure: false
662           success: true
663
664 - publisher:
665     name: csit-trending-regressions
666     publishers:
667       - email-ext:
668           # yamllint disable-line rule:line-length
669           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
670           reply-to: ''
671           content-type: 'text'
672           subject: '{branch}: Regressions as of $BUILD_TIMESTAMP'
673           # yamllint disable-line rule:line-length
674           body: |
675               Following regressions occured in the last trending job runs, listed per testbed type.
676
677               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-regressions.txt"}}
678           failure: false
679           success: true
680
681 - publisher:
682     name: email-notification
683     publishers:
684       - email-ext:
685           recipients: 'nobody@projectrotterdam.info'
686           reply-to: ''
687           content-type: default
688           # yamllint disable-line rule:line-length
689           subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
690           body: |
691               $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
692
693               Check console output at $BUILD_URL to view the results.
694           unstable: true
695           fixed: true
696           send-to:
697             - developers
698             - recipients
699
700 - publisher:
701     name: fdio-infra-publish-docs
702     # macro to finish up a build.
703     #
704     # Handles the following:
705     #   - Shipping docs S3 logs repository
706     #   - Cleanup workspace
707     publishers:
708       - postbuildscript:
709           builders:
710             - role: BOTH
711               build-on:
712                 - ABORTED
713                 - FAILURE
714                 - NOT_BUILT
715                 - SUCCESS
716                 - UNSTABLE
717               build-steps:
718                 - fdio-infra-ship-docs
719           mark-unstable-if-failed: true
720       - workspace-cleanup:
721           exclude:
722             # Do not clean up *.jenkins-trigger files for jobs that use a
723             # properties file as input for triggering another build.
724             - "**/*.jenkins-trigger"
725           fail-build: false
726
727 - publisher:
728     name: fdio-infra-publish
729     # macro to finish up a build.
730     #
731     # Handles the following:
732     #   - Shipping logs to Nexus or S3 logs repository
733     #   - Cleanup workspace
734     publishers:
735       - postbuildscript:
736           builders:
737             - role: BOTH
738               build-on:
739                 - ABORTED
740                 - FAILURE
741                 - NOT_BUILT
742                 - SUCCESS
743                 - UNSTABLE
744               build-steps:
745                 - shell: !include-raw: scripts/post_build_executor_info.sh
746                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
747                 - fdio-infra-ship-backup-logs
748                 - fdio-infra-ship-logs
749           mark-unstable-if-failed: true
750       - workspace-cleanup:
751           exclude:
752             # Do not clean up *.jenkins-trigger files for jobs that use a
753             # properties file as input for triggering another build.
754             - "**/*.jenkins-trigger"
755           fail-build: false
756
757 - publisher:
758     name: jacoco-report
759     publishers:
760       - jacoco:
761           exec-pattern: '**/**.exec'
762           class-pattern: '**/classes'
763           source-pattern: '**/src/main/java'
764           # yamllint disable-line rule:line-length
765           exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
766           status-update: true
767           targets:
768             - branch:
769               healthy: 10
770               unhealthy: 20
771             - method:
772               healthy: 50
773               unhealthy: 40
774
775 - publisher:
776     name: retry-build-on-builder-error
777     publishers:
778       - naginator:
779           max-failed-builds: 1
780
781 - publisher:
782     name: robot-report
783     publishers:
784       - robot:
785           output-path: '{output-path}'
786           other-files: ''
787
788 # [end] Keep 'publisher' entries ordered alphabetically, please.
789
790 #### BUILDERS
791 # Keep 'builder' entries ordered alphabetically, please.
792 - builder:
793     name: ci-management-check-unicode
794     builders:
795       - shell: |
796           $WORKSPACE/scripts/check-unicode.sh jjb/
797
798 - builder:
799     name: fdio-infra-ship-backup-logs
800     builders:
801       - config-file-provider:
802           files:
803             - file-id: "jenkins-s3-log-ship"
804               target: $HOME/.aws/credentials
805       - shell: !include-raw:
806           - scripts/publish_library_py.sh
807       - shell: !include-raw:
808           - scripts/publish_backup_logs.sh
809       - shell: !include-raw:
810           - ../global-jjb/shell/logs-clear-credentials.sh
811
812 - builder:
813     name: fdio-infra-ship-docs
814     builders:
815       - config-file-provider:
816           files:
817             - file-id: "jenkins-s3-docs-ship"
818               target: $HOME/.aws/credentials
819       - shell: !include-raw:
820           - scripts/terraform_s3_docs_ship.sh
821       - shell: !include-raw:
822           - scripts/publish_docs.sh
823       - shell: !include-raw:
824           - ../global-jjb/shell/logs-clear-credentials.sh
825
826 - builder:
827     name: fdio-infra-ship-logs
828     builders:
829       - config-file-provider:
830           files:
831             - file-id: "jenkins-s3-log-ship"
832               target: $HOME/.aws/credentials
833       - shell: !include-raw:
834           - scripts/publish_library_py.sh
835       - shell: !include-raw:
836           - scripts/publish_logs.sh
837       - shell: !include-raw:
838           - ../global-jjb/shell/logs-clear-credentials.sh
839       - description-setter:
840           regexp: "(^S3 build logs: .*)"
841
842 - builder:
843     name: packer-validate
844     builders:
845       - config-file-provider:
846           files:
847             - file-id: 'packer-cloud-env'
848               variable: 'CLOUDENV'
849       # yamllint disable rule:line-length
850       - shell: |
851           #!/bin/bash
852           cd packer
853           varfiles="../packer/vars/*"
854           templates="../packer/templates/*"
855           provision="../packer/provision/*.sh"
856           for v in $varfiles; do
857               [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
858               for t in $templates; do
859                   export PACKER_LOG="yes" && \
860                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
861                               packer.io validate -var-file=$CLOUDENV \
862                               -var-file=$v $t
863                   if [ $? -ne 0 ]; then
864                      break
865                   fi
866               done
867           done
868           for p in $provision; do
869               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
870               if [ $? -ne 0 ]; then
871                  break
872               fi
873           done
874       # yamllint enable
875
876 - builder:
877     name: packer-build
878     builders:
879       - config-file-provider:
880           files:
881             - file-id: 'packer-cloud-env'
882               variable: 'CLOUDENV'
883       - shell: |
884           #!/bin/bash
885           cd packer
886           export PACKER_LOG="yes" && \
887           export PACKER_LOG_PATH="packer-build.log" && \
888                       packer.io build -var-file=$CLOUDENV \
889                       -var-file=../packer/vars/{platform}.json \
890                       ../packer/templates/{template}.json
891
892 - builder:
893     name: provide-maven-settings
894     builders:
895       - config-file-provider:
896           files:
897             - file-id: '{global-settings-file}'
898               variable: 'GLOBAL_SETTINGS_FILE'
899             - file-id: '{settings-file}'
900               variable: 'SETTINGS_FILE'
901 # [end] Keep 'builder' entries ordered alphabetically, please.