1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # Keep 'parameter' entries ordered alphabetically, please.
25 description: "Architecture parameter"
28 name: archive-artifacts-parameter
31 name: ARCHIVE_ARTIFACTS
32 default: '{artifacts}'
33 description: "Artifacts to archive on the log server."
36 name: compiler-parameter
41 description: "CC parameter, can be gnu or clang"
44 name: make-parallel-jobs-parameter
47 name: MAKE_PARALLEL_JOBS
48 default: '{make-parallel-jobs}'
49 description: "The number of cores to use for builds."
52 name: csit-fail-on-crc-mismatch-parameter
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."
60 name: csit-perf-trial-duration-parameter
63 name: CSIT_PERF_TRIAL_DURATION
64 default: "{csit-perf-trial-duration}"
65 description: "Duration of a trial measurement in BMRR tests."
68 name: csit-perf-trial-multiplicity-parameter
71 name: CSIT_PERF_TRIAL_MULTIPLICITY
72 default: "{csit-perf-trial-multiplicity}"
73 description: "Number of subsamples for BMRR tests."
76 name: gerrit-csit-refspec-parameter
81 # yamllint disable-line rule:line-length
82 description: "GERRIT_REFSPEC parameter to override separately cloned CSIT repository, leave empty for autodetection / no override."
85 name: gerrit-event-comment-text-parameter
88 name: GERRIT_EVENT_COMMENT_TEXT
90 # yamllint disable-line rule:line-length
91 description: "GERRIT_EVENT_COMMENT_TEXT parameter not given by trigger"
94 name: gerrit-event-type-parameter
97 name: GERRIT_EVENT_TYPE
99 description: "GERRIT_EVENT_TYPE parameter not given by trigger"
102 name: gerrit-parameter
107 description: "JJB configured GERRIT_BRANCH parameter"
110 name: gerrit-project-parameter
115 description: "GERRIT_PROJECT parameter if not given by trigger"
118 name: gerrit-refspec-parameter
123 description: "GERRIT_REFSPEC parameter not given by trigger"
126 name: is-csit-vpp-job-parameter
129 name: IS_CSIT_VPP_JOB
130 default: '{is-csit-vpp-job}'
131 description: "Parameter is True if this is a CSIT vpp job."
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'
143 name: maven-project-parameter
148 description: 'Maven selector to be used by shell scripts'
156 description: "mode parameter to be used in shell scripts."
164 description: "OS parameter"
167 name: project-parameter
172 # yamllint disable-line rule:line-length
173 description: "JJB configured PROJECT parameter to identify a Gerrit project"
176 name: repo-name-parameter
180 default: '{repo-name}'
181 description: 'Name of repo to which to publish packaging'
184 name: stream-parameter
189 description: "Stream job parameter to be used in shell scripts."
197 description: "Topology parameter"
200 name: workspace-archive-artifacts-parameter
203 name: WS_ARCHIVE_ARTIFACTS
204 default: '{artifacts}'
205 description: "Artifacts to archive in $WORKSPACE/archives."
206 # [end] Keep 'parameter' entries ordered alphabetically, please.
209 # Keep 'scm' entries ordered alphabetically, please.
211 name: gerrit-trigger-scm
214 credentials-id: '{credentials-id}'
218 - 'origin/$GERRIT_BRANCH'
220 choosing-strategy: '{choosing-strategy}'
223 name: gerrit-trigger-scm-recursive
226 credentials-id: '{credentials-id}'
230 - 'origin/$GERRIT_BRANCH'
232 choosing-strategy: '{choosing-strategy}'
234 recursive: '{submodule-recursive}'
240 credentials-id: '{credentials-id}'
247 # [end] Keep 'scm' entries ordered alphabetically, please.
250 # Keep 'wrapper' entries ordered alphabetically, please.
260 # This wrapper is required for all jobs as it configures the wrappers
261 # needed by the fd.io infra.
262 name: fdio-infra-wrappers
266 timeout: '{build-timeout}'
267 timeout-var: 'BUILD_TIMEOUT'
270 - ssh-agent-credentials:
272 - 'jenkins-gerrit-credentials'
279 # This wrapper is used for all jobs that require no-activity timeouts
280 name: fdio-infra-wrappers-non-activity-timeout
284 timeout: '{build-timeout}'
287 - ssh-agent-credentials:
289 - 'jenkins-gerrit-credentials'
294 # [end] Keep 'wrapper' entries ordered alphabetically, please.
297 # Keep 'trigger' entries ordered alphabetically, please.
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.
304 server-name: 'Primary'
306 - comment-added-contains-event:
307 comment-contains-value: 'checkstyle_success'
309 - project-compare-type: 'ANT'
310 project-pattern: '{name}'
312 - branch-compare-type: 'ANT'
313 branch-pattern: '**/{branch}'
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.
321 server-name: 'Primary'
323 - comment-added-contains-event:
324 comment-contains-value: 'checkstyle_success'
326 - project-compare-type: 'ANT'
327 project-pattern: '{name}'
329 - branch-compare-type: 'ANT'
330 branch-pattern: '**/{branch}'
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
343 name: gerrit-trigger-csit-perftest
344 # Manual trigger common for csit-vpp and vpp-csit perf jobs.
347 server-name: 'Primary'
349 - comment-added-contains-event:
350 comment-contains-value: '{trigger-word}'
352 - project-compare-type: 'ANT'
353 project-pattern: '{project}'
355 - branch-compare-type: 'ANT'
356 branch-pattern: '**/{branch}'
358 successful: '{skip-vote}'
359 failed: '{skip-vote}'
360 unstable: '{skip-vote}'
361 notbuilt: '{skip-vote}'
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.
369 server-name: 'Primary'
371 - patchset-created-event:
372 exclude-drafts: 'true'
373 exclude-trivial-rebase: 'false'
374 exclude-no-code-change: 'false'
375 - draft-published-event
376 - comment-added-contains-event:
377 comment-contains-value: 'recheck'
378 - comment-added-contains-event:
379 comment-contains-value: 'reverify'
380 - comment-added-contains-event:
381 comment-contains-value: 'csit-devicetest'
383 - project-compare-type: 'ANT'
384 project-pattern: '{project}'
386 - branch-compare-type: 'ANT'
387 branch-pattern: '**/{branch}'
389 successful: '{skip-vote}'
390 failed: '{skip-vote}'
391 unstable: '{skip-vote}'
392 notbuilt: '{skip-vote}'
395 name: gerrit-trigger-csit-vpp-devicetest-manual
396 # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
397 # The job acts as a manual (optional) verify job for CSIT contributions.
400 server-name: 'Primary'
402 - comment-added-contains-event:
403 comment-contains-value: 'csit-devicetest'
405 - project-compare-type: 'ANT'
406 project-pattern: '{project}'
408 - branch-compare-type: 'ANT'
409 branch-pattern: '**/{branch}'
411 successful: '{skip-vote}'
412 failed: '{skip-vote}'
413 unstable: '{skip-vote}'
414 notbuilt: '{skip-vote}'
417 name: gerrit-trigger-manually-triggered
420 server-name: 'Primary'
422 - comment-added-contains-event:
423 comment-contains-value: '{comment-trigger-value}'
425 - project-compare-type: 'ANT'
426 project-pattern: '{name}'
428 - branch-compare-type: 'ANT'
429 branch-pattern: '**/{branch}'
432 name: gerrit-trigger-patch-merged
435 server-name: 'Primary'
437 - change-merged-event
438 - comment-added-contains-event:
439 comment-contains-value: 'remerge'
441 - project-compare-type: 'ANT'
442 project-pattern: '{name}'
444 - branch-compare-type: 'ANT'
445 branch-pattern: '**/{branch}'
446 # Force Jenkins always vote the values it should already have voted
447 # during the prior verify phase
449 gerrit-build-started-verified-value: 1
450 gerrit-build-successful-verified-value: 1
451 gerrit-build-failed-verified-value: 1
452 gerrit-build-unstable-verified-value: 1
453 gerrit-build-notbuilt-verified-value: 1
454 gerrit-build-started-codereview-value: 0
455 gerrit-build-successful-codereview-value: 0
456 gerrit-build-failed-codereview-value: 0
457 gerrit-build-unstable-codereview-value: 0
458 gerrit-build-notbuilt-codereview-value: 0
461 name: gerrit-trigger-patch-submitted
464 server-name: 'Primary'
466 - patchset-created-event:
467 exclude-drafts: 'true'
468 exclude-trivial-rebase: 'false'
469 exclude-no-code-change: 'false'
470 - draft-published-event
471 - comment-added-contains-event:
472 comment-contains-value: 'recheck'
473 - comment-added-contains-event:
474 comment-contains-value: 'reverify'
476 - project-compare-type: 'ANT'
477 project-pattern: '{name}'
479 - branch-compare-type: 'ANT'
480 branch-pattern: '**/{branch}'
483 name: gerrit-trigger-os-patch-merged
486 server-name: 'Primary'
488 - comment-added-contains-event:
489 comment-contains-value: 'os-merge'
491 - project-compare-type: 'ANT'
492 project-pattern: '{name}'
494 - branch-compare-type: 'ANT'
495 branch-pattern: '**/{branch}'
496 # Force Jenkins always vote the values it should already have voted
497 # during the prior verify phase
499 gerrit-build-started-verified-value: 1
500 gerrit-build-successful-verified-value: 1
501 gerrit-build-failed-verified-value: 1
502 gerrit-build-unstable-verified-value: 1
503 gerrit-build-notbuilt-verified-value: 1
504 gerrit-build-started-codereview-value: 0
505 gerrit-build-successful-codereview-value: 0
506 gerrit-build-failed-codereview-value: 0
507 gerrit-build-unstable-codereview-value: 0
508 gerrit-build-notbuilt-codereview-value: 0
511 name: gerrit-trigger-os-trivial-patch-submitted
514 server-name: 'Primary'
516 - comment-added-contains-event:
517 comment-contains-value: 'os-check'
518 - comment-added-contains-event:
519 comment-contains-value: 'os-verify'
521 - project-compare-type: 'ANT'
522 project-pattern: '{name}'
524 - branch-compare-type: 'ANT'
525 branch-pattern: '**/{branch}'
528 name: gerrit-trigger-trivial-patch-submitted
531 server-name: 'Primary'
533 - patchset-created-event:
534 exclude-drafts: 'true'
535 exclude-trivial-rebase: 'false'
536 exclude-no-code-change: 'true'
537 - draft-published-event
538 - comment-added-contains-event:
539 comment-contains-value: 'recheck'
540 - comment-added-contains-event:
541 comment-contains-value: 'reverify'
543 - project-compare-type: 'ANT'
544 project-pattern: '{name}'
546 - branch-compare-type: 'ANT'
547 branch-pattern: '**/{branch}'
550 name: gerrit-trigger-trivial-patch-submitted-skip-vote
553 server-name: 'Primary'
555 - patchset-created-event:
556 exclude-drafts: 'true'
557 exclude-trivial-rebase: 'false'
558 exclude-no-code-change: 'true'
559 - draft-published-event
560 - comment-added-contains-event:
561 comment-contains-value: 'recheck'
562 - comment-added-contains-event:
563 comment-contains-value: 'reverify'
565 - project-compare-type: 'ANT'
566 project-pattern: '{name}'
568 - branch-compare-type: 'ANT'
569 branch-pattern: '**/{branch}'
577 name: gerrit-trigger-vpp-csit-devicetest-full
578 # Comes from VPP, for automated jobs running "device" tests with CSIT code.
579 # The job acts as an automatic verify job for VPP contributions.
582 server-name: 'Primary'
584 - comment-added-contains-event:
585 comment-contains-value: 'checkstyle_success'
586 - comment-added-contains-event:
587 comment-contains-value: 'devicetest'
589 - project-compare-type: 'ANT'
590 project-pattern: '{name}'
592 - branch-compare-type: 'ANT'
593 branch-pattern: '**/{branch}'
595 successful: '{skip-vote}'
596 failed: '{skip-vote}'
597 unstable: '{skip-vote}'
598 notbuilt: '{skip-vote}'
601 name: gerrit-trigger-vpp-csit-devicetest-manual
602 # Comes from VPP, for manual jobs running "device" tests with CSIT code.
603 # The job acts as a manual (optional) verify job for VPP contributions.
606 server-name: 'Primary'
608 - comment-added-contains-event:
609 comment-contains-value: 'devicetest'
611 - project-compare-type: 'ANT'
612 project-pattern: '{name}'
614 - branch-compare-type: 'ANT'
615 branch-pattern: '**/{branch}'
617 successful: '{skip-vote}'
618 failed: '{skip-vote}'
619 unstable: '{skip-vote}'
620 notbuilt: '{skip-vote}'
621 # [end] Keep 'trigger' entries ordered alphabetically, please.
624 # Keep 'publisher' entries ordered alphabetically, please.
626 name: archive-artifacts
629 artifacts: '{artifacts}'
635 name: email-notification
638 recipients: 'nobody@projectrotterdam.info'
640 content-type: default
641 # yamllint disable-line rule:line-length
642 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
644 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
646 Check console output at $BUILD_URL to view the results.
654 name: fdio-infra-publish
655 # macro to finish up a build.
657 # Handles the following:
658 # - Shipping logs to Nexus or S3 logs repository
659 # - Cleanup workspace
671 - shell: !include-raw: scripts/post_build_deploy_archives.sh
672 - fdio-infra-ship-logs
673 mark-unstable-if-failed: true
676 # Do not clean up *.jenkins-trigger files for jobs that use a
677 # properties file as input for triggering another build.
678 - "**/*.jenkins-trigger"
682 name: fdio-infra-shiplogs
683 # To archive things, the job will need to create an "archives" directory in
684 # the workspace and this macro will handle copying the contents of the
685 # archives directory.
687 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
688 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
689 # the archive pattern. This is a space separated list of files to archive.
691 # Also ensure that the workspace is cleaned up at the end of the build.
703 - shell: !include-raw: include-raw-deploy-archives.sh
705 maven-version: '{maven-version}'
706 pom: '.archives/deploy-archives.xml'
707 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
708 settings: 'jenkins-log-archives-settings'
710 global-settings: 'global-settings'
711 global-settings-type: cfp
712 - description-setter:
713 regexp: '^Build logs: .*'
714 mark-unstable-if-failed: true
722 exec-pattern: '**/**.exec'
723 class-pattern: '**/classes'
724 source-pattern: '**/src/main/java'
725 # yamllint disable-line rule:line-length
726 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
737 name: retry-build-on-builder-error
746 output-path: '{output-path}'
748 # [end] Keep 'publisher' entries ordered alphabetically, please.
751 # Keep 'builder' entries ordered alphabetically, please.
753 name: ci-management-check-unicode
756 $WORKSPACE/scripts/check-unicode.sh jjb/
759 name: fdio-infra-properties
762 days-to-keep: '{build-days-to-keep}'
763 num-to-keep: '{build-num-to-keep}'
766 name: fdio-infra-ship-logs
768 # Ensure no pre-existing .netrc files are overriding logs config
769 - lf-provide-maven-settings-cleanup
770 - config-file-provider:
772 - file-id: "jenkins-log-archives-settings"
773 variable: "SETTINGS_FILE"
775 condition-kind: regex-match
776 regex: "^.*logs-s3.*"
778 on-evaluation-failure: dont-run
780 - config-file-provider:
782 - file-id: "jenkins-s3-log-ship"
783 target: $HOME/.aws/credentials
784 - lf-infra-create-netrc:
786 - shell: !include-raw:
787 - ../global-jjb/shell/logs-deploy.sh
788 - shell: !include-raw:
789 - ../global-jjb/shell/logs-clear-credentials.sh
790 - description-setter:
791 regexp: "(^(Nexus|S3) build logs: .*)"
794 name: packer-validate
796 - config-file-provider:
798 - file-id: 'packer-cloud-env'
800 # yamllint disable rule:line-length
804 varfiles="../packer/vars/*"
805 templates="../packer/templates/*"
806 provision="../packer/provision/*.sh"
807 for v in $varfiles; do
808 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
809 for t in $templates; do
810 export PACKER_LOG="yes" && \
811 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
812 packer.io validate -var-file=$CLOUDENV \
814 if [ $? -ne 0 ]; then
819 for p in $provision; do
820 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
821 if [ $? -ne 0 ]; then
830 - config-file-provider:
832 - file-id: 'packer-cloud-env'
837 export PACKER_LOG="yes" && \
838 export PACKER_LOG_PATH="packer-build.log" && \
839 packer.io build -var-file=$CLOUDENV \
840 -var-file=../packer/vars/{platform}.json \
841 ../packer/templates/{template}.json
844 name: provide-maven-settings
846 - config-file-provider:
848 - file-id: '{global-settings-file}'
849 variable: 'GLOBAL_SETTINGS_FILE'
850 - file-id: '{settings-file}'
851 variable: 'SETTINGS_FILE'
852 # [end] Keep 'builder' entries ordered alphabetically, please.