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 # Reporting Deployment Results
46 # To report deployment results to
47 # http://testresults.opnfv.org/test/#/deployresults, add the following
48 # parameters, builders, and publishers to a deployment job:
54 # - track-begin-timestamp
57 # - report-provision-result
59 # Note: The following string parameter must also exist, as they are used
60 # when reporting the provision result:
66 # most installers include these but you should verify first before
67 # adding the publisher, otherwise the deployment build may be marked
72 name: testapi-parameter
76 default: 'http://testresults.opnfv.org/test/api/v1'
77 description: "Default TestAPI URL, currently using v1"
79 name: INSTALLER_VERSION
81 description: "Installer release version"
83 name: UPSTREAM_JOB_NAME
85 description: "Parent job name in Jenkins"
87 name: UPSTREAM_BUILD_ID
89 description: "Parent job build_id in Jenkins"
92 name: logrotate-default
97 artifact-days-to-keep: 60
98 artifact-num-to-keep: 200
103 - git: &git-scm-defaults
104 credentials-id: 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
121 choosing-strategy: 'gerrit'
122 refspec: '$GERRIT_REFSPEC'
123 <<: *git-scm-defaults
126 name: git-scm-gerrit-with-submodules
129 choosing-strategy: 'gerrit'
130 refspec: '$GERRIT_REFSPEC'
134 <<: *git-scm-defaults
136 name: git-scm-with-submodules
139 credentials-id: 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
143 - 'refs/heads/{branch}'
152 name: git-scm-openstack
154 - git: &git-scm-openstack-defaults
163 name: 'daily-trigger-disabled'
168 name: 'weekly-trigger-disabled'
173 name: gerrit-trigger-patchset-created
176 server-name: 'gerrit.opnfv.org'
178 - patchset-created-event:
179 exclude-drafts: 'false'
180 exclude-trivial-rebase: 'false'
181 exclude-no-code-change: 'false'
182 - draft-published-event
183 - comment-added-contains-event:
184 comment-contains-value: 'recheck'
185 - comment-added-contains-event:
186 comment-contains-value: 'reverify'
188 - project-compare-type: 'ANT'
189 project-pattern: '{project}'
191 - branch-compare-type: 'ANT'
192 branch-pattern: '**/{branch}'
194 - compare-type: 'ANT'
203 name: gerrit-trigger-patchset-approved
206 server-name: 'gerrit.opnfv.org'
208 - comment-added-event:
209 approval-category: 'CRVW'
211 - comment-added-contains-event:
212 comment-contains-value: 'gate'
214 - project-compare-type: 'ANT'
215 project-pattern: '{project}'
217 - branch-compare-type: 'ANT'
218 branch-pattern: '**/{branch}'
220 - compare-type: 'ANT'
229 name: gerrit-trigger-change-merged
232 server-name: 'gerrit.opnfv.org'
234 - change-merged-event
235 - comment-added-contains-event:
236 comment-contains-value: 'remerge'
238 - project-compare-type: 'ANT'
239 project-pattern: '{project}'
241 - branch-compare-type: 'ANT'
242 branch-pattern: '**/{branch}'
244 - compare-type: 'ANT'
248 name: gerrit-trigger-tag-created
251 server-name: 'gerrit.opnfv.org'
255 - project-compare-type: 'ANT'
256 project-pattern: '{project}'
258 - branch-compare-type: 'ANT'
259 branch-pattern: 'refs/tags/**'
265 server-name: 'gerrit.opnfv.org'
267 - comment-added-contains-event:
268 comment-contains-value: 'check-experimental'
270 - project-compare-type: 'ANT'
271 project-pattern: '{project}'
273 - branch-compare-type: 'ANT'
274 branch-pattern: '**/{branch}'
276 - compare-type: 'ANT'
285 name: ssh-agent-wrapper
287 - ssh-agent-credentials:
289 - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e'
296 timeout-var: 'BUILD_TIMEOUT'
300 name: fix-workspace-permissions
305 sudo chown -R $USER:$USER $WORKSPACE || exit 1
308 name: upload-under-review-docs-to-opnfv-artifacts
315 export PATH=$PATH:/usr/local/bin/
317 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
318 [[ -d docs/_build/ ]] || exit 0
321 echo "###########################"
322 echo "UPLOADING DOCS UNDER REVIEW"
323 echo "###########################"
326 gs_base="artifacts.opnfv.org/$PROJECT/review"
327 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
328 local_path="upload/$GERRIT_CHANGE_NUMBER"
331 mv docs/_build/html/ "$local_path"
332 gsutil -m cp -r "$local_path" "gs://$gs_base"
335 -h "Content-Type:text/html" \
336 -h "Cache-Control:private, max-age=0, no-transform" \
337 "gs://$gs_path"/**.html > /dev/null 2>&1
339 echo "Document link(s):" >> gerrit_comment.txt
340 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
341 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
343 # To take advantage of this macro, have your build write
344 # out the file 'gerrit_comment.txt' with information to post
345 # back to gerrit and include this macro in the list of builders.
347 name: report-build-result-to-gerrit
354 export PATH=$PATH:/usr/local/bin/
355 if [[ -e gerrit_comment.txt ]] ; then
357 echo "posting review comment to gerrit..."
359 cat gerrit_comment.txt
361 ssh -p 29418 gerrit.opnfv.org \
362 "gerrit review -p $GERRIT_PROJECT \
363 -m '$(cat gerrit_comment.txt)' \
364 $GERRIT_PATCHSET_REVISION \
369 name: remove-old-docs-from-opnfv-artifacts
376 export PATH=$PATH:/usr/local/bin/
378 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
380 gs_path="artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
382 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
384 echo "Deleting Out-of-dated Documents..."
385 gsutil -m rm -r "gs://$gs_path"
387 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
389 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
391 echo "Deleting Out-of-dated Documents..."
392 gsutil -m rm -r "gs://$gs_path"
396 name: upload-review-docs
398 - upload-under-review-docs-to-opnfv-artifacts
399 - report-build-result-to-gerrit
406 # Ensure we start with a clean environment
407 rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
408 git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
415 if [[ -s violation.log ]]; then
417 echo "Reporting lint result...."
419 msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
420 sed -i -e "1s#^#${msg}\n\n#" violation.log
421 cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
422 ssh -p 29418 gerrit.opnfv.org "$cmd"
424 # Make sure the caller job failed
433 echo "Checking bash code..."
434 for f in $(egrep '\.sh$' modified_files)
436 bash -n "$f" 2>> bash-violation.log
438 if [[ -s bash-violation.log ]]; then
439 echo -e "Bash syntax error(s)\n---" >> violation.log
440 sed -e 's/^/ /g' bash-violation.log >> violation.log
444 name: lint-python-code
448 # Install python package
449 sudo -H pip install "flake8==2.6.2"
451 echo "Checking python code..."
452 for f in $(egrep '\.py$' modified_files)
454 flake8 "$f" >> python-violation.log
456 if [[ -s python-violation.log ]]; then
457 echo -e "Python violation(s)\n---" >> violation.log
458 sed -e 's/^/ /g' python-violation.log >> violation.log
466 # sudo Install python packages
467 sudo -H pip install "yamllint==1.8.2"
469 echo "Checking yaml file..."
470 for f in $(egrep '\.ya?ml$' modified_files)
472 yamllint "$f" >> yaml-violation.log
474 if [[ -s yaml-violation.log ]]; then
475 echo -e "YAML violation(s)\n---" >> violation.log
476 sed -e 's/^/ /g' yaml-violation.log >> violation.log
489 name: clean-workspace
496 sudo /bin/rm -rf "$WORKSPACE"
499 name: clean-workspace-log
502 find $WORKSPACE -type f -name '*.log' | xargs rm -f
505 name: track-begin-timestamp
508 echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
511 name: archive-artifacts
514 artifacts: '{artifacts}'
520 name: publish-coverage
523 report-file: "coverage.xml"
525 health-auto-update: "false"
526 stability-auto-update: "false"
527 zoom-coverage-chart: "true"
538 # The majority of the email-ext plugin options are set to the default
539 # for this macro so they can be managed through Jenkins' global
542 name: email-jenkins-admins-on-failure
546 attach-build-log: true
553 # Email PTL publishers
554 - email_ptl_defaults: &email_ptl_defaults
555 name: 'email_ptl_defaults'
557 attach-build-log: true
563 - publisher: &email_apex_ptl_defaults
564 name: 'email-apex-ptl'
567 <<: *email_ptl_defaults
571 name: 'email-apex-os-net-config-ptl'
572 <<: *email_apex_ptl_defaults
574 name: 'email-apex-puppet-tripleo-ptl'
575 <<: *email_apex_ptl_defaults
577 name: 'email-apex-tripleo-heat-templates-ptl'
578 <<: *email_apex_ptl_defaults
581 name: 'email-armband-ptl'
584 <<: *email_ptl_defaults
589 name: 'email-auto-ptl'
592 <<: *email_ptl_defaults
597 name: 'email-availability-ptl'
600 <<: *email_ptl_defaults
602 fuqiao@chinamobile.com
605 name: 'email-bamboo-ptl'
608 <<: *email_ptl_defaults
613 name: 'email-barometer-ptl'
616 <<: *email_ptl_defaults
621 name: 'email-bottlenecks-ptl'
624 <<: *email_ptl_defaults
626 gabriel.yuyang@huawei.com
629 name: 'email-calipso-ptl'
632 <<: *email_ptl_defaults
637 name: 'email-clover-ptl'
640 <<: *email_ptl_defaults
642 stephen.wong1@huawei.com
645 name: 'email-conductor-ptl'
648 <<: *email_ptl_defaults
650 limingjiang@huawei.com
653 name: 'email-container4nfv-ptl'
656 <<: *email_ptl_defaults
658 jiaxuan@chinamobile.com
661 name: 'email-cperf-ptl'
664 <<: *email_ptl_defaults
669 name: 'email-daisy-ptl'
672 <<: *email_ptl_defaults
674 hu.zhijiang@zte.com.cn
677 name: 'email-doctor-ptl'
680 <<: *email_ptl_defaults
685 name: 'email-domino-ptl'
688 <<: *email_ptl_defaults
690 ulas.kozat@huawei.com
693 name: 'email-dovetail-ptl'
696 <<: *email_ptl_defaults
698 georg.kunz@ericsson.com
701 name: 'email-dpacc-ptl'
704 <<: *email_ptl_defaults
706 denglingli@chinamobile.com
709 name: 'email-enfv-ptl'
712 <<: *email_ptl_defaults
714 JBuchanan@advaoptical.com
717 name: 'email-fds-ptl'
720 <<: *email_ptl_defaults
725 name: 'email-fuel-ptl'
728 <<: *email_ptl_defaults
730 Alexandru.Avadanii@enea.com
733 name: 'email-functest-ptl'
736 <<: *email_ptl_defaults
738 cedric.ollivier@orange.com
741 name: 'email-ipv6-ptl'
744 <<: *email_ptl_defaults
749 name: 'email-joid-ptl'
752 <<: *email_ptl_defaults
754 artur.tyloch@canonical.com
757 name: 'email-kvmfornfv-ptl'
760 <<: *email_ptl_defaults
762 raghuveer.reddy@intel.com
765 name: 'email-models-ptl'
768 <<: *email_ptl_defaults
773 name: 'email-moon-ptl'
776 <<: *email_ptl_defaults
781 name: 'email-nfvbench-ptl'
784 <<: *email_ptl_defaults
789 name: 'email-onosfw-ptl'
792 <<: *email_ptl_defaults
797 name: 'email-opera-ptl'
800 <<: *email_ptl_defaults
802 Yingjun.li@huawei.com
805 name: 'email-opnfvdocs-ptl'
808 <<: *email_ptl_defaults
810 sofia.wallin@ericsson.com
813 name: 'email-orchestra-ptl'
816 <<: *email_ptl_defaults
818 giuseppe.carella@fokus.fraunhofer.de
821 name: 'email-ovn4nfv-ptl'
824 <<: *email_ptl_defaults
826 trinath.somanchi@gmail.com
829 name: 'email-ovno-ptl'
832 <<: *email_ptl_defaults
837 name: 'email-ovsnfv-ptl'
840 <<: *email_ptl_defaults
842 MarkD.Graymark.d.gray@intel.com
845 name: 'email-parser-ptl'
848 <<: *email_ptl_defaults
850 shang.xiaodong@zte.com.cn
852 - publisher: &email_pharos_ptl_defaults
853 name: 'email-pharos-ptl'
856 <<: *email_ptl_defaults
860 - publisher: &email_laas_ptl_defaults
861 name: 'email-laas-ptl'
864 <<: *email_laas_ptl_defaults
866 pberberian@iol.unh.edu
869 name: 'email-promise-ptl'
872 <<: *email_ptl_defaults
874 kunzmann@docomolab-euro.com
877 name: 'email-qtip-ptl'
880 <<: *email_ptl_defaults
882 wu.zhihui1@zte.com.cn
884 - publisher: &email_releng_ptl_defaults
885 name: 'email-releng-ptl'
888 <<: *email_ptl_defaults
890 tbramwell@linuxfoundation.org
892 name: 'email-releng-anteater-ptl'
893 <<: *email_releng_ptl_defaults
895 name: 'email-releng-testresults-ptl'
898 <<: *email_ptl_defaults
900 fatih.degirmenci@ericsson.com
901 feng.xiaowei@zte.com.cn
903 name: 'email-releng-utils-ptl'
904 <<: *email_releng_ptl_defaults
906 name: 'email-releng-xci-ptl'
909 <<: *email_ptl_defaults
911 fatih.degirmenci@ericsson.com
914 name: 'email-samplevnf-ptl'
917 <<: *email_ptl_defaults
922 name: 'email-sdnvpn-ptl'
925 <<: *email_ptl_defaults
927 tim.irnich@ericsson.com
930 name: 'email-securityscanning-ptl'
933 <<: *email_ptl_defaults
938 name: 'email-sfc-ptl'
941 <<: *email_ptl_defaults
946 name: 'email-snaps-ptl'
949 <<: *email_ptl_defaults
951 s.pisarski@cablelabs.com
954 name: 'email-stor4nfv-ptl'
957 <<: *email_ptl_defaults
962 name: 'email-storperf-ptl'
965 <<: *email_ptl_defaults
970 name: 'email-ves-ptl'
973 <<: *email_ptl_defaults
975 bryan.sullivan@att.com
978 name: 'email-vswitchperf-ptl'
981 <<: *email_ptl_defaults
983 sridhar.rao@spirent.com
986 name: 'email-yardstick-ptl'
989 <<: *email_ptl_defaults
991 ross.b.brattain@intel.com
994 name: 'report-provision-result'
1003 echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
1004 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1005 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1007 !include-raw: installer-report.sh
1008 mark-unstable-if-failed: true
1019 echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
1020 echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
1021 echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
1023 !include-raw: installer-report.sh
1024 mark-unstable-if-failed: true