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
322 echo "Reporting lint result...."
324 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
325 sed -i -e "1s#^#${msg}\n\n#" violation.log
326 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
327 ssh -p 29418 gerrit.opnfv.org "$cmd"
329 # Make sure the caller job failed
338 echo "Checking bash code..."
339 for f in $(egrep '\.sh$' modified_files)
341 bash -n "$f" 2>> bash-violation.log
343 if [[ -s bash-violation.log ]]; then
344 echo -e "Bash syntax error(s)\n---" >> violation.log
345 sed -e 's/^/ /g' bash-violation.log >> violation.log
349 name: lint-python-code
353 # Install python package
354 sudo pip install "flake8==2.6.2"
356 echo "Checking python code..."
357 for f in $(egrep '\.py$' modified_files)
359 flake8 "$f" >> python-violation.log
361 if [[ -s python-violation.log ]]; then
362 echo -e "Python violation(s)\n---" >> violation.log
363 sed -e 's/^/ /g' python-violation.log >> violation.log
371 # sudo Install python packages
372 sudo pip install "yamllint==1.8.2"
374 echo "Checking yaml file..."
375 for f in $(egrep '\.ya?ml$' modified_files)
377 yamllint "$f" >> yaml-violation.log
379 if [[ -s yaml-violation.log ]]; then
380 echo -e "YAML violation(s)\n---" >> violation.log
381 sed -e 's/^/ /g' yaml-violation.log >> violation.log
394 name: clean-workspace
401 sudo /bin/rm -rf "$WORKSPACE"
404 name: clean-workspace-log
407 find $WORKSPACE -type f -name '*.log' | xargs rm -f
410 name: track-begin-timestamp
413 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
416 name: archive-artifacts
419 artifacts: '{artifacts}'
425 name: publish-coverage
428 report-file: "coverage.xml"
430 health-auto-update: "false"
431 stability-auto-update: "false"
432 zoom-coverage-chart: "true"
443 # The majority of the email-ext plugin options are set to the default
444 # for this macro so they can be managed through Jenkins' global
447 name: email-jenkins-admins-on-failure
451 attach-build-log: true
458 # Email PTL publishers
459 - email_ptl_defaults: &email_ptl_defaults
460 name: 'email_ptl_defaults'
462 attach-build-log: true
468 - publisher: &email_apex_ptl_defaults
469 name: 'email-apex-ptl'
472 <<: *email_ptl_defaults
476 name: 'email-apex-os-net-config-ptl'
477 <<: *email_apex_ptl_defaults
479 name: 'email-apex-puppet-tripleo-ptl'
480 <<: *email_apex_ptl_defaults
482 name: 'email-apex-tripleo-heat-templates-ptl'
483 <<: *email_apex_ptl_defaults
486 name: 'email-armband-ptl'
489 <<: *email_ptl_defaults
494 name: 'email-auto-ptl'
497 <<: *email_ptl_defaults
502 name: 'email-availability-ptl'
505 <<: *email_ptl_defaults
507 fuqiao@chinamobile.com
510 name: 'email-bamboo-ptl'
513 <<: *email_ptl_defaults
518 name: 'email-barometer-ptl'
521 <<: *email_ptl_defaults
526 name: 'email-bottlenecks-ptl'
529 <<: *email_ptl_defaults
531 gabriel.yuyang@huawei.com
534 name: 'email-calipso-ptl'
537 <<: *email_ptl_defaults
542 name: 'email-clover-ptl'
545 <<: *email_ptl_defaults
547 stephen.wong1@huawei.com
549 - publisher: &email_compass4nfv_ptl_defaults
550 name: 'email-compass4nfv-ptl'
553 <<: *email_ptl_defaults
557 name: 'email-compass-containers-ptl'
558 <<: *email_compass4nfv_ptl_defaults
561 name: 'email-conductor-ptl'
564 <<: *email_ptl_defaults
566 limingjiang@huawei.com
569 name: 'email-container4nfv-ptl'
572 <<: *email_ptl_defaults
574 jiaxuan@chinamobile.com
577 name: 'email-copper-ptl'
580 <<: *email_ptl_defaults
582 aimeeu.opensource@gmail.com
585 name: 'email-cperf-ptl'
588 <<: *email_ptl_defaults
593 name: 'email-daisy-ptl'
596 <<: *email_ptl_defaults
598 hu.zhijiang@zte.com.cn
601 name: 'email-doctor-ptl'
604 <<: *email_ptl_defaults
609 name: 'email-domino-ptl'
612 <<: *email_ptl_defaults
614 ulas.kozat@huawei.com
617 name: 'email-dovetail-ptl'
620 <<: *email_ptl_defaults
622 georg.kunz@ericsson.com
625 name: 'email-dpacc-ptl'
628 <<: *email_ptl_defaults
630 denglingli@chinamobile.com
633 name: 'email-enfv-ptl'
636 <<: *email_ptl_defaults
638 JBuchanan@advaoptical.com
641 name: 'email-escalator-ptl'
644 <<: *email_ptl_defaults
649 name: 'email-fastpathmetrics-ptl'
652 <<: *email_ptl_defaults
654 maryam.tahhan@intel.com
657 name: 'email-fds-ptl'
660 <<: *email_ptl_defaults
665 name: 'email-fuel-ptl'
668 <<: *email_ptl_defaults
670 gelkinbard@mirantis.com
673 name: 'email-functest-ptl'
676 <<: *email_ptl_defaults
678 cedric.ollivier@orange.com
681 name: 'email-ipv6-ptl'
684 <<: *email_ptl_defaults
689 name: 'email-joid-ptl'
692 <<: *email_ptl_defaults
694 artur.tyloch@canonical.com
697 name: 'email-kvmfornfv-ptl'
700 <<: *email_ptl_defaults
702 raghuveer.reddy@intel.com
705 name: 'email-models-ptl'
708 <<: *email_ptl_defaults
713 name: 'email-moon-ptl'
716 <<: *email_ptl_defaults
721 name: 'email-multisite-ptl'
724 <<: *email_ptl_defaults
729 name: 'email-netready-ptl'
732 <<: *email_ptl_defaults
734 georg.kunz@ericsson.com
737 name: 'email-nfvbench-ptl'
740 <<: *email_ptl_defaults
745 name: 'email-octopus-ptl'
748 <<: *email_ptl_defaults
750 ulrich.kleber@huawei.com
753 name: 'email-onosfw-ptl'
756 <<: *email_ptl_defaults
761 name: 'email-openretriever-ptl'
764 <<: *email_ptl_defaults
766 jiaxuan@chinamobile.com
769 name: 'email-opera-ptl'
772 <<: *email_ptl_defaults
774 Yingjun.li@huawei.com
777 name: 'email-opnfvdocs-ptl'
780 <<: *email_ptl_defaults
782 sofia.wallin@ericsson.com
785 name: 'email-orchestra-ptl'
788 <<: *email_ptl_defaults
790 giuseppe.carella@fokus.fraunhofer.de
793 name: 'email-ovn4nfv-ptl'
796 <<: *email_ptl_defaults
798 trinath.somanchi@gmail.com
801 name: 'email-ovno-ptl'
804 <<: *email_ptl_defaults
809 name: 'email-ovsnfv-ptl'
812 <<: *email_ptl_defaults
814 MarkD.Graymark.d.gray@intel.com
817 name: 'email-parser-ptl'
820 <<: *email_ptl_defaults
822 shang.xiaodong@zte.com.cn
824 - publisher: &email_pharos_ptl_defaults
825 name: 'email-pharos-ptl'
828 <<: *email_ptl_defaults
830 zhang.jun3g@zte.com.cn
832 name: 'email-pharos-tools-ptl'
833 <<: *email_pharos_ptl_defaults
836 name: 'email-promise-ptl'
839 <<: *email_ptl_defaults
841 kunzmann@docomolab-euro.com
844 name: 'email-qtip-ptl'
847 <<: *email_ptl_defaults
849 wu.zhihui1@zte.com.cn
851 - publisher: &email_releng_ptl_defaults
852 name: 'email-releng-ptl'
855 <<: *email_ptl_defaults
857 fatih.degirmenci@ericsson.com
859 name: 'email-releng-anteater-ptl'
860 <<: *email_releng_ptl_defaults
862 name: 'email-releng-testresults-ptl'
865 <<: *email_ptl_defaults
867 fatih.degirmenci@ericsson.com
868 feng.xiaowei@zte.com.cn
870 name: 'email-releng-utils-ptl'
871 <<: *email_releng_ptl_defaults
873 name: 'email-releng-xci-ptl'
874 <<: *email_releng_ptl_defaults
877 name: 'email-samplevnf-ptl'
880 <<: *email_ptl_defaults
885 name: 'email-sdnvpn-ptl'
888 <<: *email_ptl_defaults
890 tim.irnich@ericsson.com
893 name: 'email-securityscanning-ptl'
896 <<: *email_ptl_defaults
901 name: 'email-sfc-ptl'
904 <<: *email_ptl_defaults
909 name: 'email-snaps-ptl'
912 <<: *email_ptl_defaults
914 s.pisarski@cablelabs.com
917 name: 'email-stor4nfv-ptl'
920 <<: *email_ptl_defaults
925 name: 'email-storperf-ptl'
928 <<: *email_ptl_defaults
933 name: 'email-ves-ptl'
936 <<: *email_ptl_defaults
938 bryan.sullivan@att.com
941 name: 'email-vswitchperf-ptl'
944 <<: *email_ptl_defaults
946 sridhar.rao@spirent.com
949 name: 'email-yardstick-ptl'
952 <<: *email_ptl_defaults
954 ross.b.brattain@intel.com
957 name: 'report-provision-result'
960 script-only-if-succeeded: true
963 echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
964 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
966 !include-raw-escape: installer-report.sh
968 script-only-if-succeeded: false
969 script-only-if-failed: true
972 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
973 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
975 !include-raw-escape: installer-report.sh