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 =~ .+ ]]
160 git_sha1="$(git rev-parse HEAD)"
162 find docs/ -type f -iname '*.rst' -print0 | while read file
164 sed -i "s/_sha1_/$git_sha1/g" "$file"
167 find docs/ -name 'index.rst' -printf '%h\n' | while read dir
171 _output="docs/output/$_name"
174 echo "#################${dir//?/#}"
175 echo "Building DOCS in $dir"
176 echo "#################${dir//?/#}"
181 sphinx-build -b html -E -c docs/etc "$dir" "$_output"
183 sphinx-build -b latex -E -c docs/etc -D project=$_name "$dir" "$_build"
184 make -C "$_build" LATEXOPTS='--interaction=nonstopmode' all-pdf
185 mv "$_build"/*.pdf "$_output"
188 #TODO(r-mibu): change this to publisher
190 name: upload-under-review-docs-to-opnfv-artifacts
195 export PATH=$PATH:/usr/local/bin/
197 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
201 echo "###########################"
202 echo "UPLOADING DOCS UNDER REVIEW"
203 echo "###########################"
206 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
208 gsutil -m cp -r docs/output/* "gs://$gs_path"
210 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
212 -h "Content-Type:text/html" \
213 -h "Cache-Control:private, max-age=0, no-transform" \
214 "gs://$gs_path"/**.html
217 gerrit_comment="Document link(s): $(gsutil ls gs://$gs_path | grep -e 'index.html$' -e 'pdf$' | sed 's/^gs/http/')"
219 echo "$gerrit_comment"
221 {gerrit-review} -p {project} -m "$gerrit_comment" $GERRIT_PATCHSET_REVISION
223 #TODO(r-mibu): change this to publisher
225 name: upload-merged-docs-to-opnfv-artifacts
230 export PATH=$PATH:/usr/local/bin/
235 echo "#####################"
236 echo "UPLOADING MERGED DOCS"
237 echo "#####################"
240 if [[ "{branch}" == "master" ]] ; then
241 gs_path="artifacts.opnfv.org/{project}/docs"
243 gs_path="artifacts.opnfv.org/{project}/{branch}/docs"
246 gsutil -m cp -r docs/output/* "gs://$gs_path"
248 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
250 -h "Content-Type:text/html" \
251 -h "Cache-Control:private, max-age=0, no-transform" \
252 "gs://$gs_path"/**.html
255 gerrit_comment="Document link(s): $(gsutil ls gs://$gs_path | grep -e 'index.html$' -e 'pdf$' | sed 's/^gs/http/')"
257 echo "$gerrit_comment"
259 {gerrit-review} -p {project} -m "$gerrit_comment" $GERRIT_PATCHSET_REVISION
261 #TODO(r-mibu): change this to publisher
263 name: remove-old-docs-from-opnfv-artifacts
267 export PATH=$PATH:/usr/local/bin/
269 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
271 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
273 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
275 echo "Deleting Out-of-dated Documents..."
276 gsutil -m rm -r "gs://$gs_path_review"