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
125 name: git-scm-with-submodules
128 credentials-id: '$SSH_CREDENTIAL_ID'
132 - 'refs/heads/{branch}'
141 name: git-scm-openstack
143 - git: &git-scm-openstack-defaults
152 name: 'daily-trigger-disabled'
157 name: 'weekly-trigger-disabled'
162 name: gerrit-trigger-patchset-created
165 server-name: 'gerrit.opnfv.org'
167 - patchset-created-event:
168 exclude-drafts: 'false'
169 exclude-trivial-rebase: 'false'
170 exclude-no-code-change: 'false'
171 - draft-published-event
172 - comment-added-contains-event:
173 comment-contains-value: 'recheck'
174 - comment-added-contains-event:
175 comment-contains-value: 'reverify'
177 - project-compare-type: 'ANT'
178 project-pattern: '{project}'
180 - branch-compare-type: 'ANT'
181 branch-pattern: '**/{branch}'
183 - compare-type: 'ANT'
192 name: gerrit-trigger-change-merged
195 server-name: 'gerrit.opnfv.org'
197 - change-merged-event
198 - comment-added-contains-event:
199 comment-contains-value: 'remerge'
201 - project-compare-type: 'ANT'
202 project-pattern: '{project}'
204 - branch-compare-type: 'ANT'
205 branch-pattern: '**/{branch}'
207 - compare-type: 'ANT'
211 name: gerrit-trigger-tag-created
214 server-name: 'gerrit.opnfv.org'
218 - project-compare-type: 'ANT'
219 project-pattern: '{project}'
221 - branch-compare-type: 'ANT'
222 branch-pattern: 'refs/tags/**'
228 server-name: 'gerrit.opnfv.org'
230 - comment-added-contains-event:
231 comment-contains-value: 'check-experimental'
233 - project-compare-type: 'ANT'
234 project-pattern: '{project}'
236 - branch-compare-type: 'ANT'
237 branch-pattern: '**/{branch}'
239 - compare-type: 'ANT'
248 name: ssh-agent-wrapper
250 - ssh-agent-credentials:
252 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
259 timeout-var: 'BUILD_TIMEOUT'
263 name: fix-workspace-permissions
268 sudo chown -R $USER:$USER $WORKSPACE || exit 1
271 name: upload-under-review-docs-to-opnfv-artifacts
278 export PATH=$PATH:/usr/local/bin/
280 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
281 [[ -d docs/_build/ ]] || exit 0
284 echo "###########################"
285 echo "UPLOADING DOCS UNDER REVIEW"
286 echo "###########################"
289 gs_base="artifacts.opnfv.org/$PROJECT/review"
290 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
291 local_path="upload/$GERRIT_CHANGE_NUMBER"
294 mv docs/_build/html/ "$local_path"
295 gsutil -m cp -r "$local_path" "gs://$gs_base"
298 -h "Content-Type:text/html" \
299 -h "Cache-Control:private, max-age=0, no-transform" \
300 "gs://$gs_path"/**.html > /dev/null 2>&1
302 echo "Document link(s):" >> gerrit_comment.txt
303 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
304 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
306 # To take advantage of this macro, have your build write
307 # out the file 'gerrit_comment.txt' with information to post
308 # back to gerrit and include this macro in the list of builders.
310 name: report-build-result-to-gerrit
317 export PATH=$PATH:/usr/local/bin/
318 if [[ -e gerrit_comment.txt ]] ; then
320 echo "posting review comment to gerrit..."
322 cat gerrit_comment.txt
324 ssh -p 29418 gerrit.opnfv.org \
325 "gerrit review -p $GERRIT_PROJECT \
326 -m '$(cat gerrit_comment.txt)' \
327 $GERRIT_PATCHSET_REVISION \
332 name: remove-old-docs-from-opnfv-artifacts
339 export PATH=$PATH:/usr/local/bin/
341 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
343 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
345 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
347 echo "Deleting Out-of-dated Documents..."
348 gsutil -m rm -r "gs://$gs_path"
350 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
352 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
354 echo "Deleting Out-of-dated Documents..."
355 gsutil -m rm -r "gs://$gs_path"
359 name: upload-review-docs
361 - upload-under-review-docs-to-opnfv-artifacts
362 - report-build-result-to-gerrit
369 # Ensure we start with a clean environment
370 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
371 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
378 if [[ -s violation.log ]]; then
380 echo "Reporting lint result...."
382 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
383 sed -i -e "1s#^#${msg}\n\n#" violation.log
384 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
385 ssh -p 29418 gerrit.opnfv.org "$cmd"
387 # Make sure the caller job failed
396 echo "Checking bash code..."
397 for f in $(egrep '\.sh$' modified_files)
399 bash -n "$f" 2>> bash-violation.log
401 if [[ -s bash-violation.log ]]; then
402 echo -e "Bash syntax error(s)\n---" >> violation.log
403 sed -e 's/^/ /g' bash-violation.log >> violation.log
407 name: lint-python-code
411 # Install python package
412 sudo pip install "flake8==2.6.2"
414 echo "Checking python code..."
415 for f in $(egrep '\.py$' modified_files)
417 flake8 "$f" >> python-violation.log
419 if [[ -s python-violation.log ]]; then
420 echo -e "Python violation(s)\n---" >> violation.log
421 sed -e 's/^/ /g' python-violation.log >> violation.log
429 # sudo Install python packages
430 sudo pip install "yamllint==1.8.2"
432 echo "Checking yaml file..."
433 for f in $(egrep '\.ya?ml$' modified_files)
435 yamllint "$f" >> yaml-violation.log
437 if [[ -s yaml-violation.log ]]; then
438 echo -e "YAML violation(s)\n---" >> violation.log
439 sed -e 's/^/ /g' yaml-violation.log >> violation.log
452 name: clean-workspace
459 sudo /bin/rm -rf "$WORKSPACE"
462 name: clean-workspace-log
465 find $WORKSPACE -type f -name '*.log' | xargs rm -f
468 name: track-begin-timestamp
471 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
474 name: archive-artifacts
477 artifacts: '{artifacts}'
483 name: publish-coverage
486 report-file: "coverage.xml"
488 health-auto-update: "false"
489 stability-auto-update: "false"
490 zoom-coverage-chart: "true"
501 # The majority of the email-ext plugin options are set to the default
502 # for this macro so they can be managed through Jenkins' global
505 name: email-jenkins-admins-on-failure
509 attach-build-log: true
516 # Email PTL publishers
517 - email_ptl_defaults: &email_ptl_defaults
518 name: 'email_ptl_defaults'
520 attach-build-log: true
526 - publisher: &email_apex_ptl_defaults
527 name: 'email-apex-ptl'
530 <<: *email_ptl_defaults
534 name: 'email-apex-os-net-config-ptl'
535 <<: *email_apex_ptl_defaults
537 name: 'email-apex-puppet-tripleo-ptl'
538 <<: *email_apex_ptl_defaults
540 name: 'email-apex-tripleo-heat-templates-ptl'
541 <<: *email_apex_ptl_defaults
544 name: 'email-armband-ptl'
547 <<: *email_ptl_defaults
552 name: 'email-auto-ptl'
555 <<: *email_ptl_defaults
560 name: 'email-availability-ptl'
563 <<: *email_ptl_defaults
565 fuqiao@chinamobile.com
568 name: 'email-bamboo-ptl'
571 <<: *email_ptl_defaults
576 name: 'email-barometer-ptl'
579 <<: *email_ptl_defaults
584 name: 'email-bottlenecks-ptl'
587 <<: *email_ptl_defaults
589 gabriel.yuyang@huawei.com
592 name: 'email-calipso-ptl'
595 <<: *email_ptl_defaults
600 name: 'email-clover-ptl'
603 <<: *email_ptl_defaults
605 stephen.wong1@huawei.com
607 - publisher: &email_compass4nfv_ptl_defaults
608 name: 'email-compass4nfv-ptl'
611 <<: *email_ptl_defaults
615 name: 'email-compass-containers-ptl'
616 <<: *email_compass4nfv_ptl_defaults
619 name: 'email-conductor-ptl'
622 <<: *email_ptl_defaults
624 limingjiang@huawei.com
627 name: 'email-container4nfv-ptl'
630 <<: *email_ptl_defaults
632 jiaxuan@chinamobile.com
635 name: 'email-copper-ptl'
638 <<: *email_ptl_defaults
640 aimeeu.opensource@gmail.com
643 name: 'email-cperf-ptl'
646 <<: *email_ptl_defaults
651 name: 'email-daisy-ptl'
654 <<: *email_ptl_defaults
656 hu.zhijiang@zte.com.cn
659 name: 'email-doctor-ptl'
662 <<: *email_ptl_defaults
667 name: 'email-domino-ptl'
670 <<: *email_ptl_defaults
672 ulas.kozat@huawei.com
675 name: 'email-dovetail-ptl'
678 <<: *email_ptl_defaults
680 georg.kunz@ericsson.com
683 name: 'email-dpacc-ptl'
686 <<: *email_ptl_defaults
688 denglingli@chinamobile.com
691 name: 'email-enfv-ptl'
694 <<: *email_ptl_defaults
696 JBuchanan@advaoptical.com
699 name: 'email-fds-ptl'
702 <<: *email_ptl_defaults
707 name: 'email-fuel-ptl'
710 <<: *email_ptl_defaults
712 gelkinbard@mirantis.com
715 name: 'email-functest-ptl'
718 <<: *email_ptl_defaults
720 cedric.ollivier@orange.com
723 name: 'email-ipv6-ptl'
726 <<: *email_ptl_defaults
731 name: 'email-joid-ptl'
734 <<: *email_ptl_defaults
736 artur.tyloch@canonical.com
739 name: 'email-kvmfornfv-ptl'
742 <<: *email_ptl_defaults
744 raghuveer.reddy@intel.com
747 name: 'email-models-ptl'
750 <<: *email_ptl_defaults
755 name: 'email-moon-ptl'
758 <<: *email_ptl_defaults
763 name: 'email-netready-ptl'
766 <<: *email_ptl_defaults
768 georg.kunz@ericsson.com
771 name: 'email-nfvbench-ptl'
774 <<: *email_ptl_defaults
779 name: 'email-onosfw-ptl'
782 <<: *email_ptl_defaults
787 name: 'email-opera-ptl'
790 <<: *email_ptl_defaults
792 Yingjun.li@huawei.com
795 name: 'email-opnfvdocs-ptl'
798 <<: *email_ptl_defaults
800 sofia.wallin@ericsson.com
803 name: 'email-orchestra-ptl'
806 <<: *email_ptl_defaults
808 giuseppe.carella@fokus.fraunhofer.de
811 name: 'email-ovn4nfv-ptl'
814 <<: *email_ptl_defaults
816 trinath.somanchi@gmail.com
819 name: 'email-ovno-ptl'
822 <<: *email_ptl_defaults
827 name: 'email-ovsnfv-ptl'
830 <<: *email_ptl_defaults
832 MarkD.Graymark.d.gray@intel.com
835 name: 'email-parser-ptl'
838 <<: *email_ptl_defaults
840 shang.xiaodong@zte.com.cn
842 - publisher: &email_pharos_ptl_defaults
843 name: 'email-pharos-ptl'
846 <<: *email_ptl_defaults
848 zhang.jun3g@zte.com.cn
850 name: 'email-pharos-tools-ptl'
851 <<: *email_pharos_ptl_defaults
854 name: 'email-promise-ptl'
857 <<: *email_ptl_defaults
859 kunzmann@docomolab-euro.com
862 name: 'email-qtip-ptl'
865 <<: *email_ptl_defaults
867 wu.zhihui1@zte.com.cn
869 - publisher: &email_releng_ptl_defaults
870 name: 'email-releng-ptl'
873 <<: *email_ptl_defaults
875 fatih.degirmenci@ericsson.com
877 name: 'email-releng-anteater-ptl'
878 <<: *email_releng_ptl_defaults
880 name: 'email-releng-testresults-ptl'
883 <<: *email_ptl_defaults
885 fatih.degirmenci@ericsson.com
886 feng.xiaowei@zte.com.cn
888 name: 'email-releng-utils-ptl'
889 <<: *email_releng_ptl_defaults
891 name: 'email-releng-xci-ptl'
892 <<: *email_releng_ptl_defaults
895 name: 'email-samplevnf-ptl'
898 <<: *email_ptl_defaults
903 name: 'email-sdnvpn-ptl'
906 <<: *email_ptl_defaults
908 tim.irnich@ericsson.com
911 name: 'email-securityscanning-ptl'
914 <<: *email_ptl_defaults
919 name: 'email-sfc-ptl'
922 <<: *email_ptl_defaults
927 name: 'email-snaps-ptl'
930 <<: *email_ptl_defaults
932 s.pisarski@cablelabs.com
935 name: 'email-stor4nfv-ptl'
938 <<: *email_ptl_defaults
943 name: 'email-storperf-ptl'
946 <<: *email_ptl_defaults
951 name: 'email-ves-ptl'
954 <<: *email_ptl_defaults
956 bryan.sullivan@att.com
959 name: 'email-vswitchperf-ptl'
962 <<: *email_ptl_defaults
964 sridhar.rao@spirent.com
967 name: 'email-yardstick-ptl'
970 <<: *email_ptl_defaults
972 ross.b.brattain@intel.com
975 name: 'report-provision-result'
978 script-only-if-succeeded: true
981 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
982 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
983 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
985 !include-raw: installer-report.sh
987 script-only-if-succeeded: false
988 script-only-if-failed: true
991 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
992 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
993 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
995 !include-raw: installer-report.sh