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: testapi-parameter
48 default: 'http://testresults.opnfv.org/test/api/v1'
49 description: "Default TestAPI URL, currently using v1"
52 default: 'os-nosdn-nofeature-ha'
53 description: "OPNFV deployment scenario"
55 name: INSTALLER_VERSION
57 description: "Installer release version"
59 name: UPSTREAM_JOB_NAME
61 description: "Parent job name in Jenkins"
63 name: UPSTREAM_BUILD_ID
65 description: "Parent job build_id in Jenkins"
68 name: logrotate-default
73 artifact-days-to-keep: 60
74 artifact-num-to-keep: 200
79 - git: &git-scm-defaults
80 credentials-id: '$SSH_CREDENTIAL_ID'
90 choosing-strategy: 'gerrit'
91 refspec: '$GERRIT_REFSPEC'
94 name: git-scm-with-submodules
97 credentials-id: '$SSH_CREDENTIAL_ID'
101 - 'refs/heads/{branch}'
109 name: git-scm-openstack
111 - git: &git-scm-openstack-defaults
118 name: 'daily-trigger-disabled'
123 name: 'weekly-trigger-disabled'
128 name: gerrit-trigger-patchset-created
131 server-name: 'gerrit.opnfv.org'
133 - patchset-created-event:
134 exclude-drafts: 'false'
135 exclude-trivial-rebase: 'false'
136 exclude-no-code-change: 'false'
137 - draft-published-event
138 - comment-added-contains-event:
139 comment-contains-value: 'recheck'
140 - comment-added-contains-event:
141 comment-contains-value: 'reverify'
143 - project-compare-type: 'ANT'
144 project-pattern: '{project}'
146 - branch-compare-type: 'ANT'
147 branch-pattern: '**/{branch}'
149 - compare-type: 'ANT'
158 name: gerrit-trigger-change-merged
161 server-name: 'gerrit.opnfv.org'
163 - change-merged-event
164 - comment-added-contains-event:
165 comment-contains-value: 'remerge'
167 - project-compare-type: 'ANT'
168 project-pattern: '{project}'
170 - branch-compare-type: 'ANT'
171 branch-pattern: '**/{branch}'
173 - compare-type: 'ANT'
177 name: gerrit-trigger-tag-created
180 server-name: 'gerrit.opnfv.org'
184 - project-compare-type: 'ANT'
185 project-pattern: '{project}'
187 - branch-compare-type: 'ANT'
188 branch-pattern: 'refs/tags/**'
194 server-name: 'gerrit.opnfv.org'
196 - comment-added-contains-event:
197 comment-contains-value: 'check-experimental'
199 - project-compare-type: 'ANT'
200 project-pattern: '{project}'
202 - branch-compare-type: 'ANT'
203 branch-pattern: '**/{branch}'
205 - compare-type: 'ANT'
214 name: ssh-agent-wrapper
216 - ssh-agent-credentials:
218 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
225 timeout-var: 'BUILD_TIMEOUT'
229 name: fix-workspace-permissions
234 sudo chown -R $USER:$USER $WORKSPACE || exit 1
237 name: upload-under-review-docs-to-opnfv-artifacts
244 export PATH=$PATH:/usr/local/bin/
246 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
247 [[ -d docs/_build/ ]] || exit 0
250 echo "###########################"
251 echo "UPLOADING DOCS UNDER REVIEW"
252 echo "###########################"
255 gs_base="artifacts.opnfv.org/$PROJECT/review"
256 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
257 local_path="upload/$GERRIT_CHANGE_NUMBER"
260 mv docs/_build/html/ "$local_path"
261 gsutil -m cp -r "$local_path" "gs://$gs_base"
264 -h "Content-Type:text/html" \
265 -h "Cache-Control:private, max-age=0, no-transform" \
266 "gs://$gs_path"/**.html > /dev/null 2>&1
268 echo "Document link(s):" >> gerrit_comment.txt
269 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
270 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
272 # To take advantage of this macro, have your build write
273 # out the file 'gerrit_comment.txt' with information to post
274 # back to gerrit and include this macro in the list of builders.
276 name: report-build-result-to-gerrit
283 export PATH=$PATH:/usr/local/bin/
284 if [[ -e gerrit_comment.txt ]] ; then
286 echo "posting review comment to gerrit..."
288 cat gerrit_comment.txt
290 ssh -p 29418 gerrit.opnfv.org \
291 "gerrit review -p $GERRIT_PROJECT \
292 -m '$(cat gerrit_comment.txt)' \
293 $GERRIT_PATCHSET_REVISION \
298 name: remove-old-docs-from-opnfv-artifacts
305 export PATH=$PATH:/usr/local/bin/
307 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
309 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
311 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
313 echo "Deleting Out-of-dated Documents..."
314 gsutil -m rm -r "gs://$gs_path"
316 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
318 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
320 echo "Deleting Out-of-dated Documents..."
321 gsutil -m rm -r "gs://$gs_path"
325 name: upload-review-docs
327 - upload-under-review-docs-to-opnfv-artifacts
328 - report-build-result-to-gerrit
335 # Ensure we start with a clean environment
336 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
337 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
344 if [[ -s violation.log ]]; then
346 echo "Reporting lint result...."
348 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
349 sed -i -e "1s#^#${msg}\n\n#" violation.log
350 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
351 ssh -p 29418 gerrit.opnfv.org "$cmd"
353 # Make sure the caller job failed
362 echo "Checking bash code..."
363 for f in $(egrep '\.sh$' modified_files)
365 bash -n "$f" 2>> bash-violation.log
367 if [[ -s bash-violation.log ]]; then
368 echo -e "Bash syntax error(s)\n---" >> violation.log
369 sed -e 's/^/ /g' bash-violation.log >> violation.log
373 name: lint-python-code
377 # Install python package
378 sudo pip install "flake8==2.6.2"
380 echo "Checking python code..."
381 for f in $(egrep '\.py$' modified_files)
383 flake8 "$f" >> python-violation.log
385 if [[ -s python-violation.log ]]; then
386 echo -e "Python violation(s)\n---" >> violation.log
387 sed -e 's/^/ /g' python-violation.log >> violation.log
395 # sudo Install python packages
396 sudo pip install "yamllint==1.8.2"
398 echo "Checking yaml file..."
399 for f in $(egrep '\.ya?ml$' modified_files)
401 yamllint "$f" >> yaml-violation.log
403 if [[ -s yaml-violation.log ]]; then
404 echo -e "YAML violation(s)\n---" >> violation.log
405 sed -e 's/^/ /g' yaml-violation.log >> violation.log
418 name: clean-workspace
425 sudo /bin/rm -rf "$WORKSPACE"
428 name: clean-workspace-log
431 find $WORKSPACE -type f -name '*.log' | xargs rm -f
434 name: track-begin-timestamp
437 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
440 name: archive-artifacts
443 artifacts: '{artifacts}'
449 name: publish-coverage
452 report-file: "coverage.xml"
454 health-auto-update: "false"
455 stability-auto-update: "false"
456 zoom-coverage-chart: "true"
467 # The majority of the email-ext plugin options are set to the default
468 # for this macro so they can be managed through Jenkins' global
471 name: email-jenkins-admins-on-failure
475 attach-build-log: true
482 # Email PTL publishers
483 - email_ptl_defaults: &email_ptl_defaults
484 name: 'email_ptl_defaults'
486 attach-build-log: true
492 - publisher: &email_apex_ptl_defaults
493 name: 'email-apex-ptl'
496 <<: *email_ptl_defaults
500 name: 'email-apex-os-net-config-ptl'
501 <<: *email_apex_ptl_defaults
503 name: 'email-apex-puppet-tripleo-ptl'
504 <<: *email_apex_ptl_defaults
506 name: 'email-apex-tripleo-heat-templates-ptl'
507 <<: *email_apex_ptl_defaults
510 name: 'email-armband-ptl'
513 <<: *email_ptl_defaults
518 name: 'email-auto-ptl'
521 <<: *email_ptl_defaults
526 name: 'email-availability-ptl'
529 <<: *email_ptl_defaults
531 fuqiao@chinamobile.com
534 name: 'email-bamboo-ptl'
537 <<: *email_ptl_defaults
542 name: 'email-barometer-ptl'
545 <<: *email_ptl_defaults
550 name: 'email-bottlenecks-ptl'
553 <<: *email_ptl_defaults
555 gabriel.yuyang@huawei.com
558 name: 'email-calipso-ptl'
561 <<: *email_ptl_defaults
566 name: 'email-clover-ptl'
569 <<: *email_ptl_defaults
571 stephen.wong1@huawei.com
573 - publisher: &email_compass4nfv_ptl_defaults
574 name: 'email-compass4nfv-ptl'
577 <<: *email_ptl_defaults
581 name: 'email-compass-containers-ptl'
582 <<: *email_compass4nfv_ptl_defaults
585 name: 'email-conductor-ptl'
588 <<: *email_ptl_defaults
590 limingjiang@huawei.com
593 name: 'email-container4nfv-ptl'
596 <<: *email_ptl_defaults
598 jiaxuan@chinamobile.com
601 name: 'email-copper-ptl'
604 <<: *email_ptl_defaults
606 aimeeu.opensource@gmail.com
609 name: 'email-cperf-ptl'
612 <<: *email_ptl_defaults
617 name: 'email-daisy-ptl'
620 <<: *email_ptl_defaults
622 hu.zhijiang@zte.com.cn
625 name: 'email-doctor-ptl'
628 <<: *email_ptl_defaults
633 name: 'email-domino-ptl'
636 <<: *email_ptl_defaults
638 ulas.kozat@huawei.com
641 name: 'email-dovetail-ptl'
644 <<: *email_ptl_defaults
646 georg.kunz@ericsson.com
649 name: 'email-dpacc-ptl'
652 <<: *email_ptl_defaults
654 denglingli@chinamobile.com
657 name: 'email-enfv-ptl'
660 <<: *email_ptl_defaults
662 JBuchanan@advaoptical.com
665 name: 'email-escalator-ptl'
668 <<: *email_ptl_defaults
673 name: 'email-fastpathmetrics-ptl'
676 <<: *email_ptl_defaults
678 maryam.tahhan@intel.com
681 name: 'email-fds-ptl'
684 <<: *email_ptl_defaults
689 name: 'email-fuel-ptl'
692 <<: *email_ptl_defaults
694 gelkinbard@mirantis.com
697 name: 'email-functest-ptl'
700 <<: *email_ptl_defaults
702 cedric.ollivier@orange.com
705 name: 'email-ipv6-ptl'
708 <<: *email_ptl_defaults
713 name: 'email-joid-ptl'
716 <<: *email_ptl_defaults
718 artur.tyloch@canonical.com
721 name: 'email-kvmfornfv-ptl'
724 <<: *email_ptl_defaults
726 raghuveer.reddy@intel.com
729 name: 'email-models-ptl'
732 <<: *email_ptl_defaults
737 name: 'email-moon-ptl'
740 <<: *email_ptl_defaults
745 name: 'email-multisite-ptl'
748 <<: *email_ptl_defaults
753 name: 'email-netready-ptl'
756 <<: *email_ptl_defaults
758 georg.kunz@ericsson.com
761 name: 'email-nfvbench-ptl'
764 <<: *email_ptl_defaults
769 name: 'email-octopus-ptl'
772 <<: *email_ptl_defaults
774 ulrich.kleber@huawei.com
777 name: 'email-onosfw-ptl'
780 <<: *email_ptl_defaults
785 name: 'email-openretriever-ptl'
788 <<: *email_ptl_defaults
790 jiaxuan@chinamobile.com
793 name: 'email-opera-ptl'
796 <<: *email_ptl_defaults
798 Yingjun.li@huawei.com
801 name: 'email-opnfvdocs-ptl'
804 <<: *email_ptl_defaults
806 sofia.wallin@ericsson.com
809 name: 'email-orchestra-ptl'
812 <<: *email_ptl_defaults
814 giuseppe.carella@fokus.fraunhofer.de
817 name: 'email-ovn4nfv-ptl'
820 <<: *email_ptl_defaults
822 trinath.somanchi@gmail.com
825 name: 'email-ovno-ptl'
828 <<: *email_ptl_defaults
833 name: 'email-ovsnfv-ptl'
836 <<: *email_ptl_defaults
838 MarkD.Graymark.d.gray@intel.com
841 name: 'email-parser-ptl'
844 <<: *email_ptl_defaults
846 shang.xiaodong@zte.com.cn
848 - publisher: &email_pharos_ptl_defaults
849 name: 'email-pharos-ptl'
852 <<: *email_ptl_defaults
854 zhang.jun3g@zte.com.cn
856 name: 'email-pharos-tools-ptl'
857 <<: *email_pharos_ptl_defaults
860 name: 'email-promise-ptl'
863 <<: *email_ptl_defaults
865 kunzmann@docomolab-euro.com
868 name: 'email-qtip-ptl'
871 <<: *email_ptl_defaults
873 wu.zhihui1@zte.com.cn
875 - publisher: &email_releng_ptl_defaults
876 name: 'email-releng-ptl'
879 <<: *email_ptl_defaults
881 fatih.degirmenci@ericsson.com
883 name: 'email-releng-anteater-ptl'
884 <<: *email_releng_ptl_defaults
886 name: 'email-releng-testresults-ptl'
889 <<: *email_ptl_defaults
891 fatih.degirmenci@ericsson.com
892 feng.xiaowei@zte.com.cn
894 name: 'email-releng-utils-ptl'
895 <<: *email_releng_ptl_defaults
897 name: 'email-releng-xci-ptl'
898 <<: *email_releng_ptl_defaults
901 name: 'email-samplevnf-ptl'
904 <<: *email_ptl_defaults
909 name: 'email-sdnvpn-ptl'
912 <<: *email_ptl_defaults
914 tim.irnich@ericsson.com
917 name: 'email-securityscanning-ptl'
920 <<: *email_ptl_defaults
925 name: 'email-sfc-ptl'
928 <<: *email_ptl_defaults
933 name: 'email-snaps-ptl'
936 <<: *email_ptl_defaults
938 s.pisarski@cablelabs.com
941 name: 'email-stor4nfv-ptl'
944 <<: *email_ptl_defaults
949 name: 'email-storperf-ptl'
952 <<: *email_ptl_defaults
957 name: 'email-ves-ptl'
960 <<: *email_ptl_defaults
962 bryan.sullivan@att.com
965 name: 'email-vswitchperf-ptl'
968 <<: *email_ptl_defaults
970 sridhar.rao@spirent.com
973 name: 'email-yardstick-ptl'
976 <<: *email_ptl_defaults
978 ross.b.brattain@intel.com
981 name: 'report-provision-result'
984 script-only-if-succeeded: true
987 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
988 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
989 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
991 !include-raw: installer-report.sh
993 script-only-if-succeeded: false
994 script-only-if-failed: true
997 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
998 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
999 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1001 !include-raw: installer-report.sh