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
310 # Ensure we start with a clean environment
311 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
312 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1) > modified_files
318 if [[ -s violation.log ]]; then
319 echo "Reporting lint result..."
320 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
321 sed -i -e '1s/^//$msg\n\n/' violation.log
322 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
323 ssh -p 29418 gerrit.opnfv.org "$cmd"
325 # Make sure the caller job failed
333 echo "Checking bash code..."
334 for f in $(egrep '\.sh$' modified_files)
336 bash -n "$f" 2>> bash-violation.log
338 if [[ -s bash-violation.log ]]; then
339 echo -e "Bash syntax error(s)\n---" >> violation.log
340 sed -e 's/^/ /g' bash-violation.log >> violation.log
344 name: lint-python-code
347 # Install python packages
348 pip install "flake8==2.6.2"
350 echo "Checking python code..."
351 for f in $(egrep '\.py$' modified_files)
353 flake8 "$f" >> python-violation.log
355 if [[ -s python-violation.log ]]; then
356 echo -e "Python violation(s)\n---" >> violation.log
357 sed -e 's/^/ /g' python-violation.log >> violation.log
364 # Install python packages
365 pip install "yamllint==1.8.2"
367 echo "Checking yaml file..."
368 for f in $(egrep '\.ya?ml$' modified_files)
370 yamllint "$f" >> yaml-violation.log
372 if [[ -s yaml-violation.log ]]; then
373 echo -e "YAML violation(s)\n---" >> violation.log
374 sed -e 's/^/ /g' yaml-violation.log >> violation.log
387 name: clean-workspace
394 sudo /bin/rm -rf "$WORKSPACE"
397 name: clean-workspace-log
400 find $WORKSPACE -type f -name '*.log' | xargs rm -f
403 name: track-begin-timestamp
406 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
409 name: archive-artifacts
412 artifacts: '{artifacts}'
418 name: publish-coverage
421 report-file: "coverage.xml"
423 health-auto-update: "false"
424 stability-auto-update: "false"
425 zoom-coverage-chart: "true"
436 # The majority of the email-ext plugin options are set to the default
437 # for this macro so they can be managed through Jenkins' global
440 name: email-jenkins-admins-on-failure
444 attach-build-log: true
451 # Email PTL publishers
452 - email_ptl_defaults: &email_ptl_defaults
453 name: 'email_ptl_defaults'
455 attach-build-log: true
461 - publisher: &email_apex_ptl_defaults
462 name: 'email-apex-ptl'
465 <<: *email_ptl_defaults
469 name: 'email-apex-os-net-config-ptl'
470 <<: *email_apex_ptl_defaults
472 name: 'email-apex-puppet-tripleo-ptl'
473 <<: *email_apex_ptl_defaults
475 name: 'email-apex-tripleo-heat-templates-ptl'
476 <<: *email_apex_ptl_defaults
479 name: 'email-armband-ptl'
482 <<: *email_ptl_defaults
487 name: 'email-auto-ptl'
490 <<: *email_ptl_defaults
495 name: 'email-availability-ptl'
498 <<: *email_ptl_defaults
500 fuqiao@chinamobile.com
503 name: 'email-bamboo-ptl'
506 <<: *email_ptl_defaults
511 name: 'email-barometer-ptl'
514 <<: *email_ptl_defaults
519 name: 'email-bottlenecks-ptl'
522 <<: *email_ptl_defaults
524 gabriel.yuyang@huawei.com
527 name: 'email-calipso-ptl'
530 <<: *email_ptl_defaults
535 name: 'email-clover-ptl'
538 <<: *email_ptl_defaults
540 stephen.wong1@huawei.com
542 - publisher: &email_compass4nfv_ptl_defaults
543 name: 'email-compass4nfv-ptl'
546 <<: *email_ptl_defaults
550 name: 'email-compass-containers-ptl'
551 <<: *email_compass4nfv_ptl_defaults
554 name: 'email-conductor-ptl'
557 <<: *email_ptl_defaults
559 limingjiang@huawei.com
562 name: 'email-container4nfv-ptl'
565 <<: *email_ptl_defaults
567 jiaxuan@chinamobile.com
570 name: 'email-copper-ptl'
573 <<: *email_ptl_defaults
575 aimeeu.opensource@gmail.com
578 name: 'email-cperf-ptl'
581 <<: *email_ptl_defaults
586 name: 'email-daisy-ptl'
589 <<: *email_ptl_defaults
591 hu.zhijiang@zte.com.cn
594 name: 'email-doctor-ptl'
597 <<: *email_ptl_defaults
602 name: 'email-domino-ptl'
605 <<: *email_ptl_defaults
607 ulas.kozat@huawei.com
610 name: 'email-dovetail-ptl'
613 <<: *email_ptl_defaults
615 hongbo.tianhongbo@huawei.com
618 name: 'email-dpacc-ptl'
621 <<: *email_ptl_defaults
623 denglingli@chinamobile.com
626 name: 'email-enfv-ptl'
629 <<: *email_ptl_defaults
631 JBuchanan@advaoptical.com
634 name: 'email-escalator-ptl'
637 <<: *email_ptl_defaults
642 name: 'email-fastpathmetrics-ptl'
645 <<: *email_ptl_defaults
647 maryam.tahhan@intel.com
650 name: 'email-fds-ptl'
653 <<: *email_ptl_defaults
658 name: 'email-fuel-ptl'
661 <<: *email_ptl_defaults
663 gelkinbard@mirantis.com
666 name: 'email-functest-ptl'
669 <<: *email_ptl_defaults
671 cedric.ollivier@orange.com
674 name: 'email-ipv6-ptl'
677 <<: *email_ptl_defaults
682 name: 'email-joid-ptl'
685 <<: *email_ptl_defaults
687 artur.tyloch@canonical.com
690 name: 'email-kvmfornfv-ptl'
693 <<: *email_ptl_defaults
695 raghuveer.reddy@intel.com
698 name: 'email-models-ptl'
701 <<: *email_ptl_defaults
706 name: 'email-moon-ptl'
709 <<: *email_ptl_defaults
714 name: 'email-multisite-ptl'
717 <<: *email_ptl_defaults
722 name: 'email-netready-ptl'
725 <<: *email_ptl_defaults
727 georg.kunz@ericsson.com
730 name: 'email-nfvbench-ptl'
733 <<: *email_ptl_defaults
738 name: 'email-octopus-ptl'
741 <<: *email_ptl_defaults
743 ulrich.kleber@huawei.com
746 name: 'email-onosfw-ptl'
749 <<: *email_ptl_defaults
754 name: 'email-openretriever-ptl'
757 <<: *email_ptl_defaults
759 jiaxuan@chinamobile.com
762 name: 'email-opera-ptl'
765 <<: *email_ptl_defaults
767 Yingjun.li@huawei.com
770 name: 'email-opnfvdocs-ptl'
773 <<: *email_ptl_defaults
775 sofia.wallin@ericsson.com
778 name: 'email-orchestra-ptl'
781 <<: *email_ptl_defaults
783 giuseppe.carella@fokus.fraunhofer.de
786 name: 'email-ovn4nfv-ptl'
789 <<: *email_ptl_defaults
791 trinath.somanchi@gmail.com
794 name: 'email-ovno-ptl'
797 <<: *email_ptl_defaults
802 name: 'email-ovsnfv-ptl'
805 <<: *email_ptl_defaults
807 MarkD.Graymark.d.gray@intel.com
810 name: 'email-parser-ptl'
813 <<: *email_ptl_defaults
815 shang.xiaodong@zte.com.cn
817 - publisher: &email_pharos_ptl_defaults
818 name: 'email-pharos-ptl'
821 <<: *email_ptl_defaults
823 jack.morgan@intel.com
825 name: 'email-pharos-tools-ptl'
826 <<: *email_pharos_ptl_defaults
829 name: 'email-promise-ptl'
832 <<: *email_ptl_defaults
834 kunzmann@docomolab-euro.com
837 name: 'email-qtip-ptl'
840 <<: *email_ptl_defaults
842 wu.zhihui1@zte.com.cn
844 - publisher: &email_releng_ptl_defaults
845 name: 'email-releng-ptl'
848 <<: *email_ptl_defaults
850 fatih.degirmenci@ericsson.com
852 name: 'email-releng-anteater-ptl'
853 <<: *email_releng_ptl_defaults
855 name: 'email-releng-testresults-ptl'
858 <<: *email_ptl_defaults
860 fatih.degirmenci@ericsson.com
861 feng.xiaowei@zte.com.cn
863 name: 'email-releng-utils-ptl'
864 <<: *email_releng_ptl_defaults
866 name: 'email-releng-xci-ptl'
867 <<: *email_releng_ptl_defaults
870 name: 'email-samplevnf-ptl'
873 <<: *email_ptl_defaults
878 name: 'email-sdnvpn-ptl'
881 <<: *email_ptl_defaults
883 tim.irnich@ericsson.com
886 name: 'email-securityscanning-ptl'
889 <<: *email_ptl_defaults
894 name: 'email-sfc-ptl'
897 <<: *email_ptl_defaults
899 ManuelBuilmbuil@suse.com
902 name: 'email-snaps-ptl'
905 <<: *email_ptl_defaults
907 s.pisarski@cablelabs.com
910 name: 'email-stor4nfv-ptl'
913 <<: *email_ptl_defaults
918 name: 'email-storperf-ptl'
921 <<: *email_ptl_defaults
926 name: 'email-ves-ptl'
929 <<: *email_ptl_defaults
931 bryan.sullivan@att.com
934 name: 'email-vswitchperf-ptl'
937 <<: *email_ptl_defaults
939 sridhar.rao@spirent.com
942 name: 'email-yardstick-ptl'
945 <<: *email_ptl_defaults
947 ross.b.brattain@intel.com
950 name: 'report-provision-result'
953 script-only-if-succeeded: true
956 echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
957 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
959 !include-raw-escape: installer-report.sh
961 script-only-if-failed: true
964 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
965 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
967 !include-raw-escape: installer-report.sh