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'
121 choosing-strategy: 'gerrit'
122 refspec: '$GERRIT_REFSPEC'
123 <<: *git-scm-defaults
126 name: git-scm-gerrit-with-submodules
129 choosing-strategy: 'gerrit'
130 refspec: '$GERRIT_REFSPEC'
134 <<: *git-scm-defaults
136 name: git-scm-with-submodules
139 credentials-id: '$SSH_CREDENTIAL_ID'
143 - 'refs/heads/{branch}'
152 name: git-scm-openstack
154 - git: &git-scm-openstack-defaults
163 name: 'daily-trigger-disabled'
168 name: 'weekly-trigger-disabled'
173 name: gerrit-trigger-patchset-created
176 server-name: 'gerrit.opnfv.org'
178 - patchset-created-event:
179 exclude-drafts: 'false'
180 exclude-trivial-rebase: 'false'
181 exclude-no-code-change: 'false'
182 - draft-published-event
183 - comment-added-contains-event:
184 comment-contains-value: 'recheck'
185 - comment-added-contains-event:
186 comment-contains-value: 'reverify'
188 - project-compare-type: 'ANT'
189 project-pattern: '{project}'
191 - branch-compare-type: 'ANT'
192 branch-pattern: '**/{branch}'
194 - compare-type: 'ANT'
203 name: gerrit-trigger-change-merged
206 server-name: 'gerrit.opnfv.org'
208 - change-merged-event
209 - comment-added-contains-event:
210 comment-contains-value: 'remerge'
212 - project-compare-type: 'ANT'
213 project-pattern: '{project}'
215 - branch-compare-type: 'ANT'
216 branch-pattern: '**/{branch}'
218 - compare-type: 'ANT'
222 name: gerrit-trigger-tag-created
225 server-name: 'gerrit.opnfv.org'
229 - project-compare-type: 'ANT'
230 project-pattern: '{project}'
232 - branch-compare-type: 'ANT'
233 branch-pattern: 'refs/tags/**'
239 server-name: 'gerrit.opnfv.org'
241 - comment-added-contains-event:
242 comment-contains-value: 'check-experimental'
244 - project-compare-type: 'ANT'
245 project-pattern: '{project}'
247 - branch-compare-type: 'ANT'
248 branch-pattern: '**/{branch}'
250 - compare-type: 'ANT'
259 name: ssh-agent-wrapper
261 - ssh-agent-credentials:
263 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
270 timeout-var: 'BUILD_TIMEOUT'
274 name: fix-workspace-permissions
279 sudo chown -R $USER:$USER $WORKSPACE || exit 1
282 name: upload-under-review-docs-to-opnfv-artifacts
289 export PATH=$PATH:/usr/local/bin/
291 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
292 [[ -d docs/_build/ ]] || exit 0
295 echo "###########################"
296 echo "UPLOADING DOCS UNDER REVIEW"
297 echo "###########################"
300 gs_base="artifacts.opnfv.org/$PROJECT/review"
301 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
302 local_path="upload/$GERRIT_CHANGE_NUMBER"
305 mv docs/_build/html/ "$local_path"
306 gsutil -m cp -r "$local_path" "gs://$gs_base"
309 -h "Content-Type:text/html" \
310 -h "Cache-Control:private, max-age=0, no-transform" \
311 "gs://$gs_path"/**.html > /dev/null 2>&1
313 echo "Document link(s):" >> gerrit_comment.txt
314 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
315 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
317 # To take advantage of this macro, have your build write
318 # out the file 'gerrit_comment.txt' with information to post
319 # back to gerrit and include this macro in the list of builders.
321 name: report-build-result-to-gerrit
328 export PATH=$PATH:/usr/local/bin/
329 if [[ -e gerrit_comment.txt ]] ; then
331 echo "posting review comment to gerrit..."
333 cat gerrit_comment.txt
335 ssh -p 29418 gerrit.opnfv.org \
336 "gerrit review -p $GERRIT_PROJECT \
337 -m '$(cat gerrit_comment.txt)' \
338 $GERRIT_PATCHSET_REVISION \
343 name: remove-old-docs-from-opnfv-artifacts
350 export PATH=$PATH:/usr/local/bin/
352 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
354 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
356 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
358 echo "Deleting Out-of-dated Documents..."
359 gsutil -m rm -r "gs://$gs_path"
361 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
363 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
365 echo "Deleting Out-of-dated Documents..."
366 gsutil -m rm -r "gs://$gs_path"
370 name: upload-review-docs
372 - upload-under-review-docs-to-opnfv-artifacts
373 - report-build-result-to-gerrit
380 # Ensure we start with a clean environment
381 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
382 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
389 if [[ -s violation.log ]]; then
391 echo "Reporting lint result...."
393 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
394 sed -i -e "1s#^#${msg}\n\n#" violation.log
395 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
396 ssh -p 29418 gerrit.opnfv.org "$cmd"
398 # Make sure the caller job failed
407 echo "Checking bash code..."
408 for f in $(egrep '\.sh$' modified_files)
410 bash -n "$f" 2>> bash-violation.log
412 if [[ -s bash-violation.log ]]; then
413 echo -e "Bash syntax error(s)\n---" >> violation.log
414 sed -e 's/^/ /g' bash-violation.log >> violation.log
418 name: lint-python-code
422 # Install python package
423 sudo pip install "flake8==2.6.2"
425 echo "Checking python code..."
426 for f in $(egrep '\.py$' modified_files)
428 flake8 "$f" >> python-violation.log
430 if [[ -s python-violation.log ]]; then
431 echo -e "Python violation(s)\n---" >> violation.log
432 sed -e 's/^/ /g' python-violation.log >> violation.log
440 # sudo Install python packages
441 sudo pip install "yamllint==1.8.2"
443 echo "Checking yaml file..."
444 for f in $(egrep '\.ya?ml$' modified_files)
446 yamllint "$f" >> yaml-violation.log
448 if [[ -s yaml-violation.log ]]; then
449 echo -e "YAML violation(s)\n---" >> violation.log
450 sed -e 's/^/ /g' yaml-violation.log >> violation.log
463 name: clean-workspace
470 sudo /bin/rm -rf "$WORKSPACE"
473 name: clean-workspace-log
476 find $WORKSPACE -type f -name '*.log' | xargs rm -f
479 name: track-begin-timestamp
482 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
485 name: archive-artifacts
488 artifacts: '{artifacts}'
494 name: publish-coverage
497 report-file: "coverage.xml"
499 health-auto-update: "false"
500 stability-auto-update: "false"
501 zoom-coverage-chart: "true"
512 # The majority of the email-ext plugin options are set to the default
513 # for this macro so they can be managed through Jenkins' global
516 name: email-jenkins-admins-on-failure
520 attach-build-log: true
527 # Email PTL publishers
528 - email_ptl_defaults: &email_ptl_defaults
529 name: 'email_ptl_defaults'
531 attach-build-log: true
537 - publisher: &email_apex_ptl_defaults
538 name: 'email-apex-ptl'
541 <<: *email_ptl_defaults
545 name: 'email-apex-os-net-config-ptl'
546 <<: *email_apex_ptl_defaults
548 name: 'email-apex-puppet-tripleo-ptl'
549 <<: *email_apex_ptl_defaults
551 name: 'email-apex-tripleo-heat-templates-ptl'
552 <<: *email_apex_ptl_defaults
555 name: 'email-armband-ptl'
558 <<: *email_ptl_defaults
563 name: 'email-auto-ptl'
566 <<: *email_ptl_defaults
571 name: 'email-availability-ptl'
574 <<: *email_ptl_defaults
576 fuqiao@chinamobile.com
579 name: 'email-bamboo-ptl'
582 <<: *email_ptl_defaults
587 name: 'email-barometer-ptl'
590 <<: *email_ptl_defaults
595 name: 'email-bottlenecks-ptl'
598 <<: *email_ptl_defaults
600 gabriel.yuyang@huawei.com
603 name: 'email-calipso-ptl'
606 <<: *email_ptl_defaults
611 name: 'email-clover-ptl'
614 <<: *email_ptl_defaults
616 stephen.wong1@huawei.com
618 - publisher: &email_compass4nfv_ptl_defaults
619 name: 'email-compass4nfv-ptl'
622 <<: *email_ptl_defaults
626 name: 'email-compass-containers-ptl'
627 <<: *email_compass4nfv_ptl_defaults
630 name: 'email-conductor-ptl'
633 <<: *email_ptl_defaults
635 limingjiang@huawei.com
638 name: 'email-container4nfv-ptl'
641 <<: *email_ptl_defaults
643 jiaxuan@chinamobile.com
646 name: 'email-copper-ptl'
649 <<: *email_ptl_defaults
651 aimeeu.opensource@gmail.com
654 name: 'email-cperf-ptl'
657 <<: *email_ptl_defaults
662 name: 'email-daisy-ptl'
665 <<: *email_ptl_defaults
667 hu.zhijiang@zte.com.cn
670 name: 'email-doctor-ptl'
673 <<: *email_ptl_defaults
678 name: 'email-domino-ptl'
681 <<: *email_ptl_defaults
683 ulas.kozat@huawei.com
686 name: 'email-dovetail-ptl'
689 <<: *email_ptl_defaults
691 georg.kunz@ericsson.com
694 name: 'email-dpacc-ptl'
697 <<: *email_ptl_defaults
699 denglingli@chinamobile.com
702 name: 'email-enfv-ptl'
705 <<: *email_ptl_defaults
707 JBuchanan@advaoptical.com
710 name: 'email-fds-ptl'
713 <<: *email_ptl_defaults
718 name: 'email-fuel-ptl'
721 <<: *email_ptl_defaults
723 gelkinbard@mirantis.com
726 name: 'email-functest-ptl'
729 <<: *email_ptl_defaults
731 cedric.ollivier@orange.com
734 name: 'email-ipv6-ptl'
737 <<: *email_ptl_defaults
742 name: 'email-joid-ptl'
745 <<: *email_ptl_defaults
747 artur.tyloch@canonical.com
750 name: 'email-kvmfornfv-ptl'
753 <<: *email_ptl_defaults
755 raghuveer.reddy@intel.com
758 name: 'email-models-ptl'
761 <<: *email_ptl_defaults
766 name: 'email-moon-ptl'
769 <<: *email_ptl_defaults
774 name: 'email-netready-ptl'
777 <<: *email_ptl_defaults
779 georg.kunz@ericsson.com
782 name: 'email-nfvbench-ptl'
785 <<: *email_ptl_defaults
790 name: 'email-onosfw-ptl'
793 <<: *email_ptl_defaults
798 name: 'email-opera-ptl'
801 <<: *email_ptl_defaults
803 Yingjun.li@huawei.com
806 name: 'email-opnfvdocs-ptl'
809 <<: *email_ptl_defaults
811 sofia.wallin@ericsson.com
814 name: 'email-orchestra-ptl'
817 <<: *email_ptl_defaults
819 giuseppe.carella@fokus.fraunhofer.de
822 name: 'email-ovn4nfv-ptl'
825 <<: *email_ptl_defaults
827 trinath.somanchi@gmail.com
830 name: 'email-ovno-ptl'
833 <<: *email_ptl_defaults
838 name: 'email-ovsnfv-ptl'
841 <<: *email_ptl_defaults
843 MarkD.Graymark.d.gray@intel.com
846 name: 'email-parser-ptl'
849 <<: *email_ptl_defaults
851 shang.xiaodong@zte.com.cn
853 - publisher: &email_pharos_ptl_defaults
854 name: 'email-pharos-ptl'
857 <<: *email_ptl_defaults
859 zhang.jun3g@zte.com.cn
861 name: 'email-pharos-tools-ptl'
862 <<: *email_pharos_ptl_defaults
865 name: 'email-promise-ptl'
868 <<: *email_ptl_defaults
870 kunzmann@docomolab-euro.com
873 name: 'email-qtip-ptl'
876 <<: *email_ptl_defaults
878 wu.zhihui1@zte.com.cn
880 - publisher: &email_releng_ptl_defaults
881 name: 'email-releng-ptl'
884 <<: *email_ptl_defaults
886 fatih.degirmenci@ericsson.com
888 name: 'email-releng-anteater-ptl'
889 <<: *email_releng_ptl_defaults
891 name: 'email-releng-testresults-ptl'
894 <<: *email_ptl_defaults
896 fatih.degirmenci@ericsson.com
897 feng.xiaowei@zte.com.cn
899 name: 'email-releng-utils-ptl'
900 <<: *email_releng_ptl_defaults
902 name: 'email-releng-xci-ptl'
903 <<: *email_releng_ptl_defaults
906 name: 'email-samplevnf-ptl'
909 <<: *email_ptl_defaults
914 name: 'email-sdnvpn-ptl'
917 <<: *email_ptl_defaults
919 tim.irnich@ericsson.com
922 name: 'email-securityscanning-ptl'
925 <<: *email_ptl_defaults
930 name: 'email-sfc-ptl'
933 <<: *email_ptl_defaults
938 name: 'email-snaps-ptl'
941 <<: *email_ptl_defaults
943 s.pisarski@cablelabs.com
946 name: 'email-stor4nfv-ptl'
949 <<: *email_ptl_defaults
954 name: 'email-storperf-ptl'
957 <<: *email_ptl_defaults
962 name: 'email-ves-ptl'
965 <<: *email_ptl_defaults
967 bryan.sullivan@att.com
970 name: 'email-vswitchperf-ptl'
973 <<: *email_ptl_defaults
975 sridhar.rao@spirent.com
978 name: 'email-yardstick-ptl'
981 <<: *email_ptl_defaults
983 ross.b.brattain@intel.com
986 name: 'report-provision-result'
995 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
996 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
997 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
999 !include-raw: installer-report.sh
1000 mark-unstable-if-failed: true
1011 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1012 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1013 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1015 !include-raw: installer-report.sh
1016 mark-unstable-if-failed: true