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-escalator-ptl'
698 <<: *email_ptl_defaults
703 name: 'email-fastpathmetrics-ptl'
706 <<: *email_ptl_defaults
708 maryam.tahhan@intel.com
711 name: 'email-fds-ptl'
714 <<: *email_ptl_defaults
719 name: 'email-fuel-ptl'
722 <<: *email_ptl_defaults
724 gelkinbard@mirantis.com
727 name: 'email-functest-ptl'
730 <<: *email_ptl_defaults
732 cedric.ollivier@orange.com
735 name: 'email-ipv6-ptl'
738 <<: *email_ptl_defaults
743 name: 'email-joid-ptl'
746 <<: *email_ptl_defaults
748 artur.tyloch@canonical.com
751 name: 'email-kvmfornfv-ptl'
754 <<: *email_ptl_defaults
756 raghuveer.reddy@intel.com
759 name: 'email-models-ptl'
762 <<: *email_ptl_defaults
767 name: 'email-moon-ptl'
770 <<: *email_ptl_defaults
775 name: 'email-multisite-ptl'
778 <<: *email_ptl_defaults
783 name: 'email-netready-ptl'
786 <<: *email_ptl_defaults
788 georg.kunz@ericsson.com
791 name: 'email-nfvbench-ptl'
794 <<: *email_ptl_defaults
799 name: 'email-octopus-ptl'
802 <<: *email_ptl_defaults
804 ulrich.kleber@huawei.com
807 name: 'email-onosfw-ptl'
810 <<: *email_ptl_defaults
815 name: 'email-openretriever-ptl'
818 <<: *email_ptl_defaults
820 jiaxuan@chinamobile.com
823 name: 'email-opera-ptl'
826 <<: *email_ptl_defaults
828 Yingjun.li@huawei.com
831 name: 'email-opnfvdocs-ptl'
834 <<: *email_ptl_defaults
836 sofia.wallin@ericsson.com
839 name: 'email-orchestra-ptl'
842 <<: *email_ptl_defaults
844 giuseppe.carella@fokus.fraunhofer.de
847 name: 'email-ovn4nfv-ptl'
850 <<: *email_ptl_defaults
852 trinath.somanchi@gmail.com
855 name: 'email-ovno-ptl'
858 <<: *email_ptl_defaults
863 name: 'email-ovsnfv-ptl'
866 <<: *email_ptl_defaults
868 MarkD.Graymark.d.gray@intel.com
871 name: 'email-parser-ptl'
874 <<: *email_ptl_defaults
876 shang.xiaodong@zte.com.cn
878 - publisher: &email_pharos_ptl_defaults
879 name: 'email-pharos-ptl'
882 <<: *email_ptl_defaults
884 zhang.jun3g@zte.com.cn
886 name: 'email-pharos-tools-ptl'
887 <<: *email_pharos_ptl_defaults
890 name: 'email-promise-ptl'
893 <<: *email_ptl_defaults
895 kunzmann@docomolab-euro.com
898 name: 'email-qtip-ptl'
901 <<: *email_ptl_defaults
903 wu.zhihui1@zte.com.cn
905 - publisher: &email_releng_ptl_defaults
906 name: 'email-releng-ptl'
909 <<: *email_ptl_defaults
911 fatih.degirmenci@ericsson.com
913 name: 'email-releng-anteater-ptl'
914 <<: *email_releng_ptl_defaults
916 name: 'email-releng-testresults-ptl'
919 <<: *email_ptl_defaults
921 fatih.degirmenci@ericsson.com
922 feng.xiaowei@zte.com.cn
924 name: 'email-releng-utils-ptl'
925 <<: *email_releng_ptl_defaults
927 name: 'email-releng-xci-ptl'
928 <<: *email_releng_ptl_defaults
931 name: 'email-samplevnf-ptl'
934 <<: *email_ptl_defaults
939 name: 'email-sdnvpn-ptl'
942 <<: *email_ptl_defaults
944 tim.irnich@ericsson.com
947 name: 'email-securityscanning-ptl'
950 <<: *email_ptl_defaults
955 name: 'email-sfc-ptl'
958 <<: *email_ptl_defaults
963 name: 'email-snaps-ptl'
966 <<: *email_ptl_defaults
968 s.pisarski@cablelabs.com
971 name: 'email-stor4nfv-ptl'
974 <<: *email_ptl_defaults
979 name: 'email-storperf-ptl'
982 <<: *email_ptl_defaults
987 name: 'email-ves-ptl'
990 <<: *email_ptl_defaults
992 bryan.sullivan@att.com
995 name: 'email-vswitchperf-ptl'
998 <<: *email_ptl_defaults
1000 sridhar.rao@spirent.com
1003 name: 'email-yardstick-ptl'
1006 <<: *email_ptl_defaults
1008 ross.b.brattain@intel.com
1011 name: 'report-provision-result'
1014 script-only-if-succeeded: true
1017 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
1018 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1019 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1021 !include-raw: installer-report.sh
1023 script-only-if-succeeded: false
1024 script-only-if-failed: true
1027 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1028 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1029 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1031 !include-raw: installer-report.sh