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: archive-artifacts
438 artifacts: '{artifacts}'
444 name: publish-coverage
447 report-file: "coverage.xml"
449 health-auto-update: "false"
450 stability-auto-update: "false"
451 zoom-coverage-chart: "true"
462 # The majority of the email-ext plugin options are set to the default
463 # for this macro so they can be managed through Jenkins' global
466 name: email-jenkins-admins-on-failure
470 attach-build-log: true
477 # Email PTL publishers
478 - email_ptl_defaults: &email_ptl_defaults
479 name: 'email_ptl_defaults'
481 attach-build-log: true
487 - publisher: &email_apex_ptl_defaults
488 name: 'email-apex-ptl'
491 <<: *email_ptl_defaults
495 name: 'email-apex-os-net-config-ptl'
496 <<: *email_apex_ptl_defaults
498 name: 'email-apex-puppet-tripleo-ptl'
499 <<: *email_apex_ptl_defaults
501 name: 'email-apex-tripleo-heat-templates-ptl'
502 <<: *email_apex_ptl_defaults
505 name: 'email-armband-ptl'
508 <<: *email_ptl_defaults
513 name: 'email-auto-ptl'
516 <<: *email_ptl_defaults
521 name: 'email-availability-ptl'
524 <<: *email_ptl_defaults
526 fuqiao@chinamobile.com
529 name: 'email-bamboo-ptl'
532 <<: *email_ptl_defaults
537 name: 'email-barometer-ptl'
540 <<: *email_ptl_defaults
545 name: 'email-bottlenecks-ptl'
548 <<: *email_ptl_defaults
550 gabriel.yuyang@huawei.com
553 name: 'email-calipso-ptl'
556 <<: *email_ptl_defaults
561 name: 'email-clover-ptl'
564 <<: *email_ptl_defaults
566 stephen.wong1@huawei.com
568 - publisher: &email_compass4nfv_ptl_defaults
569 name: 'email-compass4nfv-ptl'
572 <<: *email_ptl_defaults
576 name: 'email-compass-containers-ptl'
577 <<: *email_compass4nfv_ptl_defaults
580 name: 'email-conductor-ptl'
583 <<: *email_ptl_defaults
585 limingjiang@huawei.com
588 name: 'email-container4nfv-ptl'
591 <<: *email_ptl_defaults
593 jiaxuan@chinamobile.com
596 name: 'email-copper-ptl'
599 <<: *email_ptl_defaults
601 aimeeu.opensource@gmail.com
604 name: 'email-cperf-ptl'
607 <<: *email_ptl_defaults
612 name: 'email-daisy-ptl'
615 <<: *email_ptl_defaults
617 hu.zhijiang@zte.com.cn
620 name: 'email-doctor-ptl'
623 <<: *email_ptl_defaults
628 name: 'email-domino-ptl'
631 <<: *email_ptl_defaults
633 ulas.kozat@huawei.com
636 name: 'email-dovetail-ptl'
639 <<: *email_ptl_defaults
641 hongbo.tianhongbo@huawei.com
644 name: 'email-dpacc-ptl'
647 <<: *email_ptl_defaults
649 denglingli@chinamobile.com
652 name: 'email-enfv-ptl'
655 <<: *email_ptl_defaults
657 JBuchanan@advaoptical.com
660 name: 'email-escalator-ptl'
663 <<: *email_ptl_defaults
668 name: 'email-fastpathmetrics-ptl'
671 <<: *email_ptl_defaults
673 maryam.tahhan@intel.com
676 name: 'email-fds-ptl'
679 <<: *email_ptl_defaults
684 name: 'email-fuel-ptl'
687 <<: *email_ptl_defaults
689 gelkinbard@mirantis.com
692 name: 'email-functest-ptl'
695 <<: *email_ptl_defaults
697 cedric.ollivier@orange.com
700 name: 'email-ipv6-ptl'
703 <<: *email_ptl_defaults
708 name: 'email-joid-ptl'
711 <<: *email_ptl_defaults
713 artur.tyloch@canonical.com
716 name: 'email-kvmfornfv-ptl'
719 <<: *email_ptl_defaults
721 raghuveer.reddy@intel.com
724 name: 'email-models-ptl'
727 <<: *email_ptl_defaults
732 name: 'email-moon-ptl'
735 <<: *email_ptl_defaults
740 name: 'email-multisite-ptl'
743 <<: *email_ptl_defaults
748 name: 'email-netready-ptl'
751 <<: *email_ptl_defaults
753 georg.kunz@ericsson.com
756 name: 'email-nfvbench-ptl'
759 <<: *email_ptl_defaults
764 name: 'email-octopus-ptl'
767 <<: *email_ptl_defaults
769 ulrich.kleber@huawei.com
772 name: 'email-onosfw-ptl'
775 <<: *email_ptl_defaults
780 name: 'email-openretriever-ptl'
783 <<: *email_ptl_defaults
785 jiaxuan@chinamobile.com
788 name: 'email-opera-ptl'
791 <<: *email_ptl_defaults
793 Yingjun.li@huawei.com
796 name: 'email-opnfvdocs-ptl'
799 <<: *email_ptl_defaults
801 sofia.wallin@ericsson.com
804 name: 'email-orchestra-ptl'
807 <<: *email_ptl_defaults
809 giuseppe.carella@fokus.fraunhofer.de
812 name: 'email-ovn4nfv-ptl'
815 <<: *email_ptl_defaults
817 trinath.somanchi@gmail.com
820 name: 'email-ovno-ptl'
823 <<: *email_ptl_defaults
828 name: 'email-ovsnfv-ptl'
831 <<: *email_ptl_defaults
833 MarkD.Graymark.d.gray@intel.com
836 name: 'email-parser-ptl'
839 <<: *email_ptl_defaults
841 shang.xiaodong@zte.com.cn
843 - publisher: &email_pharos_ptl_defaults
844 name: 'email-pharos-ptl'
847 <<: *email_ptl_defaults
849 jack.morgan@intel.com
851 name: 'email-pharos-tools-ptl'
852 <<: *email_pharos_ptl_defaults
855 name: 'email-promise-ptl'
858 <<: *email_ptl_defaults
860 kunzmann@docomolab-euro.com
863 name: 'email-qtip-ptl'
866 <<: *email_ptl_defaults
868 wu.zhihui1@zte.com.cn
870 - publisher: &email_releng_ptl_defaults
871 name: 'email-releng-ptl'
874 <<: *email_ptl_defaults
876 fatih.degirmenci@ericsson.com
878 name: 'email-releng-anteater-ptl'
879 <<: *email_releng_ptl_defaults
881 name: 'email-releng-testresults-ptl'
884 <<: *email_ptl_defaults
886 fatih.degirmenci@ericsson.com
887 feng.xiaowei@zte.com.cn
889 name: 'email-releng-utils-ptl'
890 <<: *email_releng_ptl_defaults
892 name: 'email-releng-xci-ptl'
893 <<: *email_releng_ptl_defaults
896 name: 'email-samplevnf-ptl'
899 <<: *email_ptl_defaults
904 name: 'email-sdnvpn-ptl'
907 <<: *email_ptl_defaults
909 tim.irnich@ericsson.com
912 name: 'email-securityscanning-ptl'
915 <<: *email_ptl_defaults
920 name: 'email-sfc-ptl'
923 <<: *email_ptl_defaults
925 ManuelBuilmbuil@suse.com
928 name: 'email-snaps-ptl'
931 <<: *email_ptl_defaults
933 s.pisarski@cablelabs.com
936 name: 'email-stor4nfv-ptl'
939 <<: *email_ptl_defaults
944 name: 'email-storperf-ptl'
947 <<: *email_ptl_defaults
952 name: 'email-ves-ptl'
955 <<: *email_ptl_defaults
957 bryan.sullivan@att.com
960 name: 'email-vswitchperf-ptl'
963 <<: *email_ptl_defaults
965 sridhar.rao@spirent.com
968 name: 'email-yardstick-ptl'
971 <<: *email_ptl_defaults
973 ross.b.brattain@intel.com