4 name: project-parameter
9 description: "JJB configured PROJECT parameter to identify an opnfv Gerrit project"
12 default: artifacts.opnfv.org/$PROJECT
13 description: "URL to Google Storage."
16 default: build.opnfv.org/artifacts/$PROJECT
17 description: "URL to Google Storage proxy"
20 name: gerrit-parameter
25 description: "JJB configured GERRIT_BRANCH parameter"
31 credentials-id: '{credentials-id}'
40 name: gerrit-trigger-scm
43 credentials-id: '{credentials-id}'
47 - 'origin/$GERRIT_BRANCH'
49 choosing-strategy: '{choosing-strategy}'
60 name: gerrit-trigger-patch-submitted
63 server-name: 'gerrit.opnfv.org'
65 - patchset-created-event:
66 exclude-drafts: 'false'
67 exclude-trivial-rebase: 'false'
68 exclude-no-code-change: 'false'
69 - draft-published-event
70 - comment-added-contains-event:
71 comment-contains-value: 'recheck'
73 - project-compare-type: 'ANT'
74 project-pattern: '{name}'
76 - branch-compare-type: 'ANT'
77 branch-pattern: '**/{branch}'
80 name: gerrit-trigger-patch-merged
83 server-name: 'gerrit.opnfv.org'
86 - comment-added-contains-event:
87 comment-contains-value: 'remerge'
89 - project-compare-type: 'ANT'
90 project-pattern: '{name}'
92 - branch-compare-type: 'ANT'
93 branch-pattern: '**/{branch}'
96 name: archive-artifacts
99 artifacts: '{artifacts}'
105 name: email-notification
108 recipients: 'jenkins@lists.opnfv.org'
110 content-type: default
111 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
113 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
115 Check console output at $BUILD_URL to view the results.
126 exec-pattern: "**/**.exec"
127 class-pattern: "**/classes"
128 source-pattern: "**/src/main/java"
129 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**"
143 - shell: 'echo testing macro "test-macro"'
146 name: wipe-org-opendaylight-repo
148 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
151 name: jacoco-nojava-workaround
153 - shell: 'mkdir -p $WORKSPACE/target/classes'
159 name: build-html-and-pdf-docs-output
163 export PATH=$PATH:/usr/local/bin/
164 git clone ssh://gerrit.opnfv.org:29418/releng
165 GERRIT_COMMENT=gerrit_comment.txt ./releng/utils/docs-build.sh
168 name: upload-under-review-docs-to-opnfv-artifacts
173 export PATH=$PATH:/usr/local/bin/
175 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
179 echo "###########################"
180 echo "UPLOADING DOCS UNDER REVIEW"
181 echo "###########################"
184 gs_base="artifacts.opnfv.org/review"
185 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
186 local_path="upload/$GERRIT_CHANGE_NUMBER"
189 mv output "$local_path"
190 gsutil -m cp -r "$local_path" "gs://$gs_base"
192 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
194 -h "Content-Type:text/html" \
195 -h "Cache-Control:private, max-age=0, no-transform" \
196 "gs://$gs_path"/**.html
199 echo "Document link(s):" >> gerrit_comment.txt
200 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
201 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
204 name: upload-merged-docs-to-opnfv-artifacts
209 export PATH=$PATH:/usr/local/bin/
214 echo "#####################"
215 echo "UPLOADING MERGED DOCS"
216 echo "#####################"
219 if [[ "$GERRIT_BRANCH" == "master" ]] ; then
220 gs_base="artifacts.opnfv.org/$GERRIT_PROJECT"
222 gs_base="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH"
224 gs_path="$gs_base/docs"
225 local_path="upload/docs"
228 mv output "$local_path"
229 gsutil -m cp -r "$local_path" "gs://$gs_base"
231 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
233 -h "Content-Type:text/html" \
234 -h "Cache-Control:private, max-age=0, no-transform" \
235 "gs://$gs_path"/**.html
238 echo "Document link(s):" >> gerrit_comment.txt
239 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
240 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
243 name: report-docs-build-result-to-gerrit
247 export PATH=$PATH:/usr/local/bin/
248 if [[ -e gerrit_comment.txt ]] ; then
250 echo "posting review comment to gerrit..."
252 cat gerrit_comment.txt
254 ssh -p 29418 gerrit.opnfv.org \
255 "gerrit review -p $GERRIT_PROJECT \
256 -m '$(cat gerrit_comment.txt)' \
257 $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 -m rm -r "gs://$gs_path"
278 name: upload-review-docs
280 - build-html-and-pdf-docs-output
281 - upload-under-review-docs-to-opnfv-artifacts
282 - report-docs-build-result-to-gerrit
285 name: upload-merged-docs
287 - build-html-and-pdf-docs-output
288 - upload-merged-docs-to-opnfv-artifacts
289 - report-docs-build-result-to-gerrit
290 - remove-old-docs-from-opnfv-artifacts