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 # Reporting Deployment Results
46 # To report deployment results to
47 # http://testresults.opnfv.org/test/#/deployresults, add the following
48 # parameters, builders, and publishers to a deployment job:
54 # - track-begin-timestamp
57 # - report-provision-result
59 # Note: The following string parameter must also exist, as they are used
60 # when reporting the provision result:
66 # most installers include these but you should verify first before
67 # adding the publisher, otherwise the deployment build may be marked
72 name: testapi-parameter
76 default: 'http://testresults.opnfv.org/test/api/v1'
77 description: "Default TestAPI URL, currently using v1"
79 name: INSTALLER_VERSION
81 description: "Installer release version"
83 name: UPSTREAM_JOB_NAME
85 description: "Parent job name in Jenkins"
87 name: UPSTREAM_BUILD_ID
89 description: "Parent job build_id in Jenkins"
92 name: logrotate-default
97 artifact-days-to-keep: 60
98 artifact-num-to-keep: 200
103 - git: &git-scm-defaults
104 credentials-id: '$SSH_CREDENTIAL_ID'
120 choosing-strategy: 'gerrit'
121 refspec: '$GERRIT_REFSPEC'
122 <<: *git-scm-defaults
124 name: git-scm-with-submodules
127 credentials-id: '$SSH_CREDENTIAL_ID'
131 - 'refs/heads/{branch}'
139 name: git-scm-openstack
141 - git: &git-scm-openstack-defaults
148 name: 'daily-trigger-disabled'
153 name: 'weekly-trigger-disabled'
158 name: gerrit-trigger-patchset-created
161 server-name: 'gerrit.opnfv.org'
163 - patchset-created-event:
164 exclude-drafts: 'false'
165 exclude-trivial-rebase: 'false'
166 exclude-no-code-change: 'false'
167 - draft-published-event
168 - comment-added-contains-event:
169 comment-contains-value: 'recheck'
170 - comment-added-contains-event:
171 comment-contains-value: 'reverify'
173 - project-compare-type: 'ANT'
174 project-pattern: '{project}'
176 - branch-compare-type: 'ANT'
177 branch-pattern: '**/{branch}'
179 - compare-type: 'ANT'
188 name: gerrit-trigger-change-merged
191 server-name: 'gerrit.opnfv.org'
193 - change-merged-event
194 - comment-added-contains-event:
195 comment-contains-value: 'remerge'
197 - project-compare-type: 'ANT'
198 project-pattern: '{project}'
200 - branch-compare-type: 'ANT'
201 branch-pattern: '**/{branch}'
203 - compare-type: 'ANT'
207 name: gerrit-trigger-tag-created
210 server-name: 'gerrit.opnfv.org'
214 - project-compare-type: 'ANT'
215 project-pattern: '{project}'
217 - branch-compare-type: 'ANT'
218 branch-pattern: 'refs/tags/**'
224 server-name: 'gerrit.opnfv.org'
226 - comment-added-contains-event:
227 comment-contains-value: 'check-experimental'
229 - project-compare-type: 'ANT'
230 project-pattern: '{project}'
232 - branch-compare-type: 'ANT'
233 branch-pattern: '**/{branch}'
235 - compare-type: 'ANT'
244 name: ssh-agent-wrapper
246 - ssh-agent-credentials:
248 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
255 timeout-var: 'BUILD_TIMEOUT'
259 name: fix-workspace-permissions
264 sudo chown -R $USER:$USER $WORKSPACE || exit 1
267 name: upload-under-review-docs-to-opnfv-artifacts
274 export PATH=$PATH:/usr/local/bin/
276 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
277 [[ -d docs/_build/ ]] || exit 0
280 echo "###########################"
281 echo "UPLOADING DOCS UNDER REVIEW"
282 echo "###########################"
285 gs_base="artifacts.opnfv.org/$PROJECT/review"
286 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
287 local_path="upload/$GERRIT_CHANGE_NUMBER"
290 mv docs/_build/html/ "$local_path"
291 gsutil -m cp -r "$local_path" "gs://$gs_base"
294 -h "Content-Type:text/html" \
295 -h "Cache-Control:private, max-age=0, no-transform" \
296 "gs://$gs_path"/**.html > /dev/null 2>&1
298 echo "Document link(s):" >> gerrit_comment.txt
299 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
300 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
302 # To take advantage of this macro, have your build write
303 # out the file 'gerrit_comment.txt' with information to post
304 # back to gerrit and include this macro in the list of builders.
306 name: report-build-result-to-gerrit
313 export PATH=$PATH:/usr/local/bin/
314 if [[ -e gerrit_comment.txt ]] ; then
316 echo "posting review comment to gerrit..."
318 cat gerrit_comment.txt
320 ssh -p 29418 gerrit.opnfv.org \
321 "gerrit review -p $GERRIT_PROJECT \
322 -m '$(cat gerrit_comment.txt)' \
323 $GERRIT_PATCHSET_REVISION \
328 name: remove-old-docs-from-opnfv-artifacts
335 export PATH=$PATH:/usr/local/bin/
337 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
339 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
341 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
343 echo "Deleting Out-of-dated Documents..."
344 gsutil -m rm -r "gs://$gs_path"
346 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
348 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
350 echo "Deleting Out-of-dated Documents..."
351 gsutil -m rm -r "gs://$gs_path"
355 name: upload-review-docs
357 - upload-under-review-docs-to-opnfv-artifacts
358 - report-build-result-to-gerrit
365 # Ensure we start with a clean environment
366 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
367 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
374 if [[ -s violation.log ]]; then
376 echo "Reporting lint result...."
378 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
379 sed -i -e "1s#^#${msg}\n\n#" violation.log
380 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
381 ssh -p 29418 gerrit.opnfv.org "$cmd"
383 # Make sure the caller job failed
392 echo "Checking bash code..."
393 for f in $(egrep '\.sh$' modified_files)
395 bash -n "$f" 2>> bash-violation.log
397 if [[ -s bash-violation.log ]]; then
398 echo -e "Bash syntax error(s)\n---" >> violation.log
399 sed -e 's/^/ /g' bash-violation.log >> violation.log
403 name: lint-python-code
407 # Install python package
408 sudo pip install "flake8==2.6.2"
410 echo "Checking python code..."
411 for f in $(egrep '\.py$' modified_files)
413 flake8 "$f" >> python-violation.log
415 if [[ -s python-violation.log ]]; then
416 echo -e "Python violation(s)\n---" >> violation.log
417 sed -e 's/^/ /g' python-violation.log >> violation.log
425 # sudo Install python packages
426 sudo pip install "yamllint==1.8.2"
428 echo "Checking yaml file..."
429 for f in $(egrep '\.ya?ml$' modified_files)
431 yamllint "$f" >> yaml-violation.log
433 if [[ -s yaml-violation.log ]]; then
434 echo -e "YAML violation(s)\n---" >> violation.log
435 sed -e 's/^/ /g' yaml-violation.log >> violation.log
448 name: clean-workspace
455 sudo /bin/rm -rf "$WORKSPACE"
458 name: clean-workspace-log
461 find $WORKSPACE -type f -name '*.log' | xargs rm -f
464 name: track-begin-timestamp
467 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
470 name: archive-artifacts
473 artifacts: '{artifacts}'
479 name: publish-coverage
482 report-file: "coverage.xml"
484 health-auto-update: "false"
485 stability-auto-update: "false"
486 zoom-coverage-chart: "true"
497 # The majority of the email-ext plugin options are set to the default
498 # for this macro so they can be managed through Jenkins' global
501 name: email-jenkins-admins-on-failure
505 attach-build-log: true
512 # Email PTL publishers
513 - email_ptl_defaults: &email_ptl_defaults
514 name: 'email_ptl_defaults'
516 attach-build-log: true
522 - publisher: &email_apex_ptl_defaults
523 name: 'email-apex-ptl'
526 <<: *email_ptl_defaults
530 name: 'email-apex-os-net-config-ptl'
531 <<: *email_apex_ptl_defaults
533 name: 'email-apex-puppet-tripleo-ptl'
534 <<: *email_apex_ptl_defaults
536 name: 'email-apex-tripleo-heat-templates-ptl'
537 <<: *email_apex_ptl_defaults
540 name: 'email-armband-ptl'
543 <<: *email_ptl_defaults
548 name: 'email-auto-ptl'
551 <<: *email_ptl_defaults
556 name: 'email-availability-ptl'
559 <<: *email_ptl_defaults
561 fuqiao@chinamobile.com
564 name: 'email-bamboo-ptl'
567 <<: *email_ptl_defaults
572 name: 'email-barometer-ptl'
575 <<: *email_ptl_defaults
580 name: 'email-bottlenecks-ptl'
583 <<: *email_ptl_defaults
585 gabriel.yuyang@huawei.com
588 name: 'email-calipso-ptl'
591 <<: *email_ptl_defaults
596 name: 'email-clover-ptl'
599 <<: *email_ptl_defaults
601 stephen.wong1@huawei.com
603 - publisher: &email_compass4nfv_ptl_defaults
604 name: 'email-compass4nfv-ptl'
607 <<: *email_ptl_defaults
611 name: 'email-compass-containers-ptl'
612 <<: *email_compass4nfv_ptl_defaults
615 name: 'email-conductor-ptl'
618 <<: *email_ptl_defaults
620 limingjiang@huawei.com
623 name: 'email-container4nfv-ptl'
626 <<: *email_ptl_defaults
628 jiaxuan@chinamobile.com
631 name: 'email-copper-ptl'
634 <<: *email_ptl_defaults
636 aimeeu.opensource@gmail.com
639 name: 'email-cperf-ptl'
642 <<: *email_ptl_defaults
647 name: 'email-daisy-ptl'
650 <<: *email_ptl_defaults
652 hu.zhijiang@zte.com.cn
655 name: 'email-doctor-ptl'
658 <<: *email_ptl_defaults
663 name: 'email-domino-ptl'
666 <<: *email_ptl_defaults
668 ulas.kozat@huawei.com
671 name: 'email-dovetail-ptl'
674 <<: *email_ptl_defaults
676 georg.kunz@ericsson.com
679 name: 'email-dpacc-ptl'
682 <<: *email_ptl_defaults
684 denglingli@chinamobile.com
687 name: 'email-enfv-ptl'
690 <<: *email_ptl_defaults
692 JBuchanan@advaoptical.com
695 name: 'email-fds-ptl'
698 <<: *email_ptl_defaults
703 name: 'email-fuel-ptl'
706 <<: *email_ptl_defaults
708 gelkinbard@mirantis.com
711 name: 'email-functest-ptl'
714 <<: *email_ptl_defaults
716 cedric.ollivier@orange.com
719 name: 'email-ipv6-ptl'
722 <<: *email_ptl_defaults
727 name: 'email-joid-ptl'
730 <<: *email_ptl_defaults
732 artur.tyloch@canonical.com
735 name: 'email-kvmfornfv-ptl'
738 <<: *email_ptl_defaults
740 raghuveer.reddy@intel.com
743 name: 'email-models-ptl'
746 <<: *email_ptl_defaults
751 name: 'email-moon-ptl'
754 <<: *email_ptl_defaults
759 name: 'email-netready-ptl'
762 <<: *email_ptl_defaults
764 georg.kunz@ericsson.com
767 name: 'email-nfvbench-ptl'
770 <<: *email_ptl_defaults
775 name: 'email-onosfw-ptl'
778 <<: *email_ptl_defaults
783 name: 'email-opera-ptl'
786 <<: *email_ptl_defaults
788 Yingjun.li@huawei.com
791 name: 'email-opnfvdocs-ptl'
794 <<: *email_ptl_defaults
796 sofia.wallin@ericsson.com
799 name: 'email-orchestra-ptl'
802 <<: *email_ptl_defaults
804 giuseppe.carella@fokus.fraunhofer.de
807 name: 'email-ovn4nfv-ptl'
810 <<: *email_ptl_defaults
812 trinath.somanchi@gmail.com
815 name: 'email-ovno-ptl'
818 <<: *email_ptl_defaults
823 name: 'email-ovsnfv-ptl'
826 <<: *email_ptl_defaults
828 MarkD.Graymark.d.gray@intel.com
831 name: 'email-parser-ptl'
834 <<: *email_ptl_defaults
836 shang.xiaodong@zte.com.cn
838 - publisher: &email_pharos_ptl_defaults
839 name: 'email-pharos-ptl'
842 <<: *email_ptl_defaults
844 zhang.jun3g@zte.com.cn
846 name: 'email-pharos-tools-ptl'
847 <<: *email_pharos_ptl_defaults
850 name: 'email-promise-ptl'
853 <<: *email_ptl_defaults
855 kunzmann@docomolab-euro.com
858 name: 'email-qtip-ptl'
861 <<: *email_ptl_defaults
863 wu.zhihui1@zte.com.cn
865 - publisher: &email_releng_ptl_defaults
866 name: 'email-releng-ptl'
869 <<: *email_ptl_defaults
871 fatih.degirmenci@ericsson.com
873 name: 'email-releng-anteater-ptl'
874 <<: *email_releng_ptl_defaults
876 name: 'email-releng-testresults-ptl'
879 <<: *email_ptl_defaults
881 fatih.degirmenci@ericsson.com
882 feng.xiaowei@zte.com.cn
884 name: 'email-releng-utils-ptl'
885 <<: *email_releng_ptl_defaults
887 name: 'email-releng-xci-ptl'
888 <<: *email_releng_ptl_defaults
891 name: 'email-samplevnf-ptl'
894 <<: *email_ptl_defaults
899 name: 'email-sdnvpn-ptl'
902 <<: *email_ptl_defaults
904 tim.irnich@ericsson.com
907 name: 'email-securityscanning-ptl'
910 <<: *email_ptl_defaults
915 name: 'email-sfc-ptl'
918 <<: *email_ptl_defaults
923 name: 'email-snaps-ptl'
926 <<: *email_ptl_defaults
928 s.pisarski@cablelabs.com
931 name: 'email-stor4nfv-ptl'
934 <<: *email_ptl_defaults
939 name: 'email-storperf-ptl'
942 <<: *email_ptl_defaults
947 name: 'email-ves-ptl'
950 <<: *email_ptl_defaults
952 bryan.sullivan@att.com
955 name: 'email-vswitchperf-ptl'
958 <<: *email_ptl_defaults
960 sridhar.rao@spirent.com
963 name: 'email-yardstick-ptl'
966 <<: *email_ptl_defaults
968 ross.b.brattain@intel.com
971 name: 'report-provision-result'
974 script-only-if-succeeded: true
977 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
978 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
979 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
981 !include-raw: installer-report.sh
983 script-only-if-succeeded: false
984 script-only-if-failed: true
987 echo "export PROVISION_RESULT=FAIL" >> $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