4 # NOTE: make sure macros are listed in execution ordered.
6 # 1. parameters/properties
10 # 5. prebuilders (maven only, configured like Builders)
11 # 6. builders (maven, freestyle, matrix, etc..)
12 # 7. postbuilders (maven only, configured like Builders)
13 # 8. publishers/reporters/notifications
16 name: project-parameter
21 description: "JJB configured PROJECT parameter to identify an opnfv Gerrit project"
24 default: artifacts.opnfv.org/$PROJECT
25 description: "URL to Google Storage."
28 default: build.opnfv.org/artifacts.opnfv.org/$PROJECT
29 description: "URL to Google Storage proxy"
33 description: "JJB configured BRANCH parameter (e.g. master, stable/danube)"
37 description: "JJB configured GERRIT_BRANCH parameter (deprecated)"
40 default: 'refs/heads/{branch}'
41 description: "Default refspec needed for manually triggering."
44 # Reporting Deployment Results
46 # To report deployment results to
47 # http://testresults.opnfv.org/test/#/deployresults, add the following
48 # parameters, builders, and publishers to a deployment job:
54 # - track-begin-timestamp
57 # - report-provision-result
59 # Note: The following string parameter must also exist, as they are used
60 # when reporting the provision result:
66 # most installers include these but you should verify first before
67 # adding the publisher, otherwise the deployment build may be marked
72 name: testapi-parameter
76 default: 'http://testresults.opnfv.org/test/api/v1'
77 description: "Default TestAPI URL, currently using v1"
79 name: INSTALLER_VERSION
81 description: "Installer release version"
83 name: UPSTREAM_JOB_NAME
85 description: "Parent job name in Jenkins"
87 name: UPSTREAM_BUILD_ID
89 description: "Parent job build_id in Jenkins"
92 name: logrotate-default
97 artifact-days-to-keep: 60
98 artifact-num-to-keep: 200
103 - git: &git-scm-defaults
104 credentials-id: '$SSH_CREDENTIAL_ID'
121 choosing-strategy: 'gerrit'
122 refspec: '$GERRIT_REFSPEC'
123 <<: *git-scm-defaults
126 name: git-scm-gerrit-with-submodules
129 choosing-strategy: 'gerrit'
130 refspec: '$GERRIT_REFSPEC'
134 <<: *git-scm-defaults
136 name: git-scm-with-submodules
139 credentials-id: '$SSH_CREDENTIAL_ID'
143 - 'refs/heads/{branch}'
152 name: git-scm-openstack
154 - git: &git-scm-openstack-defaults
163 name: 'daily-trigger-disabled'
168 name: 'weekly-trigger-disabled'
173 name: gerrit-trigger-patchset-created
176 server-name: 'gerrit.opnfv.org'
178 - patchset-created-event:
179 exclude-drafts: 'false'
180 exclude-trivial-rebase: 'false'
181 exclude-no-code-change: 'false'
182 - draft-published-event
183 - comment-added-contains-event:
184 comment-contains-value: 'recheck'
185 - comment-added-contains-event:
186 comment-contains-value: 'reverify'
188 - project-compare-type: 'ANT'
189 project-pattern: '{project}'
191 - branch-compare-type: 'ANT'
192 branch-pattern: '**/{branch}'
194 - compare-type: 'ANT'
203 name: gerrit-trigger-patchset-approved
206 server-name: 'gerrit.opnfv.org'
208 - comment-added-event:
209 approval-category: 'CRVW'
211 - comment-added-contains-event:
212 comment-contains-value: 'gate'
214 - project-compare-type: 'ANT'
215 project-pattern: '{project}'
217 - branch-compare-type: 'ANT'
218 branch-pattern: '**/{branch}'
220 - compare-type: 'ANT'
229 name: gerrit-trigger-change-merged
232 server-name: 'gerrit.opnfv.org'
234 - change-merged-event
235 - comment-added-contains-event:
236 comment-contains-value: 'remerge'
238 - project-compare-type: 'ANT'
239 project-pattern: '{project}'
241 - branch-compare-type: 'ANT'
242 branch-pattern: '**/{branch}'
244 - compare-type: 'ANT'
248 name: gerrit-trigger-tag-created
251 server-name: 'gerrit.opnfv.org'
255 - project-compare-type: 'ANT'
256 project-pattern: '{project}'
258 - branch-compare-type: 'ANT'
259 branch-pattern: 'refs/tags/**'
265 server-name: 'gerrit.opnfv.org'
267 - comment-added-contains-event:
268 comment-contains-value: 'check-experimental'
270 - project-compare-type: 'ANT'
271 project-pattern: '{project}'
273 - branch-compare-type: 'ANT'
274 branch-pattern: '**/{branch}'
276 - compare-type: 'ANT'
285 name: ssh-agent-wrapper
287 - ssh-agent-credentials:
289 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
296 timeout-var: 'BUILD_TIMEOUT'
300 name: fix-workspace-permissions
305 sudo chown -R $USER:$USER $WORKSPACE || exit 1
308 name: upload-under-review-docs-to-opnfv-artifacts
315 export PATH=$PATH:/usr/local/bin/
317 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
318 [[ -d docs/_build/ ]] || exit 0
321 echo "###########################"
322 echo "UPLOADING DOCS UNDER REVIEW"
323 echo "###########################"
326 gs_base="artifacts.opnfv.org/$PROJECT/review"
327 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
328 local_path="upload/$GERRIT_CHANGE_NUMBER"
331 mv docs/_build/html/ "$local_path"
332 gsutil -m cp -r "$local_path" "gs://$gs_base"
335 -h "Content-Type:text/html" \
336 -h "Cache-Control:private, max-age=0, no-transform" \
337 "gs://$gs_path"/**.html > /dev/null 2>&1
339 echo "Document link(s):" >> gerrit_comment.txt
340 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
341 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
343 # To take advantage of this macro, have your build write
344 # out the file 'gerrit_comment.txt' with information to post
345 # back to gerrit and include this macro in the list of builders.
347 name: report-build-result-to-gerrit
354 export PATH=$PATH:/usr/local/bin/
355 if [[ -e gerrit_comment.txt ]] ; then
357 echo "posting review comment to gerrit..."
359 cat gerrit_comment.txt
361 ssh -p 29418 gerrit.opnfv.org \
362 "gerrit review -p $GERRIT_PROJECT \
363 -m '$(cat gerrit_comment.txt)' \
364 $GERRIT_PATCHSET_REVISION \
369 name: remove-old-docs-from-opnfv-artifacts
376 export PATH=$PATH:/usr/local/bin/
378 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
380 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
382 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
384 echo "Deleting Out-of-dated Documents..."
385 gsutil -m rm -r "gs://$gs_path"
387 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
389 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
391 echo "Deleting Out-of-dated Documents..."
392 gsutil -m rm -r "gs://$gs_path"
396 name: upload-review-docs
398 - upload-under-review-docs-to-opnfv-artifacts
399 - report-build-result-to-gerrit
406 # Ensure we start with a clean environment
407 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
408 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
415 if [[ -s violation.log ]]; then
417 echo "Reporting lint result...."
419 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
420 sed -i -e "1s#^#${msg}\n\n#" violation.log
421 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
422 ssh -p 29418 gerrit.opnfv.org "$cmd"
424 # Make sure the caller job failed
433 echo "Checking bash code..."
434 for f in $(egrep '\.sh$' modified_files)
436 bash -n "$f" 2>> bash-violation.log
438 if [[ -s bash-violation.log ]]; then
439 echo -e "Bash syntax error(s)\n---" >> violation.log
440 sed -e 's/^/ /g' bash-violation.log >> violation.log
444 name: lint-python-code
448 # Install python package
449 sudo -H pip install "flake8==2.6.2"
451 echo "Checking python code..."
452 for f in $(egrep '\.py$' modified_files)
454 flake8 "$f" >> python-violation.log
456 if [[ -s python-violation.log ]]; then
457 echo -e "Python violation(s)\n---" >> violation.log
458 sed -e 's/^/ /g' python-violation.log >> violation.log
466 # sudo Install python packages
467 sudo -H pip install "yamllint==1.8.2"
469 echo "Checking yaml file..."
470 for f in $(egrep '\.ya?ml$' modified_files)
472 yamllint "$f" >> yaml-violation.log
474 if [[ -s yaml-violation.log ]]; then
475 echo -e "YAML violation(s)\n---" >> violation.log
476 sed -e 's/^/ /g' yaml-violation.log >> violation.log
489 name: clean-workspace
496 sudo /bin/rm -rf "$WORKSPACE"
499 name: clean-workspace-log
502 find $WORKSPACE -type f -name '*.log' | xargs rm -f
505 name: track-begin-timestamp
508 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
511 name: archive-artifacts
514 artifacts: '{artifacts}'
520 name: publish-coverage
523 report-file: "coverage.xml"
525 health-auto-update: "false"
526 stability-auto-update: "false"
527 zoom-coverage-chart: "true"
538 # The majority of the email-ext plugin options are set to the default
539 # for this macro so they can be managed through Jenkins' global
542 name: email-jenkins-admins-on-failure
546 attach-build-log: true
553 # Email PTL publishers
554 - email_ptl_defaults: &email_ptl_defaults
555 name: 'email_ptl_defaults'
557 attach-build-log: true
563 - publisher: &email_apex_ptl_defaults
564 name: 'email-apex-ptl'
567 <<: *email_ptl_defaults
571 name: 'email-apex-os-net-config-ptl'
572 <<: *email_apex_ptl_defaults
574 name: 'email-apex-puppet-tripleo-ptl'
575 <<: *email_apex_ptl_defaults
577 name: 'email-apex-tripleo-heat-templates-ptl'
578 <<: *email_apex_ptl_defaults
581 name: 'email-armband-ptl'
584 <<: *email_ptl_defaults
589 name: 'email-auto-ptl'
592 <<: *email_ptl_defaults
597 name: 'email-availability-ptl'
600 <<: *email_ptl_defaults
602 fuqiao@chinamobile.com
605 name: 'email-bamboo-ptl'
608 <<: *email_ptl_defaults
613 name: 'email-barometer-ptl'
616 <<: *email_ptl_defaults
621 name: 'email-bottlenecks-ptl'
624 <<: *email_ptl_defaults
626 gabriel.yuyang@huawei.com
629 name: 'email-calipso-ptl'
632 <<: *email_ptl_defaults
637 name: 'email-clover-ptl'
640 <<: *email_ptl_defaults
642 stephen.wong1@huawei.com
644 - publisher: &email_compass4nfv_ptl_defaults
645 name: 'email-compass4nfv-ptl'
648 <<: *email_ptl_defaults
652 name: 'email-compass-containers-ptl'
653 <<: *email_compass4nfv_ptl_defaults
656 name: 'email-conductor-ptl'
659 <<: *email_ptl_defaults
661 limingjiang@huawei.com
664 name: 'email-container4nfv-ptl'
667 <<: *email_ptl_defaults
669 jiaxuan@chinamobile.com
672 name: 'email-cperf-ptl'
675 <<: *email_ptl_defaults
680 name: 'email-daisy-ptl'
683 <<: *email_ptl_defaults
685 hu.zhijiang@zte.com.cn
688 name: 'email-doctor-ptl'
691 <<: *email_ptl_defaults
696 name: 'email-domino-ptl'
699 <<: *email_ptl_defaults
701 ulas.kozat@huawei.com
704 name: 'email-dovetail-ptl'
707 <<: *email_ptl_defaults
709 georg.kunz@ericsson.com
712 name: 'email-dpacc-ptl'
715 <<: *email_ptl_defaults
717 denglingli@chinamobile.com
720 name: 'email-enfv-ptl'
723 <<: *email_ptl_defaults
725 JBuchanan@advaoptical.com
728 name: 'email-fds-ptl'
731 <<: *email_ptl_defaults
736 name: 'email-fuel-ptl'
739 <<: *email_ptl_defaults
741 Alexandru.Avadanii@enea.com
744 name: 'email-functest-ptl'
747 <<: *email_ptl_defaults
749 cedric.ollivier@orange.com
752 name: 'email-ipv6-ptl'
755 <<: *email_ptl_defaults
760 name: 'email-joid-ptl'
763 <<: *email_ptl_defaults
765 artur.tyloch@canonical.com
768 name: 'email-kvmfornfv-ptl'
771 <<: *email_ptl_defaults
773 raghuveer.reddy@intel.com
776 name: 'email-models-ptl'
779 <<: *email_ptl_defaults
784 name: 'email-moon-ptl'
787 <<: *email_ptl_defaults
792 name: 'email-netready-ptl'
795 <<: *email_ptl_defaults
797 georg.kunz@ericsson.com
800 name: 'email-nfvbench-ptl'
803 <<: *email_ptl_defaults
808 name: 'email-onosfw-ptl'
811 <<: *email_ptl_defaults
816 name: 'email-opera-ptl'
819 <<: *email_ptl_defaults
821 Yingjun.li@huawei.com
824 name: 'email-opnfvdocs-ptl'
827 <<: *email_ptl_defaults
829 sofia.wallin@ericsson.com
832 name: 'email-orchestra-ptl'
835 <<: *email_ptl_defaults
837 giuseppe.carella@fokus.fraunhofer.de
840 name: 'email-ovn4nfv-ptl'
843 <<: *email_ptl_defaults
845 trinath.somanchi@gmail.com
848 name: 'email-ovno-ptl'
851 <<: *email_ptl_defaults
856 name: 'email-ovsnfv-ptl'
859 <<: *email_ptl_defaults
861 MarkD.Graymark.d.gray@intel.com
864 name: 'email-parser-ptl'
867 <<: *email_ptl_defaults
869 shang.xiaodong@zte.com.cn
871 - publisher: &email_pharos_ptl_defaults
872 name: 'email-pharos-ptl'
875 <<: *email_ptl_defaults
877 zhang.jun3g@zte.com.cn
879 name: 'email-pharos-tools-ptl'
880 <<: *email_pharos_ptl_defaults
883 name: 'email-promise-ptl'
886 <<: *email_ptl_defaults
888 kunzmann@docomolab-euro.com
891 name: 'email-qtip-ptl'
894 <<: *email_ptl_defaults
896 wu.zhihui1@zte.com.cn
898 - publisher: &email_releng_ptl_defaults
899 name: 'email-releng-ptl'
902 <<: *email_ptl_defaults
904 tbramwell@linuxfoundation.org
906 name: 'email-releng-anteater-ptl'
907 <<: *email_releng_ptl_defaults
909 name: 'email-releng-testresults-ptl'
912 <<: *email_ptl_defaults
914 fatih.degirmenci@ericsson.com
915 feng.xiaowei@zte.com.cn
917 name: 'email-releng-utils-ptl'
918 <<: *email_releng_ptl_defaults
920 name: 'email-releng-xci-ptl'
923 <<: *email_ptl_defaults
925 fatih.degirmenci@ericsson.com
928 name: 'email-samplevnf-ptl'
931 <<: *email_ptl_defaults
936 name: 'email-sdnvpn-ptl'
939 <<: *email_ptl_defaults
941 tim.irnich@ericsson.com
944 name: 'email-securityscanning-ptl'
947 <<: *email_ptl_defaults
952 name: 'email-sfc-ptl'
955 <<: *email_ptl_defaults
960 name: 'email-snaps-ptl'
963 <<: *email_ptl_defaults
965 s.pisarski@cablelabs.com
968 name: 'email-stor4nfv-ptl'
971 <<: *email_ptl_defaults
976 name: 'email-storperf-ptl'
979 <<: *email_ptl_defaults
984 name: 'email-ves-ptl'
987 <<: *email_ptl_defaults
989 bryan.sullivan@att.com
992 name: 'email-vswitchperf-ptl'
995 <<: *email_ptl_defaults
997 sridhar.rao@spirent.com
1000 name: 'email-yardstick-ptl'
1003 <<: *email_ptl_defaults
1005 ross.b.brattain@intel.com
1008 name: 'report-provision-result'
1017 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
1018 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1019 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1021 !include-raw: installer-report.sh
1022 mark-unstable-if-failed: true
1033 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1034 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1035 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1037 !include-raw: installer-report.sh
1038 mark-unstable-if-failed: true