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 name: 'email-apex-ptl'
478 publishers: &email_apex_ptl_defaults
480 <<: *email_ptl_defaults
484 name: 'email-apex-os-net-config-ptl'
486 <<: *email_apex_ptl_defaults
488 name: 'email-apex-puppet-tripleo-ptl'
490 <<: *email_apex_ptl_defaults
492 name: 'email-apex-tripleo-heat-templates-ptl'
494 <<: *email_apex_ptl_defaults
497 name: 'email-armband-ptl'
500 <<: *email_ptl_defaults
505 name: 'email-auto-ptl'
508 <<: *email_ptl_defaults
513 name: 'email-availability-ptl'
516 <<: *email_ptl_defaults
518 fuqiao@chinamobile.com
521 name: 'email-bamboo-ptl'
524 <<: *email_ptl_defaults
529 name: 'email-barometer-ptl'
532 <<: *email_ptl_defaults
537 name: 'email-bottlenecks-ptl'
540 <<: *email_ptl_defaults
542 gabriel.yuyang@huawei.com
545 name: 'email-calipso-ptl'
548 <<: *email_ptl_defaults
553 name: 'email-clover-ptl'
556 <<: *email_ptl_defaults
558 stephen.wong1@huawei.com
561 name: 'email-compass4nfv-ptl'
562 publishers: &email_compass4nfv_ptl_defaults
564 <<: *email_ptl_defaults
568 name: 'email-compass-containers-ptl'
570 <<: *email_compass4nfv_ptl_defaults
573 name: 'email-conductor-ptl'
576 <<: *email_ptl_defaults
578 limingjiang@huawei.com
581 name: 'email-container4nfv-ptl'
584 <<: *email_ptl_defaults
586 jiaxuan@chinamobile.com
589 name: 'email-copper-ptl'
592 <<: *email_ptl_defaults
594 aimeeu.opensource@gmail.com
597 name: 'email-cperf-ptl'
600 <<: *email_ptl_defaults
605 name: 'email-daisy-ptl'
608 <<: *email_ptl_defaults
610 hu.zhijiang@zte.com.cn
613 name: 'email-doctor-ptl'
616 <<: *email_ptl_defaults
621 name: 'email-domino-ptl'
624 <<: *email_ptl_defaults
626 ulas.kozat@huawei.com
629 name: 'email-dovetail-ptl'
632 <<: *email_ptl_defaults
634 hongbo.tianhongbo@huawei.com
637 name: 'email-dpacc-ptl'
640 <<: *email_ptl_defaults
642 denglingli@chinamobile.com
645 name: 'email-enfv-ptl'
648 <<: *email_ptl_defaults
650 JBuchanan@advaoptical.com
653 name: 'email-escalator-ptl'
656 <<: *email_ptl_defaults
661 name: 'email-fastpathmetrics-ptl'
664 <<: *email_ptl_defaults
666 maryam.tahhan@intel.com
669 name: 'email-fds-ptl'
672 <<: *email_ptl_defaults
677 name: 'email-fuel-ptl'
680 <<: *email_ptl_defaults
682 gelkinbard@mirantis.com
685 name: 'email-functest-ptl'
688 <<: *email_ptl_defaults
690 cedric.ollivier@orange.com
693 name: 'email-ipv6-ptl'
696 <<: *email_ptl_defaults
701 name: 'email-joid-ptl'
704 <<: *email_ptl_defaults
706 artur.tyloch@canonical.com
709 name: 'email-kvmfornfv-ptl'
712 <<: *email_ptl_defaults
714 raghuveer.reddy@intel.com
717 name: 'email-models-ptl'
720 <<: *email_ptl_defaults
725 name: 'email-moon-ptl'
728 <<: *email_ptl_defaults
733 name: 'email-multisite-ptl'
736 <<: *email_ptl_defaults
741 name: 'email-netready-ptl'
744 <<: *email_ptl_defaults
746 georg.kunz@ericsson.com
749 name: 'email-nfvbench-ptl'
752 <<: *email_ptl_defaults
757 name: 'email-octopus-ptl'
760 <<: *email_ptl_defaults
762 ulrich.kleber@huawei.com
765 name: 'email-onosfw-ptl'
768 <<: *email_ptl_defaults
773 name: 'email-openretriever-ptl'
776 <<: *email_ptl_defaults
778 jiaxuan@chinamobile.com
781 name: 'email-opera-ptl'
784 <<: *email_ptl_defaults
786 Yingjun.li@huawei.com
789 name: 'email-opnfvdocs-ptl'
792 <<: *email_ptl_defaults
794 sofia.wallin@ericsson.com
797 name: 'email-orchestra-ptl'
800 <<: *email_ptl_defaults
802 giuseppe.carella@fokus.fraunhofer.de
805 name: 'email-ovn4nfv-ptl'
808 <<: *email_ptl_defaults
810 trinath.somanchi@gmail.com
813 name: 'email-ovno-ptl'
816 <<: *email_ptl_defaults
821 name: 'email-ovsnfv-ptl'
824 <<: *email_ptl_defaults
826 MarkD.Graymark.d.gray@intel.com
829 name: 'email-parser-ptl'
832 <<: *email_ptl_defaults
834 shang.xiaodong@zte.com.cn
837 name: 'email-pharos-ptl'
838 publishers: &email_pharos_ptl_defaults
840 <<: *email_ptl_defaults
842 jack.morgan@intel.com
844 name: 'email-pharos-tools-ptl'
846 <<: *email_pharos_ptl_defaults
849 name: 'email-promise-ptl'
852 <<: *email_ptl_defaults
854 kunzmann@docomolab-euro.com
857 name: 'email-qtip-ptl'
860 <<: *email_ptl_defaults
862 wu.zhihui1@zte.com.cn
865 name: 'email-releng-ptl'
866 publishers: &email_releng_ptl_defaults
868 <<: *email_ptl_defaults
870 fatih.degirmenci@ericsson.com
872 name: 'email-releng-anteater-ptl'
874 <<: *email_releng_ptl_defaults
876 name: 'email-releng-testresults-ptl'
878 <<: *email_releng_ptl_defaults
880 name: 'email-releng-utils-ptl'
882 <<: *email_releng_ptl_defaults
884 name: 'email-releng-xci-ptl'
886 <<: *email_releng_ptl_defaults
889 name: 'email-samplevnf-ptl'
892 <<: *email_ptl_defaults
897 name: 'email-sdnvpn-ptl'
900 <<: *email_ptl_defaults
902 tim.irnich@ericsson.com
905 name: 'email-securityscanning-ptl'
908 <<: *email_ptl_defaults
913 name: 'email-sfc-ptl'
916 <<: *email_ptl_defaults
918 ManuelBuilmbuil@suse.com
921 name: 'email-snaps-ptl'
924 <<: *email_ptl_defaults
926 s.pisarski@cablelabs.com
929 name: 'email-stor4nfv-ptl'
932 <<: *email_ptl_defaults
937 name: 'email-storperf-ptl'
940 <<: *email_ptl_defaults
945 name: 'email-ves-ptl'
948 <<: *email_ptl_defaults
950 bryan.sullivan@att.com
953 name: 'email-vswitchperf-ptl'
956 <<: *email_ptl_defaults
958 sridhar.rao@spirent.com
961 name: 'email-yardstick-ptl'
964 <<: *email_ptl_defaults
966 ross.b.brattain@intel.com