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"
193 sphinx-build -b html -E "$dir" "$_output"
195 # Note: PDF creation may fail in project doc builds.
196 # We allow this test to be marked as succeeded with
197 # failure in PDF creation, but leave message to fix it.
198 # Any failure has to be fixed before B release.
200 sphinx-build -b latex -E "$dir" "$_build"
201 make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
202 mv "$_build"/*.pdf "$_output"
204 _msg="Error: PDF creation for $dir has failed, please fix source rst file(s)."
208 echo "$_msg" >> gerrit_comment.txt
213 name: upload-under-review-docs-to-opnfv-artifacts
218 export PATH=$PATH:/usr/local/bin/
220 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
224 echo "###########################"
225 echo "UPLOADING DOCS UNDER REVIEW"
226 echo "###########################"
229 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
231 gsutil -m cp -r docs/output/* "gs://$gs_path"
233 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
235 -h "Content-Type:text/html" \
236 -h "Cache-Control:private, max-age=0, no-transform" \
237 "gs://$gs_path"/**.html
240 echo "Document link(s):" >> gerrit_comment.txt
241 find docs/output | grep -e 'index.html$' -e 'pdf$' | \
242 sed -e "s|^docs/output| http://$gs_path|" >> gerrit_comment.txt
245 name: upload-merged-docs-to-opnfv-artifacts
250 export PATH=$PATH:/usr/local/bin/
255 echo "#####################"
256 echo "UPLOADING MERGED DOCS"
257 echo "#####################"
260 if [[ "$GERRIT_BRANCH" == "master" ]] ; then
261 gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/docs"
263 gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH/docs"
266 gsutil -m cp -r docs/output/* "gs://$gs_path"
268 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
270 -h "Content-Type:text/html" \
271 -h "Cache-Control:private, max-age=0, no-transform" \
272 "gs://$gs_path"/**.html
275 echo "Document link(s):" >> gerrit_comment.txt
276 find docs/output | grep -e 'index.html$' -e 'pdf$' | \
277 sed -e "s|^docs/output| http://$gs_path|" >> gerrit_comment.txt
280 name: report-docs-build-result-to-gerrit
284 export PATH=$PATH:/usr/local/bin/
285 if [[ -e gerrit_comment.txt ]] ; then
287 echo "posting review comment to gerrit..."
289 cat gerrit_comment.txt
291 ssh -p 29418 gerrit.opnfv.org \
292 "gerrit review -p $GERRIT_PROJECT \
293 -m '$(cat gerrit_comment.txt)' \
294 $GERRIT_PATCHSET_REVISION"
298 name: remove-old-docs-from-opnfv-artifacts
302 export PATH=$PATH:/usr/local/bin/
304 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
306 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
308 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
310 echo "Deleting Out-of-dated Documents..."
311 gsutil -m rm -r "gs://$gs_path"
315 name: upload-review-docs
317 - build-html-and-pdf-docs-output
318 - upload-under-review-docs-to-opnfv-artifacts
319 - report-docs-build-result-to-gerrit
322 name: upload-merged-docs
324 - build-html-and-pdf-docs-output
325 - upload-merged-docs-to-opnfv-artifacts
326 - report-docs-build-result-to-gerrit
327 - remove-old-docs-from-opnfv-artifacts