4 name: project-parameter
9 description: "JJB configured PROJECT parameter to identify an opnfv Gerrit project"
12 name: gerrit-parameter
17 description: "JJB configured GERRIT_BRANCH parameter"
23 credentials-id: '{credentials-id}'
32 name: gerrit-trigger-scm
35 credentials-id: '{credentials-id}'
39 - 'origin/$GERRIT_BRANCH'
41 choosing-strategy: '{choosing-strategy}'
52 name: gerrit-trigger-patch-submitted
55 server-name: 'gerrit.opnfv.org'
57 - patchset-created-event:
58 exclude-drafts: 'false'
59 exclude-trivial-rebase: 'false'
60 exclude-no-code-change: 'false'
61 - draft-published-event
62 - comment-added-contains-event:
63 comment-contains-value: 'recheck'
65 - project-compare-type: 'ANT'
66 project-pattern: '{name}'
68 - branch-compare-type: 'ANT'
69 branch-pattern: '**/{branch}'
72 name: gerrit-trigger-patch-merged
75 server-name: 'gerrit.opnfv.org'
78 - comment-added-contains-event:
79 comment-contains-value: 'remerge'
81 - project-compare-type: 'ANT'
82 project-pattern: '{name}'
84 - branch-compare-type: 'ANT'
85 branch-pattern: '**/{branch}'
88 name: archive-artifacts
91 artifacts: '{artifacts}'
97 name: email-notification
100 recipients: 'jenkins@lists.opnfv.org'
102 content-type: default
103 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
105 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
107 Check console output at $BUILD_URL to view the results.
118 exec-pattern: "**/**.exec"
119 class-pattern: "**/classes"
120 source-pattern: "**/src/main/java"
121 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**"
135 - shell: 'echo testing macro "test-macro"'
138 name: wipe-org-opendaylight-repo
140 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
143 name: jacoco-nojava-workaround
145 - shell: 'mkdir -p $WORKSPACE/target/classes'
151 name: build-html-and-pdf-docs-output
156 export PATH=$PATH:/usr/local/bin/
158 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
162 from docutils import core
163 with open('index.rst', 'r') as file:
165 doctree = core.publish_doctree(data,
166 settings_overrides={'report_level': 5,
168 print doctree[0].astext()"
169 _git_sha1="$(git rev-parse HEAD)"
171 find docs/ -name 'index.rst' -printf '%h\n' | while read dir
175 _output="docs/output/$_name"
178 echo "#################${dir//?/#}"
179 echo "Building DOCS in $dir"
180 echo "#################${dir//?/#}"
183 sed -i "s/_sha1_/$_git_sha1/g" "$dir/index.rst"
185 if [[ ! -f "$dir/conf.py" ]] ; then
186 cp "docs/etc/conf.py" "$dir/conf.py"
187 _title=$(cd $dir; python -c "$_get_title_script")
188 echo "latex_documents = [('index', '$_name.tex', '$_title', 'OPNFV', 'manual'),]" >> "$dir/conf.py"
190 cp -f "docs/etc/opnfv-logo.png" "$dir/opnfv-logo.png"
194 sphinx-build -b html -E "$dir" "$_output"
196 # Note: PDF creation may fail in project doc builds.
197 # We allow this test to be marked as succeeded with
198 # failure in PDF creation, but leave message to fix it.
199 # Any failure has to be fixed before B release.
201 sphinx-build -b latex -E "$dir" "$_build"
202 make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
203 mv "$_build"/*.pdf "$_output"
205 _msg="Error: PDF creation for $dir has failed, please fix source rst file(s)."
209 echo "$_msg" >> gerrit_comment.txt
214 name: upload-under-review-docs-to-opnfv-artifacts
219 export PATH=$PATH:/usr/local/bin/
221 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
225 echo "###########################"
226 echo "UPLOADING DOCS UNDER REVIEW"
227 echo "###########################"
230 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
232 gsutil -m cp -r docs/output/* "gs://$gs_path"
234 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
236 -h "Content-Type:text/html" \
237 -h "Cache-Control:private, max-age=0, no-transform" \
238 "gs://$gs_path"/**.html
241 echo "Document link(s):" >> gerrit_comment.txt
242 find docs/output | grep -e 'index.html$' -e 'pdf$' | \
243 sed -e "s|^docs/output| http://$gs_path|" >> gerrit_comment.txt
246 name: upload-merged-docs-to-opnfv-artifacts
251 export PATH=$PATH:/usr/local/bin/
256 echo "#####################"
257 echo "UPLOADING MERGED DOCS"
258 echo "#####################"
261 if [[ "$GERRIT_BRANCH" == "master" ]] ; then
262 gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/docs"
264 gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH/docs"
267 gsutil -m cp -r docs/output/* "gs://$gs_path"
269 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
271 -h "Content-Type:text/html" \
272 -h "Cache-Control:private, max-age=0, no-transform" \
273 "gs://$gs_path"/**.html
276 echo "Document link(s):" >> gerrit_comment.txt
277 find docs/output | grep -e 'index.html$' -e 'pdf$' | \
278 sed -e "s|^docs/output| http://$gs_path|" >> gerrit_comment.txt
281 name: report-docs-build-result-to-gerrit
285 export PATH=$PATH:/usr/local/bin/
286 if [[ -e gerrit_comment.txt ]] ; then
288 echo "posting review comment to gerrit..."
290 cat gerrit_comment.txt
292 ssh -p 29418 gerrit.opnfv.org \
293 "gerrit review -p $GERRIT_PROJECT \
294 -m '$(cat gerrit_comment.txt)' \
295 $GERRIT_PATCHSET_REVISION"
299 name: remove-old-docs-from-opnfv-artifacts
303 export PATH=$PATH:/usr/local/bin/
305 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
307 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
309 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
311 echo "Deleting Out-of-dated Documents..."
312 gsutil -m rm -r "gs://$gs_path"
316 name: upload-review-docs
318 - build-html-and-pdf-docs-output
319 - upload-under-review-docs-to-opnfv-artifacts
320 - report-docs-build-result-to-gerrit
323 name: upload-merged-docs
325 - build-html-and-pdf-docs-output
326 - upload-merged-docs-to-opnfv-artifacts
327 - report-docs-build-result-to-gerrit
328 - remove-old-docs-from-opnfv-artifacts