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'
114 choosing-strategy: 'gerrit'
115 refspec: '$GERRIT_REFSPEC'
116 <<: *git-scm-defaults
118 name: git-scm-with-submodules
121 credentials-id: '$SSH_CREDENTIAL_ID'
125 - 'refs/heads/{branch}'
133 name: git-scm-openstack
135 - git: &git-scm-openstack-defaults
142 name: 'daily-trigger-disabled'
147 name: 'weekly-trigger-disabled'
152 name: gerrit-trigger-patchset-created
155 server-name: 'gerrit.opnfv.org'
157 - patchset-created-event:
158 exclude-drafts: 'false'
159 exclude-trivial-rebase: 'false'
160 exclude-no-code-change: 'false'
161 - draft-published-event
162 - comment-added-contains-event:
163 comment-contains-value: 'recheck'
164 - comment-added-contains-event:
165 comment-contains-value: 'reverify'
167 - project-compare-type: 'ANT'
168 project-pattern: '{project}'
170 - branch-compare-type: 'ANT'
171 branch-pattern: '**/{branch}'
173 - compare-type: 'ANT'
182 name: gerrit-trigger-change-merged
185 server-name: 'gerrit.opnfv.org'
187 - change-merged-event
188 - comment-added-contains-event:
189 comment-contains-value: 'remerge'
191 - project-compare-type: 'ANT'
192 project-pattern: '{project}'
194 - branch-compare-type: 'ANT'
195 branch-pattern: '**/{branch}'
197 - compare-type: 'ANT'
201 name: gerrit-trigger-tag-created
204 server-name: 'gerrit.opnfv.org'
208 - project-compare-type: 'ANT'
209 project-pattern: '{project}'
211 - branch-compare-type: 'ANT'
212 branch-pattern: 'refs/tags/**'
218 server-name: 'gerrit.opnfv.org'
220 - comment-added-contains-event:
221 comment-contains-value: 'check-experimental'
223 - project-compare-type: 'ANT'
224 project-pattern: '{project}'
226 - branch-compare-type: 'ANT'
227 branch-pattern: '**/{branch}'
229 - compare-type: 'ANT'
238 name: ssh-agent-wrapper
240 - ssh-agent-credentials:
242 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
249 timeout-var: 'BUILD_TIMEOUT'
253 name: fix-workspace-permissions
258 sudo chown -R $USER:$USER $WORKSPACE || exit 1
261 name: upload-under-review-docs-to-opnfv-artifacts
268 export PATH=$PATH:/usr/local/bin/
270 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
271 [[ -d docs/_build/ ]] || exit 0
274 echo "###########################"
275 echo "UPLOADING DOCS UNDER REVIEW"
276 echo "###########################"
279 gs_base="artifacts.opnfv.org/$PROJECT/review"
280 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
281 local_path="upload/$GERRIT_CHANGE_NUMBER"
284 mv docs/_build/html/ "$local_path"
285 gsutil -m cp -r "$local_path" "gs://$gs_base"
288 -h "Content-Type:text/html" \
289 -h "Cache-Control:private, max-age=0, no-transform" \
290 "gs://$gs_path"/**.html > /dev/null 2>&1
292 echo "Document link(s):" >> gerrit_comment.txt
293 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
294 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
296 # To take advantage of this macro, have your build write
297 # out the file 'gerrit_comment.txt' with information to post
298 # back to gerrit and include this macro in the list of builders.
300 name: report-build-result-to-gerrit
307 export PATH=$PATH:/usr/local/bin/
308 if [[ -e gerrit_comment.txt ]] ; then
310 echo "posting review comment to gerrit..."
312 cat gerrit_comment.txt
314 ssh -p 29418 gerrit.opnfv.org \
315 "gerrit review -p $GERRIT_PROJECT \
316 -m '$(cat gerrit_comment.txt)' \
317 $GERRIT_PATCHSET_REVISION \
322 name: remove-old-docs-from-opnfv-artifacts
329 export PATH=$PATH:/usr/local/bin/
331 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
333 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
335 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
337 echo "Deleting Out-of-dated Documents..."
338 gsutil -m rm -r "gs://$gs_path"
340 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
342 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
344 echo "Deleting Out-of-dated Documents..."
345 gsutil -m rm -r "gs://$gs_path"
349 name: upload-review-docs
351 - upload-under-review-docs-to-opnfv-artifacts
352 - report-build-result-to-gerrit
359 # Ensure we start with a clean environment
360 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
361 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
368 if [[ -s violation.log ]]; then
370 echo "Reporting lint result...."
372 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
373 sed -i -e "1s#^#${msg}\n\n#" violation.log
374 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
375 ssh -p 29418 gerrit.opnfv.org "$cmd"
377 # Make sure the caller job failed
386 echo "Checking bash code..."
387 for f in $(egrep '\.sh$' modified_files)
389 bash -n "$f" 2>> bash-violation.log
391 if [[ -s bash-violation.log ]]; then
392 echo -e "Bash syntax error(s)\n---" >> violation.log
393 sed -e 's/^/ /g' bash-violation.log >> violation.log
397 name: lint-python-code
401 # Install python package
402 sudo pip install "flake8==2.6.2"
404 echo "Checking python code..."
405 for f in $(egrep '\.py$' modified_files)
407 flake8 "$f" >> python-violation.log
409 if [[ -s python-violation.log ]]; then
410 echo -e "Python violation(s)\n---" >> violation.log
411 sed -e 's/^/ /g' python-violation.log >> violation.log
419 # sudo Install python packages
420 sudo pip install "yamllint==1.8.2"
422 echo "Checking yaml file..."
423 for f in $(egrep '\.ya?ml$' modified_files)
425 yamllint "$f" >> yaml-violation.log
427 if [[ -s yaml-violation.log ]]; then
428 echo -e "YAML violation(s)\n---" >> violation.log
429 sed -e 's/^/ /g' yaml-violation.log >> violation.log
442 name: clean-workspace
449 sudo /bin/rm -rf "$WORKSPACE"
452 name: clean-workspace-log
455 find $WORKSPACE -type f -name '*.log' | xargs rm -f
458 name: track-begin-timestamp
461 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
464 name: archive-artifacts
467 artifacts: '{artifacts}'
473 name: publish-coverage
476 report-file: "coverage.xml"
478 health-auto-update: "false"
479 stability-auto-update: "false"
480 zoom-coverage-chart: "true"
491 # The majority of the email-ext plugin options are set to the default
492 # for this macro so they can be managed through Jenkins' global
495 name: email-jenkins-admins-on-failure
499 attach-build-log: true
506 # Email PTL publishers
507 - email_ptl_defaults: &email_ptl_defaults
508 name: 'email_ptl_defaults'
510 attach-build-log: true
516 - publisher: &email_apex_ptl_defaults
517 name: 'email-apex-ptl'
520 <<: *email_ptl_defaults
524 name: 'email-apex-os-net-config-ptl'
525 <<: *email_apex_ptl_defaults
527 name: 'email-apex-puppet-tripleo-ptl'
528 <<: *email_apex_ptl_defaults
530 name: 'email-apex-tripleo-heat-templates-ptl'
531 <<: *email_apex_ptl_defaults
534 name: 'email-armband-ptl'
537 <<: *email_ptl_defaults
542 name: 'email-auto-ptl'
545 <<: *email_ptl_defaults
550 name: 'email-availability-ptl'
553 <<: *email_ptl_defaults
555 fuqiao@chinamobile.com
558 name: 'email-bamboo-ptl'
561 <<: *email_ptl_defaults
566 name: 'email-barometer-ptl'
569 <<: *email_ptl_defaults
574 name: 'email-bottlenecks-ptl'
577 <<: *email_ptl_defaults
579 gabriel.yuyang@huawei.com
582 name: 'email-calipso-ptl'
585 <<: *email_ptl_defaults
590 name: 'email-clover-ptl'
593 <<: *email_ptl_defaults
595 stephen.wong1@huawei.com
597 - publisher: &email_compass4nfv_ptl_defaults
598 name: 'email-compass4nfv-ptl'
601 <<: *email_ptl_defaults
605 name: 'email-compass-containers-ptl'
606 <<: *email_compass4nfv_ptl_defaults
609 name: 'email-conductor-ptl'
612 <<: *email_ptl_defaults
614 limingjiang@huawei.com
617 name: 'email-container4nfv-ptl'
620 <<: *email_ptl_defaults
622 jiaxuan@chinamobile.com
625 name: 'email-copper-ptl'
628 <<: *email_ptl_defaults
630 aimeeu.opensource@gmail.com
633 name: 'email-cperf-ptl'
636 <<: *email_ptl_defaults
641 name: 'email-daisy-ptl'
644 <<: *email_ptl_defaults
646 hu.zhijiang@zte.com.cn
649 name: 'email-doctor-ptl'
652 <<: *email_ptl_defaults
657 name: 'email-domino-ptl'
660 <<: *email_ptl_defaults
662 ulas.kozat@huawei.com
665 name: 'email-dovetail-ptl'
668 <<: *email_ptl_defaults
670 georg.kunz@ericsson.com
673 name: 'email-dpacc-ptl'
676 <<: *email_ptl_defaults
678 denglingli@chinamobile.com
681 name: 'email-enfv-ptl'
684 <<: *email_ptl_defaults
686 JBuchanan@advaoptical.com
689 name: 'email-escalator-ptl'
692 <<: *email_ptl_defaults
697 name: 'email-fastpathmetrics-ptl'
700 <<: *email_ptl_defaults
702 maryam.tahhan@intel.com
705 name: 'email-fds-ptl'
708 <<: *email_ptl_defaults
713 name: 'email-fuel-ptl'
716 <<: *email_ptl_defaults
718 gelkinbard@mirantis.com
721 name: 'email-functest-ptl'
724 <<: *email_ptl_defaults
726 cedric.ollivier@orange.com
729 name: 'email-ipv6-ptl'
732 <<: *email_ptl_defaults
737 name: 'email-joid-ptl'
740 <<: *email_ptl_defaults
742 artur.tyloch@canonical.com
745 name: 'email-kvmfornfv-ptl'
748 <<: *email_ptl_defaults
750 raghuveer.reddy@intel.com
753 name: 'email-models-ptl'
756 <<: *email_ptl_defaults
761 name: 'email-moon-ptl'
764 <<: *email_ptl_defaults
769 name: 'email-multisite-ptl'
772 <<: *email_ptl_defaults
777 name: 'email-netready-ptl'
780 <<: *email_ptl_defaults
782 georg.kunz@ericsson.com
785 name: 'email-nfvbench-ptl'
788 <<: *email_ptl_defaults
793 name: 'email-octopus-ptl'
796 <<: *email_ptl_defaults
798 ulrich.kleber@huawei.com
801 name: 'email-onosfw-ptl'
804 <<: *email_ptl_defaults
809 name: 'email-openretriever-ptl'
812 <<: *email_ptl_defaults
814 jiaxuan@chinamobile.com
817 name: 'email-opera-ptl'
820 <<: *email_ptl_defaults
822 Yingjun.li@huawei.com
825 name: 'email-opnfvdocs-ptl'
828 <<: *email_ptl_defaults
830 sofia.wallin@ericsson.com
833 name: 'email-orchestra-ptl'
836 <<: *email_ptl_defaults
838 giuseppe.carella@fokus.fraunhofer.de
841 name: 'email-ovn4nfv-ptl'
844 <<: *email_ptl_defaults
846 trinath.somanchi@gmail.com
849 name: 'email-ovno-ptl'
852 <<: *email_ptl_defaults
857 name: 'email-ovsnfv-ptl'
860 <<: *email_ptl_defaults
862 MarkD.Graymark.d.gray@intel.com
865 name: 'email-parser-ptl'
868 <<: *email_ptl_defaults
870 shang.xiaodong@zte.com.cn
872 - publisher: &email_pharos_ptl_defaults
873 name: 'email-pharos-ptl'
876 <<: *email_ptl_defaults
878 zhang.jun3g@zte.com.cn
880 name: 'email-pharos-tools-ptl'
881 <<: *email_pharos_ptl_defaults
884 name: 'email-promise-ptl'
887 <<: *email_ptl_defaults
889 kunzmann@docomolab-euro.com
892 name: 'email-qtip-ptl'
895 <<: *email_ptl_defaults
897 wu.zhihui1@zte.com.cn
899 - publisher: &email_releng_ptl_defaults
900 name: 'email-releng-ptl'
903 <<: *email_ptl_defaults
905 fatih.degirmenci@ericsson.com
907 name: 'email-releng-anteater-ptl'
908 <<: *email_releng_ptl_defaults
910 name: 'email-releng-testresults-ptl'
913 <<: *email_ptl_defaults
915 fatih.degirmenci@ericsson.com
916 feng.xiaowei@zte.com.cn
918 name: 'email-releng-utils-ptl'
919 <<: *email_releng_ptl_defaults
921 name: 'email-releng-xci-ptl'
922 <<: *email_releng_ptl_defaults
925 name: 'email-samplevnf-ptl'
928 <<: *email_ptl_defaults
933 name: 'email-sdnvpn-ptl'
936 <<: *email_ptl_defaults
938 tim.irnich@ericsson.com
941 name: 'email-securityscanning-ptl'
944 <<: *email_ptl_defaults
949 name: 'email-sfc-ptl'
952 <<: *email_ptl_defaults
957 name: 'email-snaps-ptl'
960 <<: *email_ptl_defaults
962 s.pisarski@cablelabs.com
965 name: 'email-stor4nfv-ptl'
968 <<: *email_ptl_defaults
973 name: 'email-storperf-ptl'
976 <<: *email_ptl_defaults
981 name: 'email-ves-ptl'
984 <<: *email_ptl_defaults
986 bryan.sullivan@att.com
989 name: 'email-vswitchperf-ptl'
992 <<: *email_ptl_defaults
994 sridhar.rao@spirent.com
997 name: 'email-yardstick-ptl'
1000 <<: *email_ptl_defaults
1002 ross.b.brattain@intel.com
1005 name: 'report-provision-result'
1008 script-only-if-succeeded: true
1011 echo "export PROVISION_RESULT=PASS" >> $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
1017 script-only-if-succeeded: false
1018 script-only-if-failed: true
1021 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1022 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1023 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1025 !include-raw: installer-report.sh