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 name: logrotate-default
49 artifact-days-to-keep: 60
50 artifact-num-to-keep: 200
55 - git: &git-scm-defaults
56 credentials-id: '$SSH_CREDENTIAL_ID'
66 choosing-strategy: 'gerrit'
67 refspec: '$GERRIT_REFSPEC'
70 name: git-scm-with-submodules
73 credentials-id: '$SSH_CREDENTIAL_ID'
77 - 'refs/heads/{branch}'
85 name: git-scm-openstack
87 - git: &git-scm-openstack-defaults
94 name: 'daily-trigger-disabled'
99 name: 'weekly-trigger-disabled'
104 name: gerrit-trigger-patchset-created
107 server-name: 'gerrit.opnfv.org'
109 - patchset-created-event:
110 exclude-drafts: 'false'
111 exclude-trivial-rebase: 'false'
112 exclude-no-code-change: 'false'
113 - draft-published-event
114 - comment-added-contains-event:
115 comment-contains-value: 'recheck'
116 - comment-added-contains-event:
117 comment-contains-value: 'reverify'
119 - project-compare-type: 'ANT'
120 project-pattern: '{project}'
122 - branch-compare-type: 'ANT'
123 branch-pattern: '**/{branch}'
125 - compare-type: 'ANT'
134 name: gerrit-trigger-change-merged
137 server-name: 'gerrit.opnfv.org'
139 - change-merged-event
140 - comment-added-contains-event:
141 comment-contains-value: 'remerge'
143 - project-compare-type: 'ANT'
144 project-pattern: '{project}'
146 - branch-compare-type: 'ANT'
147 branch-pattern: '**/{branch}'
149 - compare-type: 'ANT'
153 name: gerrit-trigger-tag-created
156 server-name: 'gerrit.opnfv.org'
160 - project-compare-type: 'ANT'
161 project-pattern: '{project}'
163 - branch-compare-type: 'ANT'
164 branch-pattern: 'refs/tags/**'
170 server-name: 'gerrit.opnfv.org'
172 - comment-added-contains-event:
173 comment-contains-value: 'check-experimental'
175 - project-compare-type: 'ANT'
176 project-pattern: '{project}'
178 - branch-compare-type: 'ANT'
179 branch-pattern: '**/{branch}'
181 - compare-type: 'ANT'
190 name: ssh-agent-wrapper
192 - ssh-agent-credentials:
194 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
201 timeout-var: 'BUILD_TIMEOUT'
205 name: fix-workspace-permissions
210 sudo chown -R $USER:$USER $WORKSPACE || exit 1
213 name: upload-under-review-docs-to-opnfv-artifacts
220 export PATH=$PATH:/usr/local/bin/
222 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
223 [[ -d docs/_build/ ]] || exit 0
226 echo "###########################"
227 echo "UPLOADING DOCS UNDER REVIEW"
228 echo "###########################"
231 gs_base="artifacts.opnfv.org/$PROJECT/review"
232 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
233 local_path="upload/$GERRIT_CHANGE_NUMBER"
236 mv docs/_build/html/ "$local_path"
237 gsutil -m cp -r "$local_path" "gs://$gs_base"
240 -h "Content-Type:text/html" \
241 -h "Cache-Control:private, max-age=0, no-transform" \
242 "gs://$gs_path"/**.html > /dev/null 2>&1
244 echo "Document link(s):" >> gerrit_comment.txt
245 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
246 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
248 # To take advantage of this macro, have your build write
249 # out the file 'gerrit_comment.txt' with information to post
250 # back to gerrit and include this macro in the list of builders.
252 name: report-build-result-to-gerrit
259 export PATH=$PATH:/usr/local/bin/
260 if [[ -e gerrit_comment.txt ]] ; then
262 echo "posting review comment to gerrit..."
264 cat gerrit_comment.txt
266 ssh -p 29418 gerrit.opnfv.org \
267 "gerrit review -p $GERRIT_PROJECT \
268 -m '$(cat gerrit_comment.txt)' \
269 $GERRIT_PATCHSET_REVISION \
274 name: remove-old-docs-from-opnfv-artifacts
281 export PATH=$PATH:/usr/local/bin/
283 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
285 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
287 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
289 echo "Deleting Out-of-dated Documents..."
290 gsutil -m rm -r "gs://$gs_path"
292 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
294 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
296 echo "Deleting Out-of-dated Documents..."
297 gsutil -m rm -r "gs://$gs_path"
301 name: lint-python-code
308 export PATH=$PATH:/usr/local/bin/
310 virtualenv -p python2.7 $WORKSPACE/releng_flake8
311 source $WORKSPACE/releng_flake8/bin/activate
313 # install python packages
314 pip install "flake8==2.6.2"
316 # generate and upload lint log
317 echo "Running flake8 code on $PROJECT ..."
319 # Get number of flake8 violations. If none, this will be an
321 FLAKE_COUNT="$(find . \
322 -path './releng_flake8' -prune -o \
323 -path './.tox' -prune -o \
324 -type f -name "*.py" -print | \
325 xargs flake8 --exit-zero -qq --count 2>&1)"
327 # Ensure we start with a clean environment
330 if [ ! -z $FLAKE_COUNT ]; then
331 echo "Flake8 Violations: $FLAKE_COUNT" > lint.log
333 -path './releng_flake8' -prune -o \
334 -path './.tox' -prune -o \
335 -type f -name "*.py" -print | \
336 xargs flake8 --exit-zero --first >> violation.log
337 SHOWN=$(wc -l violation.log | cut -d' ' -f1)
338 echo -e "First $SHOWN shown\n---" >> lint.log
339 cat violation.log >> lint.log
340 sed -r -i '4,$s/^/ /g' lint.log
347 name: report-lint-result-to-gerrit
354 export PATH=$PATH:/usr/local/bin/
356 # If no violations were found, no lint log will exist.
357 if [[ -e lint.log ]] ; then
358 echo -e "\nposting linting report to gerrit...\n"
363 ssh -p 29418 gerrit.opnfv.org \
364 "gerrit review -p $GERRIT_PROJECT \
365 -m \"$(cat lint.log)\" \
366 $GERRIT_PATCHSET_REVISION \
373 name: upload-review-docs
375 - upload-under-review-docs-to-opnfv-artifacts
376 - report-build-result-to-gerrit
379 name: check-bash-syntax
381 - shell: "find . -name '*.sh' | xargs bash -n"
391 export PATH=$PATH:/usr/local/bin/
393 # install python packages
394 sudo pip install "yamllint==1.8.2"
396 # generate and upload lint log
397 echo "Running yaml code on $PROJECT ..."
399 # Get list of yaml files
400 YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") || true
402 #If YAML_FILES is none exit with 0
403 if [ -z "$YAML_FILES" ]; then
407 # Ensure we start with a clean environment
408 rm -f yaml-violation.log lint.log
410 # Yamllint files only in patchset
411 for yamlfile in $YAML_FILES; do
412 yamllint $yamlfile >> yaml-violation.log || true
415 if [ -s "yaml-violation.log" ]; then
416 SHOWN=$(grep -c -v "^$" yaml-violation.log)
417 echo -e "First $SHOWN shown\n---" > lint.log
418 cat yaml-violation.log >> lint.log
419 sed -r -i '4,$s/^/ /g' lint.log
423 name: clean-workspace
430 sudo /bin/rm -rf "$WORKSPACE"
433 name: clean-workspace-log
436 find $WORKSPACE -type f -name '*.log' | xargs rm -f
439 name: track-begin-timestamp
442 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
445 name: archive-artifacts
448 artifacts: '{artifacts}'
454 name: publish-coverage
457 report-file: "coverage.xml"
459 health-auto-update: "false"
460 stability-auto-update: "false"
461 zoom-coverage-chart: "true"
472 # The majority of the email-ext plugin options are set to the default
473 # for this macro so they can be managed through Jenkins' global
476 name: email-jenkins-admins-on-failure
480 attach-build-log: true
487 # Email PTL publishers
488 - email_ptl_defaults: &email_ptl_defaults
489 name: 'email_ptl_defaults'
491 attach-build-log: true
497 - publisher: &email_apex_ptl_defaults
498 name: 'email-apex-ptl'
501 <<: *email_ptl_defaults
505 name: 'email-apex-os-net-config-ptl'
506 <<: *email_apex_ptl_defaults
508 name: 'email-apex-puppet-tripleo-ptl'
509 <<: *email_apex_ptl_defaults
511 name: 'email-apex-tripleo-heat-templates-ptl'
512 <<: *email_apex_ptl_defaults
515 name: 'email-armband-ptl'
518 <<: *email_ptl_defaults
523 name: 'email-auto-ptl'
526 <<: *email_ptl_defaults
531 name: 'email-availability-ptl'
534 <<: *email_ptl_defaults
536 fuqiao@chinamobile.com
539 name: 'email-bamboo-ptl'
542 <<: *email_ptl_defaults
547 name: 'email-barometer-ptl'
550 <<: *email_ptl_defaults
555 name: 'email-bottlenecks-ptl'
558 <<: *email_ptl_defaults
560 gabriel.yuyang@huawei.com
563 name: 'email-calipso-ptl'
566 <<: *email_ptl_defaults
571 name: 'email-clover-ptl'
574 <<: *email_ptl_defaults
576 stephen.wong1@huawei.com
578 - publisher: &email_compass4nfv_ptl_defaults
579 name: 'email-compass4nfv-ptl'
582 <<: *email_ptl_defaults
586 name: 'email-compass-containers-ptl'
587 <<: *email_compass4nfv_ptl_defaults
590 name: 'email-conductor-ptl'
593 <<: *email_ptl_defaults
595 limingjiang@huawei.com
598 name: 'email-container4nfv-ptl'
601 <<: *email_ptl_defaults
603 jiaxuan@chinamobile.com
606 name: 'email-copper-ptl'
609 <<: *email_ptl_defaults
611 aimeeu.opensource@gmail.com
614 name: 'email-cperf-ptl'
617 <<: *email_ptl_defaults
622 name: 'email-daisy-ptl'
625 <<: *email_ptl_defaults
627 hu.zhijiang@zte.com.cn
630 name: 'email-doctor-ptl'
633 <<: *email_ptl_defaults
638 name: 'email-domino-ptl'
641 <<: *email_ptl_defaults
643 ulas.kozat@huawei.com
646 name: 'email-dovetail-ptl'
649 <<: *email_ptl_defaults
651 hongbo.tianhongbo@huawei.com
654 name: 'email-dpacc-ptl'
657 <<: *email_ptl_defaults
659 denglingli@chinamobile.com
662 name: 'email-enfv-ptl'
665 <<: *email_ptl_defaults
667 JBuchanan@advaoptical.com
670 name: 'email-escalator-ptl'
673 <<: *email_ptl_defaults
678 name: 'email-fastpathmetrics-ptl'
681 <<: *email_ptl_defaults
683 maryam.tahhan@intel.com
686 name: 'email-fds-ptl'
689 <<: *email_ptl_defaults
694 name: 'email-fuel-ptl'
697 <<: *email_ptl_defaults
699 gelkinbard@mirantis.com
702 name: 'email-functest-ptl'
705 <<: *email_ptl_defaults
707 cedric.ollivier@orange.com
710 name: 'email-ipv6-ptl'
713 <<: *email_ptl_defaults
718 name: 'email-joid-ptl'
721 <<: *email_ptl_defaults
723 artur.tyloch@canonical.com
726 name: 'email-kvmfornfv-ptl'
729 <<: *email_ptl_defaults
731 raghuveer.reddy@intel.com
734 name: 'email-models-ptl'
737 <<: *email_ptl_defaults
742 name: 'email-moon-ptl'
745 <<: *email_ptl_defaults
750 name: 'email-multisite-ptl'
753 <<: *email_ptl_defaults
758 name: 'email-netready-ptl'
761 <<: *email_ptl_defaults
763 georg.kunz@ericsson.com
766 name: 'email-nfvbench-ptl'
769 <<: *email_ptl_defaults
774 name: 'email-octopus-ptl'
777 <<: *email_ptl_defaults
779 ulrich.kleber@huawei.com
782 name: 'email-onosfw-ptl'
785 <<: *email_ptl_defaults
790 name: 'email-openretriever-ptl'
793 <<: *email_ptl_defaults
795 jiaxuan@chinamobile.com
798 name: 'email-opera-ptl'
801 <<: *email_ptl_defaults
803 Yingjun.li@huawei.com
806 name: 'email-opnfvdocs-ptl'
809 <<: *email_ptl_defaults
811 sofia.wallin@ericsson.com
814 name: 'email-orchestra-ptl'
817 <<: *email_ptl_defaults
819 giuseppe.carella@fokus.fraunhofer.de
822 name: 'email-ovn4nfv-ptl'
825 <<: *email_ptl_defaults
827 trinath.somanchi@gmail.com
830 name: 'email-ovno-ptl'
833 <<: *email_ptl_defaults
838 name: 'email-ovsnfv-ptl'
841 <<: *email_ptl_defaults
843 MarkD.Graymark.d.gray@intel.com
846 name: 'email-parser-ptl'
849 <<: *email_ptl_defaults
851 shang.xiaodong@zte.com.cn
853 - publisher: &email_pharos_ptl_defaults
854 name: 'email-pharos-ptl'
857 <<: *email_ptl_defaults
859 jack.morgan@intel.com
861 name: 'email-pharos-tools-ptl'
862 <<: *email_pharos_ptl_defaults
865 name: 'email-promise-ptl'
868 <<: *email_ptl_defaults
870 kunzmann@docomolab-euro.com
873 name: 'email-qtip-ptl'
876 <<: *email_ptl_defaults
878 wu.zhihui1@zte.com.cn
880 - publisher: &email_releng_ptl_defaults
881 name: 'email-releng-ptl'
884 <<: *email_ptl_defaults
886 fatih.degirmenci@ericsson.com
888 name: 'email-releng-anteater-ptl'
889 <<: *email_releng_ptl_defaults
891 name: 'email-releng-testresults-ptl'
894 <<: *email_ptl_defaults
896 fatih.degirmenci@ericsson.com
897 feng.xiaowei@zte.com.cn
899 name: 'email-releng-utils-ptl'
900 <<: *email_releng_ptl_defaults
902 name: 'email-releng-xci-ptl'
903 <<: *email_releng_ptl_defaults
906 name: 'email-samplevnf-ptl'
909 <<: *email_ptl_defaults
914 name: 'email-sdnvpn-ptl'
917 <<: *email_ptl_defaults
919 tim.irnich@ericsson.com
922 name: 'email-securityscanning-ptl'
925 <<: *email_ptl_defaults
930 name: 'email-sfc-ptl'
933 <<: *email_ptl_defaults
935 ManuelBuilmbuil@suse.com
938 name: 'email-snaps-ptl'
941 <<: *email_ptl_defaults
943 s.pisarski@cablelabs.com
946 name: 'email-stor4nfv-ptl'
949 <<: *email_ptl_defaults
954 name: 'email-storperf-ptl'
957 <<: *email_ptl_defaults
962 name: 'email-ves-ptl'
965 <<: *email_ptl_defaults
967 bryan.sullivan@att.com
970 name: 'email-vswitchperf-ptl'
973 <<: *email_ptl_defaults
975 sridhar.rao@spirent.com
978 name: 'email-yardstick-ptl'
981 <<: *email_ptl_defaults
983 ross.b.brattain@intel.com
986 name: 'report-provision-result'
989 script-only-if-succeeded: true
992 echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh
993 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
995 !include-raw-escape: installer-report.sh
997 script-only-if-failed: true
1000 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1001 echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh
1003 !include-raw-escape: installer-report.sh