Add vpp-dpdk-rdma-version-mismatch periodic job.
[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: make-test-multiworker-os-parameter
53     parameters:
54       - string:
55           name: MAKE_TEST_MULTIWORKER_OS
56           default: '{make-test-multiworker-os}'
57           description: "The OS on which 'make test' is run with multiple VPP workers."
58
59 - parameter:
60     name: csit-fail-on-crc-mismatch-parameter
61     parameters:
62       - string:
63           name: FDIO_CSIT_FAIL_ON_CRC_MISMATCH
64           default: '{fail-on-crc-mismatch}'
65           description: "If true, CRC is checked, else compatibility is tested."
66
67 - parameter:
68     name: csit-perf-trial-duration-parameter
69     parameters:
70       - string:
71           name: CSIT_PERF_TRIAL_DURATION
72           default: "{csit-perf-trial-duration}"
73           description: "Duration of a trial measurement in BMRR tests."
74
75 - parameter:
76     name: csit-perf-trial-multiplicity-parameter
77     parameters:
78       - string:
79           name: CSIT_PERF_TRIAL_MULTIPLICITY
80           default: "{csit-perf-trial-multiplicity}"
81           description: "Number of subsamples for BMRR tests."
82
83 - parameter:
84     name: gerrit-csit-refspec-parameter
85     parameters:
86       - string:
87           name: CSIT_REF
88           default: ''
89           # yamllint disable-line rule:line-length
90           description: "GERRIT_REFSPEC parameter to override separately cloned CSIT repository, leave empty for autodetection / no override."
91
92 - parameter:
93     name: gerrit-event-comment-text-parameter
94     parameters:
95       - string:
96           name: GERRIT_EVENT_COMMENT_TEXT
97           default: ''
98           # yamllint disable-line rule:line-length
99           description: "GERRIT_EVENT_COMMENT_TEXT parameter not given by trigger"
100
101 - parameter:
102     name: gerrit-event-type-parameter
103     parameters:
104       - string:
105           name: GERRIT_EVENT_TYPE
106           default: ''
107           description: "GERRIT_EVENT_TYPE parameter not given by trigger"
108
109 - parameter:
110     name: gerrit-parameter
111     parameters:
112       - string:
113           name: GERRIT_BRANCH
114           default: '{branch}'
115           description: "JJB configured GERRIT_BRANCH parameter"
116
117 - parameter:
118     name: gerrit-project-parameter
119     parameters:
120       - string:
121           name: GERRIT_PROJECT
122           default: '{project}'
123           description: "GERRIT_PROJECT parameter if not given by trigger"
124
125 - parameter:
126     name: gerrit-refspec-parameter
127     parameters:
128       - string:
129           name: GERRIT_REFSPEC
130           default: '{refspec}'
131           description: "GERRIT_REFSPEC parameter not given by trigger"
132
133 - parameter:
134     name: is-csit-vpp-job-parameter
135     parameters:
136       - string:
137           name: IS_CSIT_VPP_JOB
138           default: '{is-csit-vpp-job}'
139           description: "Parameter is True if this is a CSIT vpp job."
140
141 - parameter:
142     name: maven-exec
143     parameters:
144       - string:
145           name: MVN
146           # yamllint disable-line rule:line-length
147           default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
148           description: 'Maven selector to be used by shell scripts'
149
150 - parameter:
151     name: maven-project-parameter
152     parameters:
153       - string:
154           name: MAVEN_SELECTOR
155           default: '{maven}'
156           description: 'Maven selector to be used by shell scripts'
157
158 - parameter:
159     name: mode-parameter
160     parameters:
161       - string:
162           name: MODE
163           default: '{mode}'
164           description: "mode parameter to be used in shell scripts."
165
166 - parameter:
167     name: os-parameter
168     parameters:
169       - string:
170           name: OS
171           default: '{os}'
172           description: "OS parameter"
173
174 - parameter:
175     name: project-parameter
176     parameters:
177       - string:
178           name: PROJECT
179           default: '{project}'
180           # yamllint disable-line rule:line-length
181           description: "JJB configured PROJECT parameter to identify a Gerrit project"
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 # [end] Keep 'parameter' entries ordered alphabetically, please.
199
200 #### SCMS
201 # Keep 'scm' entries ordered alphabetically, please.
202 - scm:
203     name: gerrit-trigger-scm
204     scm:
205       - git:
206           credentials-id: '{credentials-id}'
207           url: '$GIT_BASE'
208           refspec: '{refspec}'
209           branches:
210             - 'origin/$GERRIT_BRANCH'
211           skip-tag: true
212           choosing-strategy: '{choosing-strategy}'
213
214 - scm:
215     name: gerrit-trigger-scm-recursive
216     scm:
217       - git:
218           credentials-id: '{credentials-id}'
219           url: '$GIT_BASE'
220           refspec: '{refspec}'
221           branches:
222             - 'origin/$GERRIT_BRANCH'
223           skip-tag: true
224           choosing-strategy: '{choosing-strategy}'
225           submodule:
226             recursive: '{submodule-recursive}'
227
228 - scm:
229     name: git-scm
230     scm:
231       - git:
232           credentials-id: '{credentials-id}'
233           url: '$GIT_BASE'
234           refspec: ''
235           branches:
236             - 'origin/{branch}'
237           skip-tag: true
238           wipe-workspace: true
239 # [end] Keep 'scm' entries ordered alphabetically, please.
240
241 #### WRAPPERS
242 # Keep 'wrapper' entries ordered alphabetically, please.
243 - wrapper:
244     name: build-timeout
245     wrappers:
246       - timeout:
247           type: absolute
248           timeout: 360
249           fail: true
250
251 - wrapper:
252     # This wrapper is required for all jobs as it configures the wrappers
253     # needed by the fd.io infra.
254     name: fdio-infra-wrappers
255     wrappers:
256       - timeout:
257           type: absolute
258           timeout: '{build-timeout}'
259           timeout-var: 'BUILD_TIMEOUT'
260           fail: true
261       - timestamps
262       - ssh-agent-credentials:
263           users:
264             - 'jenkins-gerrit-credentials'
265       - jclouds:
266           single-use: true
267       - openstack:
268           single-use: true
269
270 - wrapper:
271     # This wrapper is used for all jobs that require no-activity timeouts
272     name: fdio-infra-wrappers-non-activity-timeout
273     wrappers:
274       - timeout:
275           type: no-activity
276           timeout: '{build-timeout}'
277           fail: true
278       - timestamps
279       - ssh-agent-credentials:
280           users:
281             - 'jenkins-gerrit-credentials'
282       - jclouds:
283           single-use: true
284       - openstack:
285           single-use: true
286 # [end] Keep 'wrapper' entries ordered alphabetically, please.
287
288 #### TRIGGERS
289 # Keep 'trigger' entries ordered alphabetically, please.
290 - trigger:
291     name: gerrit-trigger-build
292     # Comes from hicn, some verify jobs wait for build to pass.
293     triggers:
294       - gerrit:
295           server-name: 'Primary'
296           trigger-on:
297             - comment-added-contains-event:
298                 comment-contains-value: 'build_success-{stream}-{os}-{executor-arch}'
299           projects:
300             - project-compare-type: 'ANT'
301               project-pattern: '{name}'
302               branches:
303                 - branch-compare-type: 'ANT'
304                   branch-pattern: '**/{branch}'
305
306 - trigger:
307     name: gerrit-trigger-checkstyle
308     # Comes from VPP, some verify jobs wait for checkstyle to pass.
309     # This macro is to be used for such verify jobs which are voting.
310     triggers:
311       - gerrit:
312           server-name: 'Primary'
313           trigger-on:
314             - comment-added-contains-event:
315                 comment-contains-value: 'checkstyle_success'
316           projects:
317             - project-compare-type: 'ANT'
318               project-pattern: '{name}'
319               branches:
320                 - branch-compare-type: 'ANT'
321                   branch-pattern: '**/{branch}'
322
323 - trigger:
324     name: gerrit-trigger-checkstyle-nonvoting
325     # Comes from VPP, some verify jobs wait for checkstyle to pass.
326     # This macro is to be used for such verify jobs which are non-voting.
327     triggers:
328       - gerrit:
329           server-name: 'Primary'
330           trigger-on:
331             - comment-added-contains-event:
332                 comment-contains-value: 'checkstyle_success'
333           projects:
334             - project-compare-type: 'ANT'
335               project-pattern: '{name}'
336               branches:
337                 - branch-compare-type: 'ANT'
338                   branch-pattern: '**/{branch}'
339           skip-vote:
340             successful: true
341             failed: true
342             unstable: true
343             notbuilt: true
344           override-votes: true
345           gerrit-build-successful-verified-value: 1
346           gerrit-build-failed-verified-value: 1
347           gerrit-build-unstable-verified-value: 1
348           gerrit-build-notbuilt-verified-value: 1
349
350 - trigger:
351     name: gerrit-trigger-csit-perftest
352     # Manual trigger common for csit-vpp and vpp-csit perf jobs.
353     triggers:
354       - gerrit:
355           server-name: 'Primary'
356           trigger-on:
357             - comment-added-contains-event:
358                 comment-contains-value: '{trigger-word}'
359           projects:
360             - project-compare-type: 'ANT'
361               project-pattern: '{project}'
362               branches:
363                 - branch-compare-type: 'ANT'
364                   branch-pattern: '**/{branch}'
365           skip-vote:
366             successful: '{skip-vote}'
367             failed: '{skip-vote}'
368             unstable: '{skip-vote}'
369             notbuilt: '{skip-vote}'
370
371 - trigger:
372     name: gerrit-trigger-csit-vpp-devicetest-full
373     # Comes from CSIT, for automatic jobs running device tests with VPP builds.
374     # The job acts as an automatic verify job for CSIT contributions.
375     triggers:
376       - gerrit:
377           server-name: 'Primary'
378           trigger-on:
379             # The main way the job is triggered automatically on patch upload.
380             # Gated by tox job, so we do not spend resources on WiP changes.
381             - comment-added-contains-event:
382                 comment-contains-value: 'tox_success'
383             # Manual trigger to allow testing WiP changes with selected tags.
384             - comment-added-contains-event:
385                 comment-contains-value: 'csit-devicetest'
386             # A comment with "recheck" restarts tox job, so no condition here.
387           projects:
388             - project-compare-type: 'ANT'
389               project-pattern: '{project}'
390               branches:
391                 - branch-compare-type: 'ANT'
392                   branch-pattern: '**/{branch}'
393           skip-vote:
394             successful: '{skip-vote}'
395             failed: '{skip-vote}'
396             unstable: '{skip-vote}'
397             notbuilt: '{skip-vote}'
398
399 - trigger:
400     name: gerrit-trigger-csit-vpp-devicetest-manual
401     # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
402     # The job acts as a manual (optional) verify job for CSIT contributions.
403     triggers:
404       - gerrit:
405           server-name: 'Primary'
406           trigger-on:
407             - comment-added-contains-event:
408                 comment-contains-value: 'csit-devicetest'
409           projects:
410             - project-compare-type: 'ANT'
411               project-pattern: '{project}'
412               branches:
413                 - branch-compare-type: 'ANT'
414                   branch-pattern: '**/{branch}'
415           skip-vote:
416             successful: '{skip-vote}'
417             failed: '{skip-vote}'
418             unstable: '{skip-vote}'
419             notbuilt: '{skip-vote}'
420
421 - trigger:
422     name: gerrit-trigger-manually-triggered
423     triggers:
424       - gerrit:
425           server-name: 'Primary'
426           trigger-on:
427             - comment-added-contains-event:
428                 comment-contains-value: '{comment-trigger-value}'
429           projects:
430             - project-compare-type: 'ANT'
431               project-pattern: '{name}'
432               branches:
433                 - branch-compare-type: 'ANT'
434                   branch-pattern: '**/{branch}'
435
436 - trigger:
437     name: gerrit-trigger-patch-merged
438     triggers:
439       - gerrit:
440           server-name: 'Primary'
441           trigger-on:
442             - change-merged-event
443             - comment-added-contains-event:
444                 comment-contains-value: 'remerge'
445           projects:
446             - project-compare-type: 'ANT'
447               project-pattern: '{name}'
448               branches:
449                 - branch-compare-type: 'ANT'
450                   branch-pattern: '**/{branch}'
451           # Force Jenkins always vote the values it should already have voted
452           # during the prior verify phase
453           override-votes: true
454           gerrit-build-started-verified-value: 1
455           gerrit-build-successful-verified-value: 1
456           gerrit-build-failed-verified-value: 1
457           gerrit-build-unstable-verified-value: 1
458           gerrit-build-notbuilt-verified-value: 1
459           gerrit-build-started-codereview-value: 0
460           gerrit-build-successful-codereview-value: 0
461           gerrit-build-failed-codereview-value: 0
462           gerrit-build-unstable-codereview-value: 0
463           gerrit-build-notbuilt-codereview-value: 0
464
465 - trigger:
466     name: gerrit-trigger-patch-submitted
467     triggers:
468       - gerrit:
469           server-name: 'Primary'
470           trigger-on:
471             - patchset-created-event:
472                 exclude-drafts: 'true'
473                 exclude-trivial-rebase: 'false'
474                 exclude-no-code-change: 'false'
475             - draft-published-event
476             - comment-added-contains-event:
477                 comment-contains-value: 'recheck'
478             - comment-added-contains-event:
479                 comment-contains-value: 'reverify'
480           projects:
481             - project-compare-type: 'ANT'
482               project-pattern: '{name}'
483               branches:
484                 - branch-compare-type: 'ANT'
485                   branch-pattern: '**/{branch}'
486
487 - trigger:
488     name: gerrit-trigger-os-patch-merged
489     triggers:
490       - gerrit:
491           server-name: 'Primary'
492           trigger-on:
493             - comment-added-contains-event:
494                 comment-contains-value: 'os-merge'
495           projects:
496             - project-compare-type: 'ANT'
497               project-pattern: '{name}'
498               branches:
499                 - branch-compare-type: 'ANT'
500                   branch-pattern: '**/{branch}'
501           # Force Jenkins always vote the values it should already have voted
502           # during the prior verify phase
503           override-votes: true
504           gerrit-build-started-verified-value: 1
505           gerrit-build-successful-verified-value: 1
506           gerrit-build-failed-verified-value: 1
507           gerrit-build-unstable-verified-value: 1
508           gerrit-build-notbuilt-verified-value: 1
509           gerrit-build-started-codereview-value: 0
510           gerrit-build-successful-codereview-value: 0
511           gerrit-build-failed-codereview-value: 0
512           gerrit-build-unstable-codereview-value: 0
513           gerrit-build-notbuilt-codereview-value: 0
514
515 - trigger:
516     name: gerrit-trigger-os-trivial-patch-submitted
517     triggers:
518       - gerrit:
519           server-name: 'Primary'
520           trigger-on:
521             - comment-added-contains-event:
522                 comment-contains-value: 'os-check'
523             - comment-added-contains-event:
524                 comment-contains-value: 'os-verify'
525           projects:
526             - project-compare-type: 'ANT'
527               project-pattern: '{name}'
528               branches:
529                 - branch-compare-type: 'ANT'
530                   branch-pattern: '**/{branch}'
531
532 - trigger:
533     name: gerrit-trigger-trivial-patch-submitted
534     triggers:
535       - gerrit:
536           server-name: 'Primary'
537           trigger-on:
538             - patchset-created-event:
539                 exclude-drafts: 'true'
540                 exclude-trivial-rebase: 'false'
541                 exclude-no-code-change: 'true'
542             - draft-published-event
543             - comment-added-contains-event:
544                 comment-contains-value: 'recheck'
545             - comment-added-contains-event:
546                 comment-contains-value: 'reverify'
547           projects:
548             - project-compare-type: 'ANT'
549               project-pattern: '{name}'
550               branches:
551                 - branch-compare-type: 'ANT'
552                   branch-pattern: '**/{branch}'
553
554 - trigger:
555     name: gerrit-trigger-trivial-patch-submitted-skip-vote
556     triggers:
557       - gerrit:
558           server-name: 'Primary'
559           trigger-on:
560             - patchset-created-event:
561                 exclude-drafts: 'true'
562                 exclude-trivial-rebase: 'false'
563                 exclude-no-code-change: 'true'
564             - draft-published-event
565             - comment-added-contains-event:
566                 comment-contains-value: 'recheck'
567             - comment-added-contains-event:
568                 comment-contains-value: 'reverify'
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: true
577             failed: true
578             unstable: true
579             notbuilt: true
580
581 - trigger:
582     name: gerrit-trigger-vpp-csit-devicetest-full
583     # Comes from VPP, for automated jobs running "device" tests with CSIT code.
584     # The job acts as an automatic 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: 'checkstyle_success'
591             - comment-added-contains-event:
592                 comment-contains-value: 'devicetest'
593           projects:
594             - project-compare-type: 'ANT'
595               project-pattern: '{name}'
596               branches:
597                 - branch-compare-type: 'ANT'
598                   branch-pattern: '**/{branch}'
599           skip-vote:
600             successful: '{skip-vote}'
601             failed: '{skip-vote}'
602             unstable: '{skip-vote}'
603             notbuilt: '{skip-vote}'
604
605 - trigger:
606     name: gerrit-trigger-vpp-csit-devicetest-manual
607     # Comes from VPP, for manual jobs running "device" tests with CSIT code.
608     # The job acts as a manual (optional) verify job for VPP contributions.
609     triggers:
610       - gerrit:
611           server-name: 'Primary'
612           trigger-on:
613             - comment-added-contains-event:
614                 comment-contains-value: 'devicetest'
615           projects:
616             - project-compare-type: 'ANT'
617               project-pattern: '{name}'
618               branches:
619                 - branch-compare-type: 'ANT'
620                   branch-pattern: '**/{branch}'
621           skip-vote:
622             successful: '{skip-vote}'
623             failed: '{skip-vote}'
624             unstable: '{skip-vote}'
625             notbuilt: '{skip-vote}'
626 # [end] Keep 'trigger' entries ordered alphabetically, please.
627
628 #### PUBLISHERS
629 # Keep 'publisher' entries ordered alphabetically, please.
630 - publisher:
631     name: archive-artifacts
632     publishers:
633       - archive:
634           artifacts: '{artifacts}'
635           allow-empty: true
636           fingerprint: true
637           latest-only: true
638
639 - publisher:
640     name: csit-trending-failed
641     publishers:
642       - email-ext:
643           # yamllint disable-line rule:line-length
644           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
645           reply-to: ''
646           content-type: 'text'
647           subject: '{branch}: Failed tests as of $BUILD_TIMESTAMP'
648           # yamllint disable-line rule:line-length
649           body: |
650               Following tests failed in the last trending job runs, listed per testbed type.
651
652               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-failed-tests.txt"}}
653           failure: false
654           success: true
655
656 - publisher:
657     name: csit-trending-failed-job
658     publishers:
659       - email-ext:
660           # yamllint disable-line rule:line-length
661           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
662           reply-to: ''
663           content-type: 'text'
664           subject: '{branch}: The build number $BUILD_NUMBER of the job $JOB_NAME failed'
665           # yamllint disable-line rule:line-length
666           body: |
667               For more information see $BUILD_URL.
668           failure: true
669           success: false
670
671 - publisher:
672     name: csit-trending-progressions
673     publishers:
674       - email-ext:
675           # yamllint disable-line rule:line-length
676           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
677           reply-to: ''
678           content-type: 'text'
679           subject: '{branch}: Progressions as of $BUILD_TIMESTAMP'
680           # yamllint disable-line rule:line-length
681           body: |
682               Following progressions occured in the last trending job runs, listed per testbed type.
683
684               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-progressions.txt"}}
685           failure: false
686           success: true
687
688 - publisher:
689     name: csit-trending-regressions
690     publishers:
691       - email-ext:
692           # yamllint disable-line rule:line-length
693           recipients: 'tifrank@cisco.com, csit-report+int+616+181919729795594561@lists.fd.io'
694           reply-to: ''
695           content-type: 'text'
696           subject: '{branch}: Regressions as of $BUILD_TIMESTAMP'
697           # yamllint disable-line rule:line-length
698           body: |
699               Following regressions occured in the last trending job runs, listed per testbed type.
700
701               ${{FILE,path="resources/tools/presentation/_build/_static/vpp/trending-regressions.txt"}}
702           failure: false
703           success: true
704
705 - publisher:
706     name: vpp-dpdk-rdma-version-mismatch
707     publishers:
708       - email-ext:
709           # NOTE: noreply@jenkins.fd.io must be a member of vpp-build@lists.fd.io
710           #       for the email to be distributed to the group members.
711           # yamllint disable-line rule:line-length
712           recipients: 'vpp-build@lists.fd.io'
713           reply-to: ''
714           content-type: 'text'
715           subject: '{branch}: vpp-dpdk-rdma-version-mismatch job failed!'
716           # yamllint disable-line rule:line-length
717           body: |
718               Build $BUILD_NUMBER of $JOB_NAME failed.
719               Check $BUILD_URL
720               console log to see if the job failed due to a package version mismatch or
721               a CI infra issue. If the failure was due to a CI infra issue, then
722               there is nothing else to be done.
723
724               However, if there was a package version mismatch, then the MLX driver
725               is NOT being built in the VPP DPDK library. Please push a gerrit change
726               with the updated package version(s) in the version matrix file, resolve
727               any build issues, and merge the change to re-enable the building of the
728               MLX DPDK driver in the VPP DPDK library.
729
730               Thanks,
731               The VPP Build Maintainers
732
733           failure: true
734           success: false
735
736 - publisher:
737     name: email-notification
738     publishers:
739       - email-ext:
740           recipients: 'nobody@projectrotterdam.info'
741           reply-to: ''
742           content-type: default
743           # yamllint disable-line rule:line-length
744           subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
745           body: |
746               $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
747
748               Check console output at $BUILD_URL to view the results.
749           unstable: true
750           fixed: true
751           send-to:
752             - developers
753             - recipients
754
755 - publisher:
756     name: fdio-infra-publish-docs
757     # macro to finish up a build.
758     #
759     # Handles the following:
760     #   - Shipping docs S3 logs repository
761     #   - Cleanup workspace
762     publishers:
763       - postbuildscript:
764           builders:
765             - role: BOTH
766               build-on:
767                 - ABORTED
768                 - FAILURE
769                 - NOT_BUILT
770                 - SUCCESS
771                 - UNSTABLE
772               build-steps:
773                 - fdio-infra-ship-docs
774           mark-unstable-if-failed: true
775       - workspace-cleanup:
776           exclude:
777             # Do not clean up *.jenkins-trigger files for jobs that use a
778             # properties file as input for triggering another build.
779             - "**/*.jenkins-trigger"
780           fail-build: false
781
782 - publisher:
783     name: fdio-infra-publish
784     # macro to finish up a build.
785     #
786     # Handles the following:
787     #   - Shipping logs to S3 logs repository
788     #   - Cleanup workspace
789     publishers:
790       - postbuildscript:
791           builders:
792             - role: BOTH
793               build-on:
794                 - ABORTED
795                 - FAILURE
796                 - NOT_BUILT
797                 - SUCCESS
798                 - UNSTABLE
799               build-steps:
800                 - shell: !include-raw: scripts/post_build_executor_info.sh
801                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
802                 - fdio-infra-ship-logs
803           mark-unstable-if-failed: true
804       - workspace-cleanup:
805           exclude:
806             # Do not clean up *.jenkins-trigger files for jobs that use a
807             # properties file as input for triggering another build.
808             - "**/*.jenkins-trigger"
809           fail-build: false
810
811 - publisher:
812     name: jacoco-report
813     publishers:
814       - jacoco:
815           exec-pattern: '**/**.exec'
816           class-pattern: '**/classes'
817           source-pattern: '**/src/main/java'
818           # yamllint disable-line rule:line-length
819           exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
820           status-update: true
821           targets:
822             - branch:
823               healthy: 10
824               unhealthy: 20
825             - method:
826               healthy: 50
827               unhealthy: 40
828
829 - publisher:
830     name: retry-build-on-builder-error
831     publishers:
832       - naginator:
833           max-failed-builds: 1
834
835 - publisher:
836     name: robot-report
837     publishers:
838       - robot:
839           output-path: '{output-path}'
840           other-files: ''
841
842 # [end] Keep 'publisher' entries ordered alphabetically, please.
843
844 #### BUILDERS
845 # Keep 'builder' entries ordered alphabetically, please.
846 - builder:
847     name: ci-management-check-unicode
848     builders:
849       - shell: |
850           $WORKSPACE/scripts/check-unicode.sh jjb/
851
852 - builder:
853     name: fdio-infra-ship-docs
854     builders:
855       - config-file-provider:
856           files:
857             - file-id: "jenkins-s3-docs-ship"
858               target: $HOME/.aws/credentials
859       - shell: !include-raw:
860           - scripts/terraform_s3_docs_ship.sh
861       - shell: !include-raw:
862           - scripts/publish_docs.sh
863       - shell: !include-raw:
864           - ../global-jjb/shell/logs-clear-credentials.sh
865
866 - builder:
867     name: fdio-infra-ship-logs
868     builders:
869       - config-file-provider:
870           files:
871             - file-id: "jenkins-s3-log-ship"
872               target: $HOME/.aws/credentials
873       - shell: !include-raw:
874           - scripts/publish_library_py.sh
875       - shell: !include-raw:
876           - scripts/publish_logs.sh
877       - shell: !include-raw:
878           - ../global-jjb/shell/logs-clear-credentials.sh
879       - description-setter:
880           regexp: "(^S3 build logs: .*)"
881
882 - builder:
883     name: packer-validate
884     builders:
885       - config-file-provider:
886           files:
887             - file-id: 'packer-cloud-env'
888               variable: 'CLOUDENV'
889       # yamllint disable rule:line-length
890       - shell: |
891           #!/bin/bash
892           cd packer
893           varfiles="../packer/vars/*"
894           templates="../packer/templates/*"
895           provision="../packer/provision/*.sh"
896           for v in $varfiles; do
897               [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
898               for t in $templates; do
899                   export PACKER_LOG="yes" && \
900                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
901                               packer.io validate -var-file=$CLOUDENV \
902                               -var-file=$v $t
903                   if [ $? -ne 0 ]; then
904                      break
905                   fi
906               done
907           done
908           for p in $provision; do
909               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
910               if [ $? -ne 0 ]; then
911                  break
912               fi
913           done
914       # yamllint enable
915
916 - builder:
917     name: packer-build
918     builders:
919       - config-file-provider:
920           files:
921             - file-id: 'packer-cloud-env'
922               variable: 'CLOUDENV'
923       - shell: |
924           #!/bin/bash
925           cd packer
926           export PACKER_LOG="yes" && \
927           export PACKER_LOG_PATH="packer-build.log" && \
928                       packer.io build -var-file=$CLOUDENV \
929                       -var-file=../packer/vars/{platform}.json \
930                       ../packer/templates/{template}.json
931
932 - builder:
933     name: provide-maven-settings
934     builders:
935       - config-file-provider:
936           files:
937             - file-id: '{global-settings-file}'
938               variable: 'GLOBAL_SETTINGS_FILE'
939             - file-id: '{settings-file}'
940               variable: 'SETTINGS_FILE'
941 # [end] Keep 'builder' entries ordered alphabetically, please.