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"
24 default: artifacts.akraino.org/$PROJECT
25 description: "URL to Google Storage."
29 description: "JJB configured BRANCH parameter"
33 description: "JJB configured GERRIT_BRANCH parameter (deprecated)"
36 default: 'refs/heads/{branch}'
37 description: "Default refspec needed for manually triggering."
41 name: logrotate-default
46 artifact-days-to-keep: 60
47 artifact-num-to-keep: 200
52 - git: &git-scm-defaults
53 credentials-id: 'jenkins-ssh'
70 choosing-strategy: 'gerrit'
71 refspec: '$GERRIT_REFSPEC'
75 name: git-scm-gerrit-with-submodules
78 choosing-strategy: 'gerrit'
79 refspec: '$GERRIT_REFSPEC'
86 name: 'daily-trigger-disabled'
91 name: 'weekly-trigger-disabled'
96 name: gerrit-trigger-patchset-created
99 server-name: 'gerrit.akraino.org'
101 - patchset-created-event:
102 exclude-drafts: 'false'
103 exclude-trivial-rebase: 'false'
104 exclude-no-code-change: 'false'
105 - draft-published-event
106 - comment-added-contains-event:
107 comment-contains-value: 'recheck'
108 - comment-added-contains-event:
109 comment-contains-value: 'reverify'
111 - project-compare-type: 'ANT'
112 project-pattern: '{project}'
114 - branch-compare-type: 'ANT'
115 branch-pattern: '**/{branch}'
117 - compare-type: 'ANT'
126 name: ssh-agent-wrapper
128 - ssh-agent-credentials:
137 timeout-var: 'BUILD_TIMEOUT'
141 name: fix-workspace-permissions
146 sudo chown -R $USER:$USER $WORKSPACE || exit 1
149 name: upload-under-review-docs-to-akraino-artifacts
156 export PATH=$PATH:/usr/local/bin/
158 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
159 [[ -d docs/_build/ ]] || exit 0
162 echo "###########################"
163 echo "UPLOADING DOCS UNDER REVIEW"
164 echo "###########################"
167 gs_base="artifacts.akraino.org/$PROJECT/review"
168 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
169 local_path="upload/$GERRIT_CHANGE_NUMBER"
172 mv docs/_build/html/ "$local_path"
173 gsutil -m cp -r "$local_path" "gs://$gs_base"
176 -h "Content-Type:text/html" \
177 -h "Cache-Control:private, max-age=0, no-transform" \
178 "gs://$gs_path"/**.html > /dev/null 2>&1
180 echo "Document link(s):" >> gerrit_comment.txt
181 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
182 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
184 # To take advantage of this macro, have your build write
185 # out the file 'gerrit_comment.txt' with information to post
186 # back to gerrit and include this macro in the list of builders.
188 name: report-build-result-to-gerrit
195 export PATH=$PATH:/usr/local/bin/
196 if [[ -e gerrit_comment.txt ]] ; then
198 echo "posting review comment to gerrit..."
200 cat gerrit_comment.txt
202 ssh -p 29418 gerrit.akraino.org \
203 "gerrit review -p $GERRIT_PROJECT \
204 -m '$(cat gerrit_comment.txt)' \
205 $GERRIT_PATCHSET_REVISION \
210 name: remove-old-docs-from-akraino-artifacts
217 export PATH=$PATH:/usr/local/bin/
219 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
221 gs_path="artifacts.akraino.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
223 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
225 echo "Deleting Out-of-dated Documents..."
226 gsutil -m rm -r "gs://$gs_path"
228 gs_path="artifacts.akraino.org/review/$GERRIT_CHANGE_NUMBER"
230 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
232 echo "Deleting Out-of-dated Documents..."
233 gsutil -m rm -r "gs://$gs_path"
237 name: upload-review-docs
239 - upload-under-review-docs-to-akraino-artifacts
240 - report-build-result-to-gerrit
244 name: clean-workspace
251 sudo /bin/rm -rf "$WORKSPACE"
254 name: clean-workspace-log
257 find $WORKSPACE -type f -name '*.log' | xargs rm -f
260 name: archive-artifacts
263 artifacts: '{artifacts}'
269 name: publish-coverage
272 report-file: "coverage.xml"
274 health-auto-update: "false"
275 stability-auto-update: "false"
276 zoom-coverage-chart: "true"