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 name: logrotate-default
49 artifact-days-to-keep: 60
50 artifact-num-to-keep: 200
55 - git: &git-scm-defaults
56 credentials-id: '$SSH_CREDENTIAL_ID'
66 choosing-strategy: 'gerrit'
67 refspec: '$GERRIT_REFSPEC'
70 name: git-scm-with-submodules
73 credentials-id: '$SSH_CREDENTIAL_ID'
77 - 'refs/heads/{branch}'
85 name: git-scm-openstack
87 - git: &git-scm-openstack-defaults
94 name: 'daily-trigger-disabled'
99 name: 'weekly-trigger-disabled'
104 name: gerrit-trigger-patchset-created
107 server-name: 'gerrit.opnfv.org'
109 - patchset-created-event:
110 exclude-drafts: 'false'
111 exclude-trivial-rebase: 'false'
112 exclude-no-code-change: 'false'
113 - draft-published-event
114 - comment-added-contains-event:
115 comment-contains-value: 'recheck'
116 - comment-added-contains-event:
117 comment-contains-value: 'reverify'
119 - project-compare-type: 'ANT'
120 project-pattern: '{project}'
122 - branch-compare-type: 'ANT'
123 branch-pattern: '**/{branch}'
125 - compare-type: 'ANT'
134 name: gerrit-trigger-change-merged
137 server-name: 'gerrit.opnfv.org'
139 - change-merged-event
140 - comment-added-contains-event:
141 comment-contains-value: 'remerge'
143 - project-compare-type: 'ANT'
144 project-pattern: '{project}'
146 - branch-compare-type: 'ANT'
147 branch-pattern: '**/{branch}'
149 - compare-type: 'ANT'
153 name: gerrit-trigger-tag-created
156 server-name: 'gerrit.opnfv.org'
160 - project-compare-type: 'ANT'
161 project-pattern: '{project}'
163 - branch-compare-type: 'ANT'
164 branch-pattern: 'refs/tags/**'
170 server-name: 'gerrit.opnfv.org'
172 - comment-added-contains-event:
173 comment-contains-value: 'check-experimental'
175 - project-compare-type: 'ANT'
176 project-pattern: '{project}'
178 - branch-compare-type: 'ANT'
179 branch-pattern: '**/{branch}'
181 - compare-type: 'ANT'
190 name: ssh-agent-wrapper
192 - ssh-agent-credentials:
194 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
201 timeout-var: 'BUILD_TIMEOUT'
205 name: fix-workspace-permissions
210 sudo chown -R $USER:$USER $WORKSPACE || exit 1
213 name: upload-under-review-docs-to-opnfv-artifacts
220 export PATH=$PATH:/usr/local/bin/
222 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
223 [[ -d docs/_build/ ]] || exit 0
226 echo "###########################"
227 echo "UPLOADING DOCS UNDER REVIEW"
228 echo "###########################"
231 gs_base="artifacts.opnfv.org/$PROJECT/review"
232 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
233 local_path="upload/$GERRIT_CHANGE_NUMBER"
236 mv docs/_build/html/ "$local_path"
237 gsutil -m cp -r "$local_path" "gs://$gs_base"
240 -h "Content-Type:text/html" \
241 -h "Cache-Control:private, max-age=0, no-transform" \
242 "gs://$gs_path"/**.html > /dev/null 2>&1
244 echo "Document link(s):" >> gerrit_comment.txt
245 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
246 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
248 # To take advantage of this macro, have your build write
249 # out the file 'gerrit_comment.txt' with information to post
250 # back to gerrit and include this macro in the list of builders.
252 name: report-build-result-to-gerrit
259 export PATH=$PATH:/usr/local/bin/
260 if [[ -e gerrit_comment.txt ]] ; then
262 echo "posting review comment to gerrit..."
264 cat gerrit_comment.txt
266 ssh -p 29418 gerrit.opnfv.org \
267 "gerrit review -p $GERRIT_PROJECT \
268 -m '$(cat gerrit_comment.txt)' \
269 $GERRIT_PATCHSET_REVISION \
274 name: remove-old-docs-from-opnfv-artifacts
281 export PATH=$PATH:/usr/local/bin/
283 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
285 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
287 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
289 echo "Deleting Out-of-dated Documents..."
290 gsutil -m rm -r "gs://$gs_path"
292 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
294 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
296 echo "Deleting Out-of-dated Documents..."
297 gsutil -m rm -r "gs://$gs_path"
301 name: upload-review-docs
303 - upload-under-review-docs-to-opnfv-artifacts
304 - report-build-result-to-gerrit
311 # Ensure we start with a clean environment
312 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
313 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
320 if [[ -s violation.log ]]; then
321 echo "Reporting lint result..."
322 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
323 sed -i -e '1s/^//$msg\n\n/' violation.log
324 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
325 ssh -p 29418 gerrit.opnfv.org "$cmd"
327 # Make sure the caller job failed
336 echo "Checking bash code..."
337 for f in $(egrep '\.sh$' modified_files)
339 bash -n "$f" 2>> bash-violation.log
341 if [[ -s bash-violation.log ]]; then
342 echo -e "Bash syntax error(s)\n---" >> violation.log
343 sed -e 's/^/ /g' bash-violation.log >> violation.log
347 name: lint-python-code
351 # Install python package
352 sudo pip install "flake8==2.6.2"
354 echo "Checking python code..."
355 for f in $(egrep '\.py$' modified_files)
357 flake8 "$f" >> python-violation.log
359 if [[ -s python-violation.log ]]; then
360 echo -e "Python violation(s)\n---" >> violation.log
361 sed -e 's/^/ /g' python-violation.log >> violation.log
369 # sudo Install python packages
370 sudo pip install "yamllint==1.8.2"
372 echo "Checking yaml file..."
373 for f in $(egrep '\.ya?ml$' modified_files)
375 yamllint "$f" >> yaml-violation.log
377 if [[ -s yaml-violation.log ]]; then
378 echo -e "YAML violation(s)\n---" >> violation.log
379 sed -e 's/^/ /g' yaml-violation.log >> violation.log
392 name: clean-workspace
399 sudo /bin/rm -rf "$WORKSPACE"
402 name: clean-workspace-log
405 find $WORKSPACE -type f -name '*.log' | xargs rm -f
408 name: track-begin-timestamp
411 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
414 name: archive-artifacts
417 artifacts: '{artifacts}'
423 name: publish-coverage
426 report-file: "coverage.xml"
428 health-auto-update: "false"
429 stability-auto-update: "false"
430 zoom-coverage-chart: "true"
441 # The majority of the email-ext plugin options are set to the default
442 # for this macro so they can be managed through Jenkins' global
445 name: email-jenkins-admins-on-failure
449 attach-build-log: true
456 # Email PTL publishers
457 - email_ptl_defaults: &email_ptl_defaults
458 name: 'email_ptl_defaults'
460 attach-build-log: true
466 - publisher: &email_apex_ptl_defaults
467 name: 'email-apex-ptl'
470 <<: *email_ptl_defaults
474 name: 'email-apex-os-net-config-ptl'
475 <<: *email_apex_ptl_defaults
477 name: 'email-apex-puppet-tripleo-ptl'
478 <<: *email_apex_ptl_defaults
480 name: 'email-apex-tripleo-heat-templates-ptl'
481 <<: *email_apex_ptl_defaults
484 name: 'email-armband-ptl'
487 <<: *email_ptl_defaults
492 name: 'email-auto-ptl'
495 <<: *email_ptl_defaults
500 name: 'email-availability-ptl'
503 <<: *email_ptl_defaults
505 fuqiao@chinamobile.com
508 name: 'email-bamboo-ptl'
511 <<: *email_ptl_defaults
516 name: 'email-barometer-ptl'
519 <<: *email_ptl_defaults
524 name: 'email-bottlenecks-ptl'
527 <<: *email_ptl_defaults
529 gabriel.yuyang@huawei.com
532 name: 'email-calipso-ptl'
535 <<: *email_ptl_defaults
540 name: 'email-clover-ptl'
543 <<: *email_ptl_defaults
545 stephen.wong1@huawei.com
547 - publisher: &email_compass4nfv_ptl_defaults
548 name: 'email-compass4nfv-ptl'
551 <<: *email_ptl_defaults
555 name: 'email-compass-containers-ptl'
556 <<: *email_compass4nfv_ptl_defaults
559 name: 'email-conductor-ptl'
562 <<: *email_ptl_defaults
564 limingjiang@huawei.com
567 name: 'email-container4nfv-ptl'
570 <<: *email_ptl_defaults
572 jiaxuan@chinamobile.com
575 name: 'email-copper-ptl'
578 <<: *email_ptl_defaults
580 aimeeu.opensource@gmail.com
583 name: 'email-cperf-ptl'
586 <<: *email_ptl_defaults
591 name: 'email-daisy-ptl'
594 <<: *email_ptl_defaults
596 hu.zhijiang@zte.com.cn
599 name: 'email-doctor-ptl'
602 <<: *email_ptl_defaults
607 name: 'email-domino-ptl'
610 <<: *email_ptl_defaults
612 ulas.kozat@huawei.com
615 name: 'email-dovetail-ptl'
618 <<: *email_ptl_defaults
620 hongbo.tianhongbo@huawei.com
623 name: 'email-dpacc-ptl'
626 <<: *email_ptl_defaults
628 denglingli@chinamobile.com
631 name: 'email-enfv-ptl'
634 <<: *email_ptl_defaults
636 JBuchanan@advaoptical.com
639 name: 'email-escalator-ptl'
642 <<: *email_ptl_defaults
647 name: 'email-fastpathmetrics-ptl'
650 <<: *email_ptl_defaults
652 maryam.tahhan@intel.com
655 name: 'email-fds-ptl'
658 <<: *email_ptl_defaults
663 name: 'email-fuel-ptl'
666 <<: *email_ptl_defaults
668 gelkinbard@mirantis.com
671 name: 'email-functest-ptl'
674 <<: *email_ptl_defaults
676 cedric.ollivier@orange.com
679 name: 'email-ipv6-ptl'
682 <<: *email_ptl_defaults
687 name: 'email-joid-ptl'
690 <<: *email_ptl_defaults
692 artur.tyloch@canonical.com
695 name: 'email-kvmfornfv-ptl'
698 <<: *email_ptl_defaults
700 raghuveer.reddy@intel.com
703 name: 'email-models-ptl'
706 <<: *email_ptl_defaults
711 name: 'email-moon-ptl'
714 <<: *email_ptl_defaults
719 name: 'email-multisite-ptl'
722 <<: *email_ptl_defaults
727 name: 'email-netready-ptl'
730 <<: *email_ptl_defaults
732 georg.kunz@ericsson.com
735 name: 'email-nfvbench-ptl'
738 <<: *email_ptl_defaults
743 name: 'email-octopus-ptl'
746 <<: *email_ptl_defaults
748 ulrich.kleber@huawei.com
751 name: 'email-onosfw-ptl'
754 <<: *email_ptl_defaults
759 name: 'email-openretriever-ptl'
762 <<: *email_ptl_defaults
764 jiaxuan@chinamobile.com
767 name: 'email-opera-ptl'
770 <<: *email_ptl_defaults
772 Yingjun.li@huawei.com
775 name: 'email-opnfvdocs-ptl'
778 <<: *email_ptl_defaults
780 sofia.wallin@ericsson.com
783 name: 'email-orchestra-ptl'
786 <<: *email_ptl_defaults
788 giuseppe.carella@fokus.fraunhofer.de
791 name: 'email-ovn4nfv-ptl'
794 <<: *email_ptl_defaults
796 trinath.somanchi@gmail.com
799 name: 'email-ovno-ptl'
802 <<: *email_ptl_defaults
807 name: 'email-ovsnfv-ptl'
810 <<: *email_ptl_defaults
812 MarkD.Graymark.d.gray@intel.com
815 name: 'email-parser-ptl'
818 <<: *email_ptl_defaults
820 shang.xiaodong@zte.com.cn
822 - publisher: &email_pharos_ptl_defaults
823 name: 'email-pharos-ptl'
826 <<: *email_ptl_defaults
828 jack.morgan@intel.com
830 name: 'email-pharos-tools-ptl'
831 <<: *email_pharos_ptl_defaults
834 name: 'email-promise-ptl'
837 <<: *email_ptl_defaults
839 kunzmann@docomolab-euro.com
842 name: 'email-qtip-ptl'
845 <<: *email_ptl_defaults
847 wu.zhihui1@zte.com.cn
849 - publisher: &email_releng_ptl_defaults
850 name: 'email-releng-ptl'
853 <<: *email_ptl_defaults
855 fatih.degirmenci@ericsson.com
857 name: 'email-releng-anteater-ptl'
858 <<: *email_releng_ptl_defaults
860 name: 'email-releng-testresults-ptl'
863 <<: *email_ptl_defaults
865 fatih.degirmenci@ericsson.com
866 feng.xiaowei@zte.com.cn
868 name: 'email-releng-utils-ptl'
869 <<: *email_releng_ptl_defaults
871 name: 'email-releng-xci-ptl'
872 <<: *email_releng_ptl_defaults
875 name: 'email-samplevnf-ptl'
878 <<: *email_ptl_defaults
883 name: 'email-sdnvpn-ptl'
886 <<: *email_ptl_defaults
888 tim.irnich@ericsson.com
891 name: 'email-securityscanning-ptl'
894 <<: *email_ptl_defaults
899 name: 'email-sfc-ptl'
902 <<: *email_ptl_defaults
904 ManuelBuilmbuil@suse.com
907 name: 'email-snaps-ptl'
910 <<: *email_ptl_defaults
912 s.pisarski@cablelabs.com
915 name: 'email-stor4nfv-ptl'
918 <<: *email_ptl_defaults
923 name: 'email-storperf-ptl'
926 <<: *email_ptl_defaults
931 name: 'email-ves-ptl'
934 <<: *email_ptl_defaults
936 bryan.sullivan@att.com
939 name: 'email-vswitchperf-ptl'
942 <<: *email_ptl_defaults
944 sridhar.rao@spirent.com
947 name: 'email-yardstick-ptl'
950 <<: *email_ptl_defaults
952 ross.b.brattain@intel.com
955 name: 'report-provision-result'
958 script-only-if-succeeded: true
961 echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
962 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
964 !include-raw-escape: installer-report.sh
966 script-only-if-succeeded: false
967 script-only-if-failed: true
970 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
971 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
973 !include-raw-escape: installer-report.sh