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.
19 name: project-parameter
24 # yamllint disable-line rule:line-length
25 description: "JJB configured PROJECT parameter to identify a Gerrit project"
28 name: gerrit-parameter
33 description: "JJB configured GERRIT_BRANCH parameter"
36 name: gerrit-project-parameter
41 description: "GERRIT_PROJECT parameter if not given by trigger"
49 description: "OS parameter"
52 name: gerrit-refspec-parameter
57 description: "GERRIT_REFSPEC parameter not given by trigger"
60 name: maven-project-parameter
65 description: 'Maven selector to be used by shell scripts'
72 # yamllint disable-line rule:line-length
73 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
74 description: 'Maven selector to be used by shell scripts'
77 name: repo-name-parameter
81 default: '{repo-name}'
82 description: 'Name of repo to which to publish packaging'
85 name: compiler-parameter
90 description: "CC parameter, can be gnu or clang"
93 name: is-csit-vpp-job-parameter
97 default: '{is-csit-vpp-job}'
98 description: "Parameter is True if this is a CSIT vpp job."
101 name: stream-parameter
106 description: "Stream job parameter to be used in shell scripts."
114 description: "Topology parameter"
122 description: "Architecture parameter"
125 name: csit-fail-on-crc-mismatch-parameter
128 name: FDIO_CSIT_FAIL_ON_CRC_MISMATCH
129 default: '{fail-on-crc-mismatch}'
130 description: "If true, CRC is checked, else compatibility is tested."
133 name: gerrit-event-type-parameter
136 name: GERRIT_EVENT_TYPE
138 description: "GERRIT_EVENT_TYPE parameter not given by trigger"
141 name: gerrit-event-comment-text-parameter
144 name: GERRIT_EVENT_COMMENT_TEXT
146 # yamllint disable-line rule:line-length
147 description: "GERRIT_EVENT_COMMENT_TEXT parameter not given by trigger"
150 name: gerrit-csit-refspec-parameter
155 # yamllint disable-line rule:line-length
156 description: "GERRIT_REFSPEC parameter to override separately cloned CSIT repository, leave empty for autodetection / no override."
159 name: csit-perf-trial-duration-parameter
162 name: CSIT_PERF_TRIAL_DURATION
163 default: "{csit-perf-trial-duration}"
164 description: "Duration of a trial measurement in BMRR tests."
167 name: csit-perf-trial-multiplicity-parameter
170 name: CSIT_PERF_TRIAL_MULTIPLICITY
171 default: "{csit-perf-trial-multiplicity}"
172 description: "Number of subsamples for BMRR tests."
179 credentials-id: '{credentials-id}'
188 name: gerrit-trigger-scm
191 credentials-id: '{credentials-id}'
195 - 'origin/$GERRIT_BRANCH'
197 choosing-strategy: '{choosing-strategy}'
200 name: gerrit-trigger-scm-recursive
203 credentials-id: '{credentials-id}'
207 - 'origin/$GERRIT_BRANCH'
209 choosing-strategy: '{choosing-strategy}'
211 recursive: '{submodule-recursive}'
223 # This wrapper is used for all jobs that require no-activity timeouts
224 name: fdio-infra-wrappers-non-activity-timeout
228 timeout: '{build-timeout}'
231 - ssh-agent-credentials:
233 - 'jenkins-gerrit-credentials'
240 # This wrapper is required for all jobs as it configures the wrappers
241 # needed by the fd.io infra.
242 name: fdio-infra-wrappers
246 timeout: '{build-timeout}'
247 timeout-var: 'BUILD_TIMEOUT'
250 - ssh-agent-credentials:
252 - 'jenkins-gerrit-credentials'
260 name: gerrit-trigger-patch-submitted
263 server-name: 'Primary'
265 - patchset-created-event:
266 exclude-drafts: 'true'
267 exclude-trivial-rebase: 'false'
268 exclude-no-code-change: 'false'
269 - draft-published-event
270 - comment-added-contains-event:
271 comment-contains-value: 'recheck'
272 - comment-added-contains-event:
273 comment-contains-value: 'reverify'
275 - project-compare-type: 'ANT'
276 project-pattern: '{name}'
278 - branch-compare-type: 'ANT'
279 branch-pattern: '**/{branch}'
282 name: gerrit-trigger-trivial-patch-submitted
285 server-name: 'Primary'
287 - patchset-created-event:
288 exclude-drafts: 'true'
289 exclude-trivial-rebase: 'false'
290 exclude-no-code-change: 'true'
291 - draft-published-event
292 - comment-added-contains-event:
293 comment-contains-value: 'recheck'
294 - comment-added-contains-event:
295 comment-contains-value: 'reverify'
297 - project-compare-type: 'ANT'
298 project-pattern: '{name}'
300 - branch-compare-type: 'ANT'
301 branch-pattern: '**/{branch}'
304 name: gerrit-trigger-os-trivial-patch-submitted
307 server-name: 'Primary'
309 - comment-added-contains-event:
310 comment-contains-value: 'os-check'
311 - comment-added-contains-event:
312 comment-contains-value: 'os-verify'
314 - project-compare-type: 'ANT'
315 project-pattern: '{name}'
317 - branch-compare-type: 'ANT'
318 branch-pattern: '**/{branch}'
321 name: gerrit-trigger-trivial-patch-submitted-skip-vote
324 server-name: 'Primary'
326 - patchset-created-event:
327 exclude-drafts: 'true'
328 exclude-trivial-rebase: 'false'
329 exclude-no-code-change: 'true'
330 - draft-published-event
331 - comment-added-contains-event:
332 comment-contains-value: 'recheck'
333 - comment-added-contains-event:
334 comment-contains-value: 'reverify'
336 - project-compare-type: 'ANT'
337 project-pattern: '{name}'
339 - branch-compare-type: 'ANT'
340 branch-pattern: '**/{branch}'
348 name: gerrit-trigger-manually-triggered
351 server-name: 'Primary'
353 - comment-added-contains-event:
354 comment-contains-value: '{comment-trigger-value}'
356 - project-compare-type: 'ANT'
357 project-pattern: '{name}'
359 - branch-compare-type: 'ANT'
360 branch-pattern: '**/{branch}'
363 name: gerrit-trigger-patch-merged
366 server-name: 'Primary'
368 - change-merged-event
369 - comment-added-contains-event:
370 comment-contains-value: 'remerge'
372 - project-compare-type: 'ANT'
373 project-pattern: '{name}'
375 - branch-compare-type: 'ANT'
376 branch-pattern: '**/{branch}'
377 # Force Jenkins always vote the values it should already have voted
378 # during the prior verify phase
380 gerrit-build-started-verified-value: 1
381 gerrit-build-successful-verified-value: 1
382 gerrit-build-failed-verified-value: 1
383 gerrit-build-unstable-verified-value: 1
384 gerrit-build-notbuilt-verified-value: 1
385 gerrit-build-started-codereview-value: 0
386 gerrit-build-successful-codereview-value: 0
387 gerrit-build-failed-codereview-value: 0
388 gerrit-build-unstable-codereview-value: 0
389 gerrit-build-notbuilt-codereview-value: 0
392 name: gerrit-trigger-os-patch-merged
395 server-name: 'Primary'
397 - comment-added-contains-event:
398 comment-contains-value: 'os-merge'
400 - project-compare-type: 'ANT'
401 project-pattern: '{name}'
403 - branch-compare-type: 'ANT'
404 branch-pattern: '**/{branch}'
405 # Force Jenkins always vote the values it should already have voted
406 # during the prior verify phase
408 gerrit-build-started-verified-value: 1
409 gerrit-build-successful-verified-value: 1
410 gerrit-build-failed-verified-value: 1
411 gerrit-build-unstable-verified-value: 1
412 gerrit-build-notbuilt-verified-value: 1
413 gerrit-build-started-codereview-value: 0
414 gerrit-build-successful-codereview-value: 0
415 gerrit-build-failed-codereview-value: 0
416 gerrit-build-unstable-codereview-value: 0
417 gerrit-build-notbuilt-codereview-value: 0
420 # Comes from VPP, some verify jobs wait for checkstyle to pass.
421 # This macro is to be used for such verify jobs which are voting.
422 name: gerrit-trigger-checkstyle
425 server-name: 'Primary'
427 - comment-added-contains-event:
428 comment-contains-value: 'checkstyle_success'
430 - project-compare-type: 'ANT'
431 project-pattern: '{name}'
433 - branch-compare-type: 'ANT'
434 branch-pattern: '**/{branch}'
437 # Comes from VPP, some verify jobs wait for checkstyle to pass.
438 # This macro is to be used for such verify jobs which are non-voting.
439 name: gerrit-trigger-checkstyle-nonvoting
442 server-name: 'Primary'
444 - comment-added-contains-event:
445 comment-contains-value: 'checkstyle_success'
447 - project-compare-type: 'ANT'
448 project-pattern: '{name}'
450 - branch-compare-type: 'ANT'
451 branch-pattern: '**/{branch}'
458 gerrit-build-successful-verified-value: 1
459 gerrit-build-failed-verified-value: 1
460 gerrit-build-unstable-verified-value: 1
461 gerrit-build-notbuilt-verified-value: 1
464 # Comes from VPP, for jobs that do performance testing using CSIT code.
465 name: gerrit-trigger-csit-perftest
468 server-name: 'Primary'
470 - comment-added-contains-event:
471 comment-contains-value: 'perftest-{node-arch}'
473 - project-compare-type: 'ANT'
474 project-pattern: '{name}'
476 - branch-compare-type: 'ANT'
477 branch-pattern: '**/{branch}'
485 # Comes from VPP, for automated jobs running "device" tests with CSIT code.
486 # The job acts as an automatic verify job for VPP contributions.
487 name: gerrit-trigger-vpp-csit-devicetest-full
490 server-name: 'Primary'
492 - comment-added-contains-event:
493 comment-contains-value: 'checkstyle_success'
494 - comment-added-contains-event:
495 comment-contains-value: 'devicetest'
497 - project-compare-type: 'ANT'
498 project-pattern: '{name}'
500 - branch-compare-type: 'ANT'
501 branch-pattern: '**/{branch}'
503 successful: '{skip-vote}'
504 failed: '{skip-vote}'
505 unstable: '{skip-vote}'
506 notbuilt: '{skip-vote}'
509 # Comes from VPP, for manual jobs running "device" tests with CSIT code.
510 # The job acts as a manual (optional) verify job for VPP contributions.
511 name: gerrit-trigger-vpp-csit-devicetest-manual
514 server-name: 'Primary'
516 - comment-added-contains-event:
517 comment-contains-value: 'devicetest'
519 - project-compare-type: 'ANT'
520 project-pattern: '{name}'
522 - branch-compare-type: 'ANT'
523 branch-pattern: '**/{branch}'
525 successful: '{skip-vote}'
526 failed: '{skip-vote}'
527 unstable: '{skip-vote}'
528 notbuilt: '{skip-vote}'
531 # Comes from CSIT, for automatic jobs running "device" tests with VPP builds.
532 # The job acts as an automatic verify job for CSIT contributions.
533 name: gerrit-trigger-csit-vpp-devicetest-full
536 server-name: 'Primary'
538 - patchset-created-event:
539 exclude-drafts: 'true'
540 exclude-trivial-rebase: 'false'
541 exclude-no-code-change: 'false'
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 - comment-added-contains-event:
548 comment-contains-value: 'csit-devicetest'
550 - project-compare-type: 'ANT'
551 project-pattern: '{project}'
553 - branch-compare-type: 'ANT'
554 branch-pattern: '**/{branch}'
556 successful: '{skip-vote}'
557 failed: '{skip-vote}'
558 unstable: '{skip-vote}'
559 notbuilt: '{skip-vote}'
562 # Comes from CSIT, for manual jobs running "device" tests with VPP builds.
563 # The job acts as a manual (optional) verify job for CSIT contributions.
564 name: gerrit-trigger-csit-vpp-devicetest-manual
567 server-name: 'Primary'
569 - comment-added-contains-event:
570 comment-contains-value: 'csit-devicetest'
572 - project-compare-type: 'ANT'
573 project-pattern: '{project}'
575 - branch-compare-type: 'ANT'
576 branch-pattern: '**/{branch}'
578 successful: '{skip-vote}'
579 failed: '{skip-vote}'
580 unstable: '{skip-vote}'
581 notbuilt: '{skip-vote}'
585 name: archive-artifacts
588 artifacts: '{artifacts}'
594 name: email-notification
597 recipients: 'nobody@projectrotterdam.info'
599 content-type: default
600 # yamllint disable-line rule:line-length
601 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
603 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
605 Check console output at $BUILD_URL to view the results.
616 exec-pattern: '**/**.exec'
617 class-pattern: '**/classes'
618 source-pattern: '**/src/main/java'
619 # yamllint disable-line rule:line-length
620 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
634 output-path: '{output-path}'
638 name: fdio-infra-shiplogs
639 # To archive things, the job will need to create an "archives" directory in
640 # the workspace and this macro will handle copying the contents of the
641 # archives directory.
643 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
644 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
645 # the archive pattern. This is a space separated list of files to archive.
647 # Also ensure that the workspace is cleaned up at the end of the build.
659 - shell: !include-raw: include-raw-deploy-archives.sh
661 maven-version: '{maven-version}'
662 pom: '.archives/deploy-archives.xml'
663 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
664 settings: 'jenkins-log-archives-settings'
666 global-settings: 'global-settings'
667 global-settings-type: cfp
668 - description-setter:
669 regexp: '^Build logs: .*'
670 mark-unstable-if-failed: true
675 name: retry-build-on-builder-error
682 name: ci-management-check-unicode
685 $WORKSPACE/scripts/check-unicode.sh jjb/
688 name: provide-maven-settings
690 - config-file-provider:
692 - file-id: '{global-settings-file}'
693 variable: 'GLOBAL_SETTINGS_FILE'
694 - file-id: '{settings-file}'
695 variable: 'SETTINGS_FILE'
698 name: fdio-infra-properties
701 days-to-keep: '{build-days-to-keep}'
702 num-to-keep: '{build-num-to-keep}'
706 name: packer-validate
708 - config-file-provider:
710 - file-id: 'packer-cloud-env'
712 # yamllint disable rule:line-length
716 varfiles="../packer/vars/*"
717 templates="../packer/templates/*"
718 provision="../packer/provision/*.sh"
719 for v in $varfiles; do
720 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
721 for t in $templates; do
722 export PACKER_LOG="yes" && \
723 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
724 packer.io validate -var-file=$CLOUDENV \
726 if [ $? -ne 0 ]; then
731 for p in $provision; do
732 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
733 if [ $? -ne 0 ]; then
742 - config-file-provider:
744 - file-id: 'packer-cloud-env'
749 export PACKER_LOG="yes" && \
750 export PACKER_LOG_PATH="packer-build.log" && \
751 packer.io build -var-file=$CLOUDENV \
752 -var-file=../packer/vars/{platform}.json \
753 ../packer/templates/{template}.json