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}'
80 name: 'daily-trigger-disabled'
85 name: 'weekly-trigger-disabled'
90 name: gerrit-trigger-patchset-created
93 server-name: 'gerrit.opnfv.org'
95 - patchset-created-event:
96 exclude-drafts: 'false'
97 exclude-trivial-rebase: 'false'
98 exclude-no-code-change: 'false'
99 - draft-published-event
100 - comment-added-contains-event:
101 comment-contains-value: 'recheck'
102 - comment-added-contains-event:
103 comment-contains-value: 'reverify'
105 - project-compare-type: 'ANT'
106 project-pattern: '{project}'
108 - branch-compare-type: 'ANT'
109 branch-pattern: '**/{branch}'
111 - compare-type: 'ANT'
120 name: gerrit-trigger-change-merged
123 server-name: 'gerrit.opnfv.org'
125 - change-merged-event
126 - comment-added-contains-event:
127 comment-contains-value: 'remerge'
129 - project-compare-type: 'ANT'
130 project-pattern: '{project}'
132 - branch-compare-type: 'ANT'
133 branch-pattern: '**/{branch}'
135 - compare-type: 'ANT'
139 name: gerrit-trigger-tag-created
142 server-name: 'gerrit.opnfv.org'
146 - project-compare-type: 'ANT'
147 project-pattern: '{project}'
149 - branch-compare-type: 'ANT'
150 branch-pattern: 'refs/tags/**'
156 server-name: 'gerrit.opnfv.org'
158 - comment-added-contains-event:
159 comment-contains-value: 'check-experimental'
161 - project-compare-type: 'ANT'
162 project-pattern: '{project}'
164 - branch-compare-type: 'ANT'
165 branch-pattern: '**/{branch}'
167 - compare-type: 'ANT'
176 name: ssh-agent-wrapper
178 - ssh-agent-credentials:
180 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
187 timeout-var: 'BUILD_TIMEOUT'
191 name: fix-workspace-permissions
196 sudo chown -R $USER:$USER $WORKSPACE || exit 1
199 name: upload-under-review-docs-to-opnfv-artifacts
206 export PATH=$PATH:/usr/local/bin/
208 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
209 [[ -d docs/_build/ ]] || exit 0
212 echo "###########################"
213 echo "UPLOADING DOCS UNDER REVIEW"
214 echo "###########################"
217 gs_base="artifacts.opnfv.org/$PROJECT/review"
218 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
219 local_path="upload/$GERRIT_CHANGE_NUMBER"
222 mv docs/_build/html/ "$local_path"
223 gsutil -m cp -r "$local_path" "gs://$gs_base"
226 -h "Content-Type:text/html" \
227 -h "Cache-Control:private, max-age=0, no-transform" \
228 "gs://$gs_path"/**.html > /dev/null 2>&1
230 echo "Document link(s):" >> gerrit_comment.txt
231 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
232 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
234 # To take advantage of this macro, have your build write
235 # out the file 'gerrit_comment.txt' with information to post
236 # back to gerrit and include this macro in the list of builders.
238 name: report-build-result-to-gerrit
245 export PATH=$PATH:/usr/local/bin/
246 if [[ -e gerrit_comment.txt ]] ; then
248 echo "posting review comment to gerrit..."
250 cat gerrit_comment.txt
252 ssh -p 29418 gerrit.opnfv.org \
253 "gerrit review -p $GERRIT_PROJECT \
254 -m '$(cat gerrit_comment.txt)' \
255 $GERRIT_PATCHSET_REVISION \
260 name: remove-old-docs-from-opnfv-artifacts
267 export PATH=$PATH:/usr/local/bin/
269 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
271 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
273 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
275 echo "Deleting Out-of-dated Documents..."
276 gsutil -m rm -r "gs://$gs_path"
278 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
280 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
282 echo "Deleting Out-of-dated Documents..."
283 gsutil -m rm -r "gs://$gs_path"
287 name: lint-python-code
294 export PATH=$PATH:/usr/local/bin/
296 virtualenv -p python2.7 $WORKSPACE/releng_flake8
297 source $WORKSPACE/releng_flake8/bin/activate
299 # install python packages
300 pip install "flake8==2.6.2"
302 # generate and upload lint log
303 echo "Running flake8 code on $PROJECT ..."
305 # Get number of flake8 violations. If none, this will be an
307 FLAKE_COUNT="$(find . \
308 -path './releng_flake8' -prune -o \
309 -path './.tox' -prune -o \
310 -type f -name "*.py" -print | \
311 xargs flake8 --exit-zero -qq --count 2>&1)"
313 # Ensure we start with a clean environment
316 if [ ! -z $FLAKE_COUNT ]; then
317 echo "Flake8 Violations: $FLAKE_COUNT" > lint.log
319 -path './releng_flake8' -prune -o \
320 -path './.tox' -prune -o \
321 -type f -name "*.py" -print | \
322 xargs flake8 --exit-zero --first >> violation.log
323 SHOWN=$(wc -l violation.log | cut -d' ' -f1)
324 echo -e "First $SHOWN shown\n---" >> lint.log
325 cat violation.log >> lint.log
326 sed -r -i '4,$s/^/ /g' lint.log
333 name: report-lint-result-to-gerrit
340 export PATH=$PATH:/usr/local/bin/
342 # If no violations were found, no lint log will exist.
343 if [[ -e lint.log ]] ; then
344 echo -e "\nposting linting report to gerrit...\n"
349 ssh -p 29418 gerrit.opnfv.org \
350 "gerrit review -p $GERRIT_PROJECT \
351 -m \"$(cat lint.log)\" \
352 $GERRIT_PATCHSET_REVISION \
359 name: upload-review-docs
361 - upload-under-review-docs-to-opnfv-artifacts
362 - report-build-result-to-gerrit
365 name: check-bash-syntax
367 - shell: "find . -name '*.sh' | xargs bash -n"
377 export PATH=$PATH:/usr/local/bin/
379 # install python packages
380 sudo pip install "yamllint==1.8.2"
382 # generate and upload lint log
383 echo "Running yaml code on $PROJECT ..."
385 # Get list of yaml files
386 YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") || true
388 #If YAML_FILES is none exit with 0
389 if [ -z "$YAML_FILES" ]; then
393 # Ensure we start with a clean environment
394 rm -f yaml-violation.log lint.log
396 # Yamllint files only in patchset
397 for yamlfile in $YAML_FILES; do
398 yamllint $yamlfile >> yaml-violation.log || true
401 if [ -s "yaml-violation.log" ]; then
402 SHOWN=$(grep -c -v "^$" yaml-violation.log)
403 echo -e "First $SHOWN shown\n---" > lint.log
404 cat yaml-violation.log >> lint.log
405 sed -r -i '4,$s/^/ /g' lint.log
409 name: clean-workspace
416 sudo /bin/rm -rf "$WORKSPACE"
419 name: clean-workspace-log
422 find $WORKSPACE -type f -name '*.log' | xargs rm -f
425 name: archive-artifacts
428 artifacts: '{artifacts}'
434 name: publish-coverage
437 report-file: "coverage.xml"
439 health-auto-update: "false"
440 stability-auto-update: "false"
441 zoom-coverage-chart: "true"
452 # The majority of the email-ext plugin options are set to the default
453 # for this macro so they can be managed through Jenkins' global
456 name: email-jenkins-admins-on-failure
460 attach-build-log: true
467 # Email PTL publishers
468 - email_ptl_defaults: &email_ptl_defaults
469 name: 'email_ptl_defaults'
471 attach-build-log: true
477 - publisher: &email_apex_ptl_defaults
478 name: 'email-apex-ptl'
481 <<: *email_ptl_defaults
485 name: 'email-apex-os-net-config-ptl'
486 <<: *email_apex_ptl_defaults
488 name: 'email-apex-puppet-tripleo-ptl'
489 <<: *email_apex_ptl_defaults
491 name: 'email-apex-tripleo-heat-templates-ptl'
492 <<: *email_apex_ptl_defaults
495 name: 'email-armband-ptl'
498 <<: *email_ptl_defaults
503 name: 'email-auto-ptl'
506 <<: *email_ptl_defaults
511 name: 'email-availability-ptl'
514 <<: *email_ptl_defaults
516 fuqiao@chinamobile.com
519 name: 'email-bamboo-ptl'
522 <<: *email_ptl_defaults
527 name: 'email-barometer-ptl'
530 <<: *email_ptl_defaults
535 name: 'email-bottlenecks-ptl'
538 <<: *email_ptl_defaults
540 gabriel.yuyang@huawei.com
543 name: 'email-calipso-ptl'
546 <<: *email_ptl_defaults
551 name: 'email-clover-ptl'
554 <<: *email_ptl_defaults
556 stephen.wong1@huawei.com
558 - publisher: &email_compass4nfv_ptl_defaults
559 name: 'email-compass4nfv-ptl'
562 <<: *email_ptl_defaults
566 name: 'email-compass-containers-ptl'
567 <<: *email_compass4nfv_ptl_defaults
570 name: 'email-conductor-ptl'
573 <<: *email_ptl_defaults
575 limingjiang@huawei.com
578 name: 'email-container4nfv-ptl'
581 <<: *email_ptl_defaults
583 jiaxuan@chinamobile.com
586 name: 'email-copper-ptl'
589 <<: *email_ptl_defaults
591 aimeeu.opensource@gmail.com
594 name: 'email-cperf-ptl'
597 <<: *email_ptl_defaults
602 name: 'email-daisy-ptl'
605 <<: *email_ptl_defaults
607 hu.zhijiang@zte.com.cn
610 name: 'email-doctor-ptl'
613 <<: *email_ptl_defaults
618 name: 'email-domino-ptl'
621 <<: *email_ptl_defaults
623 ulas.kozat@huawei.com
626 name: 'email-dovetail-ptl'
629 <<: *email_ptl_defaults
631 hongbo.tianhongbo@huawei.com
634 name: 'email-dpacc-ptl'
637 <<: *email_ptl_defaults
639 denglingli@chinamobile.com
642 name: 'email-enfv-ptl'
645 <<: *email_ptl_defaults
647 JBuchanan@advaoptical.com
650 name: 'email-escalator-ptl'
653 <<: *email_ptl_defaults
658 name: 'email-fastpathmetrics-ptl'
661 <<: *email_ptl_defaults
663 maryam.tahhan@intel.com
666 name: 'email-fds-ptl'
669 <<: *email_ptl_defaults
674 name: 'email-fuel-ptl'
677 <<: *email_ptl_defaults
679 gelkinbard@mirantis.com
682 name: 'email-functest-ptl'
685 <<: *email_ptl_defaults
687 cedric.ollivier@orange.com
690 name: 'email-ipv6-ptl'
693 <<: *email_ptl_defaults
698 name: 'email-joid-ptl'
701 <<: *email_ptl_defaults
703 artur.tyloch@canonical.com
706 name: 'email-kvmfornfv-ptl'
709 <<: *email_ptl_defaults
711 raghuveer.reddy@intel.com
714 name: 'email-models-ptl'
717 <<: *email_ptl_defaults
722 name: 'email-moon-ptl'
725 <<: *email_ptl_defaults
730 name: 'email-multisite-ptl'
733 <<: *email_ptl_defaults
738 name: 'email-netready-ptl'
741 <<: *email_ptl_defaults
743 georg.kunz@ericsson.com
746 name: 'email-nfvbench-ptl'
749 <<: *email_ptl_defaults
754 name: 'email-octopus-ptl'
757 <<: *email_ptl_defaults
759 ulrich.kleber@huawei.com
762 name: 'email-onosfw-ptl'
765 <<: *email_ptl_defaults
770 name: 'email-openretriever-ptl'
773 <<: *email_ptl_defaults
775 jiaxuan@chinamobile.com
778 name: 'email-opera-ptl'
781 <<: *email_ptl_defaults
783 Yingjun.li@huawei.com
786 name: 'email-opnfvdocs-ptl'
789 <<: *email_ptl_defaults
791 sofia.wallin@ericsson.com
794 name: 'email-orchestra-ptl'
797 <<: *email_ptl_defaults
799 giuseppe.carella@fokus.fraunhofer.de
802 name: 'email-ovn4nfv-ptl'
805 <<: *email_ptl_defaults
807 trinath.somanchi@gmail.com
810 name: 'email-ovno-ptl'
813 <<: *email_ptl_defaults
818 name: 'email-ovsnfv-ptl'
821 <<: *email_ptl_defaults
823 MarkD.Graymark.d.gray@intel.com
826 name: 'email-parser-ptl'
829 <<: *email_ptl_defaults
831 shang.xiaodong@zte.com.cn
833 - publisher: &email_pharos_ptl_defaults
834 name: 'email-pharos-ptl'
837 <<: *email_ptl_defaults
839 jack.morgan@intel.com
841 name: 'email-pharos-tools-ptl'
842 <<: *email_pharos_ptl_defaults
845 name: 'email-promise-ptl'
848 <<: *email_ptl_defaults
850 kunzmann@docomolab-euro.com
853 name: 'email-qtip-ptl'
856 <<: *email_ptl_defaults
858 wu.zhihui1@zte.com.cn
860 - publisher: &email_releng_ptl_defaults
861 name: 'email-releng-ptl'
864 <<: *email_ptl_defaults
866 fatih.degirmenci@ericsson.com
868 name: 'email-releng-anteater-ptl'
869 <<: *email_releng_ptl_defaults
871 name: 'email-releng-testresults-ptl'
874 <<: *email_ptl_defaults
876 fatih.degirmenci@ericsson.com
877 feng.xiaowei@zte.com.cn
879 name: 'email-releng-utils-ptl'
880 <<: *email_releng_ptl_defaults
882 name: 'email-releng-xci-ptl'
883 <<: *email_releng_ptl_defaults
886 name: 'email-samplevnf-ptl'
889 <<: *email_ptl_defaults
894 name: 'email-sdnvpn-ptl'
897 <<: *email_ptl_defaults
899 tim.irnich@ericsson.com
902 name: 'email-securityscanning-ptl'
905 <<: *email_ptl_defaults
910 name: 'email-sfc-ptl'
913 <<: *email_ptl_defaults
915 ManuelBuilmbuil@suse.com
918 name: 'email-snaps-ptl'
921 <<: *email_ptl_defaults
923 s.pisarski@cablelabs.com
926 name: 'email-stor4nfv-ptl'
929 <<: *email_ptl_defaults
934 name: 'email-storperf-ptl'
937 <<: *email_ptl_defaults
942 name: 'email-ves-ptl'
945 <<: *email_ptl_defaults
947 bryan.sullivan@att.com
950 name: 'email-vswitchperf-ptl'
953 <<: *email_ptl_defaults
955 sridhar.rao@spirent.com
958 name: 'email-yardstick-ptl'
961 <<: *email_ptl_defaults
963 ross.b.brattain@intel.com