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 default: 'http://testresults.opnfv.org/test/api/v1'
45 description: "Default TestAPI URL, currently using v1"
48 name: logrotate-default
53 artifact-days-to-keep: 60
54 artifact-num-to-keep: 200
59 - git: &git-scm-defaults
60 credentials-id: '$SSH_CREDENTIAL_ID'
70 choosing-strategy: 'gerrit'
71 refspec: '$GERRIT_REFSPEC'
74 name: git-scm-with-submodules
77 credentials-id: '$SSH_CREDENTIAL_ID'
81 - 'refs/heads/{branch}'
89 name: git-scm-openstack
91 - git: &git-scm-openstack-defaults
98 name: 'daily-trigger-disabled'
103 name: 'weekly-trigger-disabled'
108 name: gerrit-trigger-patchset-created
111 server-name: 'gerrit.opnfv.org'
113 - patchset-created-event:
114 exclude-drafts: 'false'
115 exclude-trivial-rebase: 'false'
116 exclude-no-code-change: 'false'
117 - draft-published-event
118 - comment-added-contains-event:
119 comment-contains-value: 'recheck'
120 - comment-added-contains-event:
121 comment-contains-value: 'reverify'
123 - project-compare-type: 'ANT'
124 project-pattern: '{project}'
126 - branch-compare-type: 'ANT'
127 branch-pattern: '**/{branch}'
129 - compare-type: 'ANT'
138 name: gerrit-trigger-change-merged
141 server-name: 'gerrit.opnfv.org'
143 - change-merged-event
144 - comment-added-contains-event:
145 comment-contains-value: 'remerge'
147 - project-compare-type: 'ANT'
148 project-pattern: '{project}'
150 - branch-compare-type: 'ANT'
151 branch-pattern: '**/{branch}'
153 - compare-type: 'ANT'
157 name: gerrit-trigger-tag-created
160 server-name: 'gerrit.opnfv.org'
164 - project-compare-type: 'ANT'
165 project-pattern: '{project}'
167 - branch-compare-type: 'ANT'
168 branch-pattern: 'refs/tags/**'
174 server-name: 'gerrit.opnfv.org'
176 - comment-added-contains-event:
177 comment-contains-value: 'check-experimental'
179 - project-compare-type: 'ANT'
180 project-pattern: '{project}'
182 - branch-compare-type: 'ANT'
183 branch-pattern: '**/{branch}'
185 - compare-type: 'ANT'
194 name: ssh-agent-wrapper
196 - ssh-agent-credentials:
198 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
205 timeout-var: 'BUILD_TIMEOUT'
209 name: fix-workspace-permissions
214 sudo chown -R $USER:$USER $WORKSPACE || exit 1
217 name: upload-under-review-docs-to-opnfv-artifacts
224 export PATH=$PATH:/usr/local/bin/
226 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
227 [[ -d docs/_build/ ]] || exit 0
230 echo "###########################"
231 echo "UPLOADING DOCS UNDER REVIEW"
232 echo "###########################"
235 gs_base="artifacts.opnfv.org/$PROJECT/review"
236 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
237 local_path="upload/$GERRIT_CHANGE_NUMBER"
240 mv docs/_build/html/ "$local_path"
241 gsutil -m cp -r "$local_path" "gs://$gs_base"
244 -h "Content-Type:text/html" \
245 -h "Cache-Control:private, max-age=0, no-transform" \
246 "gs://$gs_path"/**.html > /dev/null 2>&1
248 echo "Document link(s):" >> gerrit_comment.txt
249 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
250 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
252 # To take advantage of this macro, have your build write
253 # out the file 'gerrit_comment.txt' with information to post
254 # back to gerrit and include this macro in the list of builders.
256 name: report-build-result-to-gerrit
263 export PATH=$PATH:/usr/local/bin/
264 if [[ -e gerrit_comment.txt ]] ; then
266 echo "posting review comment to gerrit..."
268 cat gerrit_comment.txt
270 ssh -p 29418 gerrit.opnfv.org \
271 "gerrit review -p $GERRIT_PROJECT \
272 -m '$(cat gerrit_comment.txt)' \
273 $GERRIT_PATCHSET_REVISION \
278 name: remove-old-docs-from-opnfv-artifacts
285 export PATH=$PATH:/usr/local/bin/
287 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
289 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
291 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
293 echo "Deleting Out-of-dated Documents..."
294 gsutil -m rm -r "gs://$gs_path"
296 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
298 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
300 echo "Deleting Out-of-dated Documents..."
301 gsutil -m rm -r "gs://$gs_path"
305 name: upload-review-docs
307 - upload-under-review-docs-to-opnfv-artifacts
308 - report-build-result-to-gerrit
315 # Ensure we start with a clean environment
316 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
317 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
324 if [[ -s violation.log ]]; then
326 echo "Reporting lint result...."
328 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
329 sed -i -e "1s#^#${msg}\n\n#" violation.log
330 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
331 ssh -p 29418 gerrit.opnfv.org "$cmd"
333 # Make sure the caller job failed
342 echo "Checking bash code..."
343 for f in $(egrep '\.sh$' modified_files)
345 bash -n "$f" 2>> bash-violation.log
347 if [[ -s bash-violation.log ]]; then
348 echo -e "Bash syntax error(s)\n---" >> violation.log
349 sed -e 's/^/ /g' bash-violation.log >> violation.log
353 name: lint-python-code
357 # Install python package
358 sudo pip install "flake8==2.6.2"
360 echo "Checking python code..."
361 for f in $(egrep '\.py$' modified_files)
363 flake8 "$f" >> python-violation.log
365 if [[ -s python-violation.log ]]; then
366 echo -e "Python violation(s)\n---" >> violation.log
367 sed -e 's/^/ /g' python-violation.log >> violation.log
375 # sudo Install python packages
376 sudo pip install "yamllint==1.8.2"
378 echo "Checking yaml file..."
379 for f in $(egrep '\.ya?ml$' modified_files)
381 yamllint "$f" >> yaml-violation.log
383 if [[ -s yaml-violation.log ]]; then
384 echo -e "YAML violation(s)\n---" >> violation.log
385 sed -e 's/^/ /g' yaml-violation.log >> violation.log
398 name: clean-workspace
405 sudo /bin/rm -rf "$WORKSPACE"
408 name: clean-workspace-log
411 find $WORKSPACE -type f -name '*.log' | xargs rm -f
414 name: track-begin-timestamp
417 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
420 name: archive-artifacts
423 artifacts: '{artifacts}'
429 name: publish-coverage
432 report-file: "coverage.xml"
434 health-auto-update: "false"
435 stability-auto-update: "false"
436 zoom-coverage-chart: "true"
447 # The majority of the email-ext plugin options are set to the default
448 # for this macro so they can be managed through Jenkins' global
451 name: email-jenkins-admins-on-failure
455 attach-build-log: true
462 # Email PTL publishers
463 - email_ptl_defaults: &email_ptl_defaults
464 name: 'email_ptl_defaults'
466 attach-build-log: true
472 - publisher: &email_apex_ptl_defaults
473 name: 'email-apex-ptl'
476 <<: *email_ptl_defaults
480 name: 'email-apex-os-net-config-ptl'
481 <<: *email_apex_ptl_defaults
483 name: 'email-apex-puppet-tripleo-ptl'
484 <<: *email_apex_ptl_defaults
486 name: 'email-apex-tripleo-heat-templates-ptl'
487 <<: *email_apex_ptl_defaults
490 name: 'email-armband-ptl'
493 <<: *email_ptl_defaults
498 name: 'email-auto-ptl'
501 <<: *email_ptl_defaults
506 name: 'email-availability-ptl'
509 <<: *email_ptl_defaults
511 fuqiao@chinamobile.com
514 name: 'email-bamboo-ptl'
517 <<: *email_ptl_defaults
522 name: 'email-barometer-ptl'
525 <<: *email_ptl_defaults
530 name: 'email-bottlenecks-ptl'
533 <<: *email_ptl_defaults
535 gabriel.yuyang@huawei.com
538 name: 'email-calipso-ptl'
541 <<: *email_ptl_defaults
546 name: 'email-clover-ptl'
549 <<: *email_ptl_defaults
551 stephen.wong1@huawei.com
553 - publisher: &email_compass4nfv_ptl_defaults
554 name: 'email-compass4nfv-ptl'
557 <<: *email_ptl_defaults
561 name: 'email-compass-containers-ptl'
562 <<: *email_compass4nfv_ptl_defaults
565 name: 'email-conductor-ptl'
568 <<: *email_ptl_defaults
570 limingjiang@huawei.com
573 name: 'email-container4nfv-ptl'
576 <<: *email_ptl_defaults
578 jiaxuan@chinamobile.com
581 name: 'email-copper-ptl'
584 <<: *email_ptl_defaults
586 aimeeu.opensource@gmail.com
589 name: 'email-cperf-ptl'
592 <<: *email_ptl_defaults
597 name: 'email-daisy-ptl'
600 <<: *email_ptl_defaults
602 hu.zhijiang@zte.com.cn
605 name: 'email-doctor-ptl'
608 <<: *email_ptl_defaults
613 name: 'email-domino-ptl'
616 <<: *email_ptl_defaults
618 ulas.kozat@huawei.com
621 name: 'email-dovetail-ptl'
624 <<: *email_ptl_defaults
626 georg.kunz@ericsson.com
629 name: 'email-dpacc-ptl'
632 <<: *email_ptl_defaults
634 denglingli@chinamobile.com
637 name: 'email-enfv-ptl'
640 <<: *email_ptl_defaults
642 JBuchanan@advaoptical.com
645 name: 'email-escalator-ptl'
648 <<: *email_ptl_defaults
653 name: 'email-fastpathmetrics-ptl'
656 <<: *email_ptl_defaults
658 maryam.tahhan@intel.com
661 name: 'email-fds-ptl'
664 <<: *email_ptl_defaults
669 name: 'email-fuel-ptl'
672 <<: *email_ptl_defaults
674 gelkinbard@mirantis.com
677 name: 'email-functest-ptl'
680 <<: *email_ptl_defaults
682 cedric.ollivier@orange.com
685 name: 'email-ipv6-ptl'
688 <<: *email_ptl_defaults
693 name: 'email-joid-ptl'
696 <<: *email_ptl_defaults
698 artur.tyloch@canonical.com
701 name: 'email-kvmfornfv-ptl'
704 <<: *email_ptl_defaults
706 raghuveer.reddy@intel.com
709 name: 'email-models-ptl'
712 <<: *email_ptl_defaults
717 name: 'email-moon-ptl'
720 <<: *email_ptl_defaults
725 name: 'email-multisite-ptl'
728 <<: *email_ptl_defaults
733 name: 'email-netready-ptl'
736 <<: *email_ptl_defaults
738 georg.kunz@ericsson.com
741 name: 'email-nfvbench-ptl'
744 <<: *email_ptl_defaults
749 name: 'email-octopus-ptl'
752 <<: *email_ptl_defaults
754 ulrich.kleber@huawei.com
757 name: 'email-onosfw-ptl'
760 <<: *email_ptl_defaults
765 name: 'email-openretriever-ptl'
768 <<: *email_ptl_defaults
770 jiaxuan@chinamobile.com
773 name: 'email-opera-ptl'
776 <<: *email_ptl_defaults
778 Yingjun.li@huawei.com
781 name: 'email-opnfvdocs-ptl'
784 <<: *email_ptl_defaults
786 sofia.wallin@ericsson.com
789 name: 'email-orchestra-ptl'
792 <<: *email_ptl_defaults
794 giuseppe.carella@fokus.fraunhofer.de
797 name: 'email-ovn4nfv-ptl'
800 <<: *email_ptl_defaults
802 trinath.somanchi@gmail.com
805 name: 'email-ovno-ptl'
808 <<: *email_ptl_defaults
813 name: 'email-ovsnfv-ptl'
816 <<: *email_ptl_defaults
818 MarkD.Graymark.d.gray@intel.com
821 name: 'email-parser-ptl'
824 <<: *email_ptl_defaults
826 shang.xiaodong@zte.com.cn
828 - publisher: &email_pharos_ptl_defaults
829 name: 'email-pharos-ptl'
832 <<: *email_ptl_defaults
834 zhang.jun3g@zte.com.cn
836 name: 'email-pharos-tools-ptl'
837 <<: *email_pharos_ptl_defaults
840 name: 'email-promise-ptl'
843 <<: *email_ptl_defaults
845 kunzmann@docomolab-euro.com
848 name: 'email-qtip-ptl'
851 <<: *email_ptl_defaults
853 wu.zhihui1@zte.com.cn
855 - publisher: &email_releng_ptl_defaults
856 name: 'email-releng-ptl'
859 <<: *email_ptl_defaults
861 fatih.degirmenci@ericsson.com
863 name: 'email-releng-anteater-ptl'
864 <<: *email_releng_ptl_defaults
866 name: 'email-releng-testresults-ptl'
869 <<: *email_ptl_defaults
871 fatih.degirmenci@ericsson.com
872 feng.xiaowei@zte.com.cn
874 name: 'email-releng-utils-ptl'
875 <<: *email_releng_ptl_defaults
877 name: 'email-releng-xci-ptl'
878 <<: *email_releng_ptl_defaults
881 name: 'email-samplevnf-ptl'
884 <<: *email_ptl_defaults
889 name: 'email-sdnvpn-ptl'
892 <<: *email_ptl_defaults
894 tim.irnich@ericsson.com
897 name: 'email-securityscanning-ptl'
900 <<: *email_ptl_defaults
905 name: 'email-sfc-ptl'
908 <<: *email_ptl_defaults
913 name: 'email-snaps-ptl'
916 <<: *email_ptl_defaults
918 s.pisarski@cablelabs.com
921 name: 'email-stor4nfv-ptl'
924 <<: *email_ptl_defaults
929 name: 'email-storperf-ptl'
932 <<: *email_ptl_defaults
937 name: 'email-ves-ptl'
940 <<: *email_ptl_defaults
942 bryan.sullivan@att.com
945 name: 'email-vswitchperf-ptl'
948 <<: *email_ptl_defaults
950 sridhar.rao@spirent.com
953 name: 'email-yardstick-ptl'
956 <<: *email_ptl_defaults
958 ross.b.brattain@intel.com
961 name: 'report-provision-result'
964 script-only-if-succeeded: true
967 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
968 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
970 !include-raw-escape: installer-report.sh
972 script-only-if-succeeded: false
973 script-only-if-failed: true
976 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
977 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
979 !include-raw-escape: installer-report.sh