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 name: logrotate-default
45 artifact-days-to-keep: 60
46 artifact-num-to-keep: 200
51 - git: &git-scm-defaults
52 credentials-id: '$SSH_CREDENTIAL_ID'
62 choosing-strategy: 'gerrit'
63 refspec: '$GERRIT_REFSPEC'
66 name: git-scm-with-submodules
69 credentials-id: '$SSH_CREDENTIAL_ID'
73 - 'refs/heads/{branch}'
81 name: git-scm-openstack
83 - git: &git-scm-openstack-defaults
90 name: 'daily-trigger-disabled'
95 name: 'weekly-trigger-disabled'
100 name: gerrit-trigger-patchset-created
103 server-name: 'gerrit.opnfv.org'
105 - patchset-created-event:
106 exclude-drafts: 'false'
107 exclude-trivial-rebase: 'false'
108 exclude-no-code-change: 'false'
109 - draft-published-event
110 - comment-added-contains-event:
111 comment-contains-value: 'recheck'
112 - comment-added-contains-event:
113 comment-contains-value: 'reverify'
115 - project-compare-type: 'ANT'
116 project-pattern: '{project}'
118 - branch-compare-type: 'ANT'
119 branch-pattern: '**/{branch}'
121 - compare-type: 'ANT'
130 name: gerrit-trigger-change-merged
133 server-name: 'gerrit.opnfv.org'
135 - change-merged-event
136 - comment-added-contains-event:
137 comment-contains-value: 'remerge'
139 - project-compare-type: 'ANT'
140 project-pattern: '{project}'
142 - branch-compare-type: 'ANT'
143 branch-pattern: '**/{branch}'
145 - compare-type: 'ANT'
149 name: gerrit-trigger-tag-created
152 server-name: 'gerrit.opnfv.org'
156 - project-compare-type: 'ANT'
157 project-pattern: '{project}'
159 - branch-compare-type: 'ANT'
160 branch-pattern: 'refs/tags/**'
166 server-name: 'gerrit.opnfv.org'
168 - comment-added-contains-event:
169 comment-contains-value: 'check-experimental'
171 - project-compare-type: 'ANT'
172 project-pattern: '{project}'
174 - branch-compare-type: 'ANT'
175 branch-pattern: '**/{branch}'
177 - compare-type: 'ANT'
186 name: ssh-agent-wrapper
188 - ssh-agent-credentials:
190 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
197 timeout-var: 'BUILD_TIMEOUT'
201 name: fix-workspace-permissions
206 sudo chown -R $USER:$USER $WORKSPACE || exit 1
209 name: upload-under-review-docs-to-opnfv-artifacts
216 export PATH=$PATH:/usr/local/bin/
218 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
219 [[ -d docs/_build/ ]] || exit 0
222 echo "###########################"
223 echo "UPLOADING DOCS UNDER REVIEW"
224 echo "###########################"
227 gs_base="artifacts.opnfv.org/$PROJECT/review"
228 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
229 local_path="upload/$GERRIT_CHANGE_NUMBER"
232 mv docs/_build/html/ "$local_path"
233 gsutil -m cp -r "$local_path" "gs://$gs_base"
236 -h "Content-Type:text/html" \
237 -h "Cache-Control:private, max-age=0, no-transform" \
238 "gs://$gs_path"/**.html > /dev/null 2>&1
240 echo "Document link(s):" >> gerrit_comment.txt
241 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
242 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
244 # To take advantage of this macro, have your build write
245 # out the file 'gerrit_comment.txt' with information to post
246 # back to gerrit and include this macro in the list of builders.
248 name: report-build-result-to-gerrit
255 export PATH=$PATH:/usr/local/bin/
256 if [[ -e gerrit_comment.txt ]] ; then
258 echo "posting review comment to gerrit..."
260 cat gerrit_comment.txt
262 ssh -p 29418 gerrit.opnfv.org \
263 "gerrit review -p $GERRIT_PROJECT \
264 -m '$(cat gerrit_comment.txt)' \
265 $GERRIT_PATCHSET_REVISION \
270 name: remove-old-docs-from-opnfv-artifacts
277 export PATH=$PATH:/usr/local/bin/
279 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
281 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
283 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
285 echo "Deleting Out-of-dated Documents..."
286 gsutil -m rm -r "gs://$gs_path"
288 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
290 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
292 echo "Deleting Out-of-dated Documents..."
293 gsutil -m rm -r "gs://$gs_path"
297 name: lint-python-code
304 export PATH=$PATH:/usr/local/bin/
306 virtualenv -p python2.7 $WORKSPACE/releng_flake8
307 source $WORKSPACE/releng_flake8/bin/activate
309 # install python packages
310 pip install "flake8==2.6.2"
312 # generate and upload lint log
313 echo "Running flake8 code on $PROJECT ..."
315 # Get number of flake8 violations. If none, this will be an
317 FLAKE_COUNT="$(find . \
318 -path './releng_flake8' -prune -o \
319 -path './.tox' -prune -o \
320 -type f -name "*.py" -print | \
321 xargs flake8 --exit-zero -qq --count 2>&1)"
323 # Ensure we start with a clean environment
326 if [ ! -z $FLAKE_COUNT ]; then
327 echo "Flake8 Violations: $FLAKE_COUNT" > lint.log
329 -path './releng_flake8' -prune -o \
330 -path './.tox' -prune -o \
331 -type f -name "*.py" -print | \
332 xargs flake8 --exit-zero --first >> violation.log
333 SHOWN=$(wc -l violation.log | cut -d' ' -f1)
334 echo -e "First $SHOWN shown\n---" >> lint.log
335 cat violation.log >> lint.log
336 sed -r -i '4,$s/^/ /g' lint.log
343 name: report-lint-result-to-gerrit
350 export PATH=$PATH:/usr/local/bin/
352 # If no violations were found, no lint log will exist.
353 if [[ -e lint.log ]] ; then
354 echo -e "\nposting linting report to gerrit...\n"
359 ssh -p 29418 gerrit.opnfv.org \
360 "gerrit review -p $GERRIT_PROJECT \
361 -m \"$(cat lint.log)\" \
362 $GERRIT_PATCHSET_REVISION \
369 name: upload-review-docs
371 - upload-under-review-docs-to-opnfv-artifacts
372 - report-build-result-to-gerrit
375 name: check-bash-syntax
377 - shell: "find . -name '*.sh' | xargs bash -n"
387 export PATH=$PATH:/usr/local/bin/
389 # install python packages
390 sudo pip install "yamllint==1.8.2"
392 # generate and upload lint log
393 echo "Running yaml code on $PROJECT ..."
395 # Get list of yaml files
396 YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") || true
398 #If YAML_FILES is none exit with 0
399 if [ -z "$YAML_FILES" ]; then
403 # Ensure we start with a clean environment
404 rm -f yaml-violation.log lint.log
406 # Yamllint files only in patchset
407 for yamlfile in $YAML_FILES; do
408 yamllint $yamlfile >> yaml-violation.log || true
411 if [ -s "yaml-violation.log" ]; then
412 SHOWN=$(grep -c -v "^$" yaml-violation.log)
413 echo -e "First $SHOWN shown\n---" > lint.log
414 cat yaml-violation.log >> lint.log
415 sed -r -i '4,$s/^/ /g' lint.log
419 name: clean-workspace
426 sudo /bin/rm -rf "$WORKSPACE"
429 name: clean-workspace-log
432 find $WORKSPACE -type f -name '*.log' | xargs rm -f
435 name: track-begin-timestamp
438 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
441 name: archive-artifacts
444 artifacts: '{artifacts}'
450 name: publish-coverage
453 report-file: "coverage.xml"
455 health-auto-update: "false"
456 stability-auto-update: "false"
457 zoom-coverage-chart: "true"
468 # The majority of the email-ext plugin options are set to the default
469 # for this macro so they can be managed through Jenkins' global
472 name: email-jenkins-admins-on-failure
476 attach-build-log: true
483 # Email PTL publishers
484 - email_ptl_defaults: &email_ptl_defaults
485 name: 'email_ptl_defaults'
487 attach-build-log: true
493 - publisher: &email_apex_ptl_defaults
494 name: 'email-apex-ptl'
497 <<: *email_ptl_defaults
501 name: 'email-apex-os-net-config-ptl'
502 <<: *email_apex_ptl_defaults
504 name: 'email-apex-puppet-tripleo-ptl'
505 <<: *email_apex_ptl_defaults
507 name: 'email-apex-tripleo-heat-templates-ptl'
508 <<: *email_apex_ptl_defaults
511 name: 'email-armband-ptl'
514 <<: *email_ptl_defaults
519 name: 'email-auto-ptl'
522 <<: *email_ptl_defaults
527 name: 'email-availability-ptl'
530 <<: *email_ptl_defaults
532 fuqiao@chinamobile.com
535 name: 'email-bamboo-ptl'
538 <<: *email_ptl_defaults
543 name: 'email-barometer-ptl'
546 <<: *email_ptl_defaults
551 name: 'email-bottlenecks-ptl'
554 <<: *email_ptl_defaults
556 gabriel.yuyang@huawei.com
559 name: 'email-calipso-ptl'
562 <<: *email_ptl_defaults
567 name: 'email-clover-ptl'
570 <<: *email_ptl_defaults
572 stephen.wong1@huawei.com
574 - publisher: &email_compass4nfv_ptl_defaults
575 name: 'email-compass4nfv-ptl'
578 <<: *email_ptl_defaults
582 name: 'email-compass-containers-ptl'
583 <<: *email_compass4nfv_ptl_defaults
586 name: 'email-conductor-ptl'
589 <<: *email_ptl_defaults
591 limingjiang@huawei.com
594 name: 'email-container4nfv-ptl'
597 <<: *email_ptl_defaults
599 jiaxuan@chinamobile.com
602 name: 'email-copper-ptl'
605 <<: *email_ptl_defaults
607 aimeeu.opensource@gmail.com
610 name: 'email-cperf-ptl'
613 <<: *email_ptl_defaults
618 name: 'email-daisy-ptl'
621 <<: *email_ptl_defaults
623 hu.zhijiang@zte.com.cn
626 name: 'email-doctor-ptl'
629 <<: *email_ptl_defaults
634 name: 'email-domino-ptl'
637 <<: *email_ptl_defaults
639 ulas.kozat@huawei.com
642 name: 'email-dovetail-ptl'
645 <<: *email_ptl_defaults
647 hongbo.tianhongbo@huawei.com
650 name: 'email-dpacc-ptl'
653 <<: *email_ptl_defaults
655 denglingli@chinamobile.com
658 name: 'email-enfv-ptl'
661 <<: *email_ptl_defaults
663 JBuchanan@advaoptical.com
666 name: 'email-escalator-ptl'
669 <<: *email_ptl_defaults
674 name: 'email-fastpathmetrics-ptl'
677 <<: *email_ptl_defaults
679 maryam.tahhan@intel.com
682 name: 'email-fds-ptl'
685 <<: *email_ptl_defaults
690 name: 'email-fuel-ptl'
693 <<: *email_ptl_defaults
695 gelkinbard@mirantis.com
698 name: 'email-functest-ptl'
701 <<: *email_ptl_defaults
703 cedric.ollivier@orange.com
706 name: 'email-ipv6-ptl'
709 <<: *email_ptl_defaults
714 name: 'email-joid-ptl'
717 <<: *email_ptl_defaults
719 artur.tyloch@canonical.com
722 name: 'email-kvmfornfv-ptl'
725 <<: *email_ptl_defaults
727 raghuveer.reddy@intel.com
730 name: 'email-models-ptl'
733 <<: *email_ptl_defaults
738 name: 'email-moon-ptl'
741 <<: *email_ptl_defaults
746 name: 'email-multisite-ptl'
749 <<: *email_ptl_defaults
754 name: 'email-netready-ptl'
757 <<: *email_ptl_defaults
759 georg.kunz@ericsson.com
762 name: 'email-nfvbench-ptl'
765 <<: *email_ptl_defaults
770 name: 'email-octopus-ptl'
773 <<: *email_ptl_defaults
775 ulrich.kleber@huawei.com
778 name: 'email-onosfw-ptl'
781 <<: *email_ptl_defaults
786 name: 'email-openretriever-ptl'
789 <<: *email_ptl_defaults
791 jiaxuan@chinamobile.com
794 name: 'email-opera-ptl'
797 <<: *email_ptl_defaults
799 Yingjun.li@huawei.com
802 name: 'email-opnfvdocs-ptl'
805 <<: *email_ptl_defaults
807 sofia.wallin@ericsson.com
810 name: 'email-orchestra-ptl'
813 <<: *email_ptl_defaults
815 giuseppe.carella@fokus.fraunhofer.de
818 name: 'email-ovn4nfv-ptl'
821 <<: *email_ptl_defaults
823 trinath.somanchi@gmail.com
826 name: 'email-ovno-ptl'
829 <<: *email_ptl_defaults
834 name: 'email-ovsnfv-ptl'
837 <<: *email_ptl_defaults
839 MarkD.Graymark.d.gray@intel.com
842 name: 'email-parser-ptl'
845 <<: *email_ptl_defaults
847 shang.xiaodong@zte.com.cn
849 - publisher: &email_pharos_ptl_defaults
850 name: 'email-pharos-ptl'
853 <<: *email_ptl_defaults
855 jack.morgan@intel.com
857 name: 'email-pharos-tools-ptl'
858 <<: *email_pharos_ptl_defaults
861 name: 'email-promise-ptl'
864 <<: *email_ptl_defaults
866 kunzmann@docomolab-euro.com
869 name: 'email-qtip-ptl'
872 <<: *email_ptl_defaults
874 wu.zhihui1@zte.com.cn
876 - publisher: &email_releng_ptl_defaults
877 name: 'email-releng-ptl'
880 <<: *email_ptl_defaults
882 fatih.degirmenci@ericsson.com
884 name: 'email-releng-anteater-ptl'
885 <<: *email_releng_ptl_defaults
887 name: 'email-releng-testresults-ptl'
890 <<: *email_ptl_defaults
892 fatih.degirmenci@ericsson.com
893 feng.xiaowei@zte.com.cn
895 name: 'email-releng-utils-ptl'
896 <<: *email_releng_ptl_defaults
898 name: 'email-releng-xci-ptl'
899 <<: *email_releng_ptl_defaults
902 name: 'email-samplevnf-ptl'
905 <<: *email_ptl_defaults
910 name: 'email-sdnvpn-ptl'
913 <<: *email_ptl_defaults
915 tim.irnich@ericsson.com
918 name: 'email-securityscanning-ptl'
921 <<: *email_ptl_defaults
926 name: 'email-sfc-ptl'
929 <<: *email_ptl_defaults
931 ManuelBuilmbuil@suse.com
934 name: 'email-snaps-ptl'
937 <<: *email_ptl_defaults
939 s.pisarski@cablelabs.com
942 name: 'email-stor4nfv-ptl'
945 <<: *email_ptl_defaults
950 name: 'email-storperf-ptl'
953 <<: *email_ptl_defaults
958 name: 'email-ves-ptl'
961 <<: *email_ptl_defaults
963 bryan.sullivan@att.com
966 name: 'email-vswitchperf-ptl'
969 <<: *email_ptl_defaults
971 sridhar.rao@spirent.com
974 name: 'email-yardstick-ptl'
977 <<: *email_ptl_defaults
979 ross.b.brattain@intel.com
982 name: 'report-provision-result'
985 script-only-if-succeeded: true
988 echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
989 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
991 !include-raw-escape: installer-report.sh
993 script-only-if-failed: true
996 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
997 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
999 !include-raw-escape: installer-report.sh