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'
148 name: build-html-and-pdf-docs-output
153 export PATH=$PATH:/usr/local/bin/
155 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
157 git_sha1="$(git rev-parse HEAD)"
159 find docs/ -type f -iname '*.rst' -print0 | while read file
161 sed -i "s/_sha1_/$git_sha1/g" "$file"
164 find docs/ -name 'index.rst' -printf '%h\n' | while read dir
168 _output="docs/output/$_name"
171 echo "#################${{dir//?/#}}"
172 echo "Building DOCS in ${{dir}}"
173 echo "#################${{dir//?/#}}"
178 sphinx-build -b html -E -c docs/etc "$dir" "$_output"
180 sphinx-build -b latex -E -c docs/etc "$dir" "$_build"
181 make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
182 mv "$_build"/*.pdf "$_output"
186 name: upload-under-review-docs-to-opnfv-artifacts
191 export PATH=$PATH:/usr/local/bin/
193 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
197 echo "##########################"
198 echo "UPLOADING DOCS UNER REVIEW"
199 echo "##########################"
202 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
204 gsutil cp -r docs/output/* "gs://$gs_path"
206 gsutil ls "gs://$gs_path" | grep -e 'html$' | while read file
209 -h "Content-Type:text/html" \
210 -h "Cache-Control:private, max-age=0, no-transform" \
214 gerrit_comment="Document link(s):
215 $(gsutil ls "gs://$gs_path" | grep -e 'index.html$' -e 'pdf$' | sed 's/^gs/http/')"
217 echo "$gerrit_comment"
219 {gerrit-review} -p {project} -m "$gerrit_comment" $GERRIT_PATCHSET_REVISION
222 name: upload-merged-docs-to-opnfv-artifacts
227 export PATH=$PATH:/usr/local/bin/
232 echo "#####################"
233 echo "UPLOADING MERGED DOCS"
234 echo "#####################"
237 if [[ "{branch}" == "master" ]] ; then
238 gs_path="artifacts.opnfv.org/{project}/docs"
240 gs_path="artifacts.opnfv.org/{project}/{branch}/docs"
243 gsutil cp -r docs/output/* "gs://$gs_path"
245 gsutil ls "gs://$gs_path" | grep -e 'html$' | while read file
248 -h "Content-Type:text/html" \
249 -h "Cache-Control:private, max-age=0, no-transform" \
253 gerrit_comment="Document link(s):
254 $(gsutil ls "gs://$gs_path" | grep -e 'index.html$' -e 'pdf$' | sed 's/^gs/http/')"
256 echo "$gerrit_comment"
258 {gerrit-review} -p {project} -m "$gerrit_comment" $GERRIT_PATCHSET_REVISION
261 name: remove-old-docs-from-opnfv-artifacts
265 export PATH=$PATH:/usr/local/bin/
267 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
269 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
271 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
273 echo "Deleting Out-of-dated Documents..."
274 gsutil rm -r "gs://$gs_path_review"