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
155 export PATH=$PATH:/usr/local/bin/
156 git clone ssh://gerrit.opnfv.org:29418/releng
157 GERRIT_COMMENT=gerrit_comment.txt ./releng/utils/docs-build.sh
160 name: upload-under-review-docs-to-opnfv-artifacts
165 export PATH=$PATH:/usr/local/bin/
167 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
171 echo "###########################"
172 echo "UPLOADING DOCS UNDER REVIEW"
173 echo "###########################"
176 gs_base="artifacts.opnfv.org/review"
177 gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
178 local_path="upload/$GERRIT_CHANGE_NUMBER"
181 mv output "$local_path"
182 gsutil -m cp -r "$local_path" "gs://$gs_base"
184 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
186 -h "Content-Type:text/html" \
187 -h "Cache-Control:private, max-age=0, no-transform" \
188 "gs://$gs_path"/**.html
191 echo "Document link(s):" >> gerrit_comment.txt
192 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
193 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
196 name: upload-merged-docs-to-opnfv-artifacts
201 export PATH=$PATH:/usr/local/bin/
206 echo "#####################"
207 echo "UPLOADING MERGED DOCS"
208 echo "#####################"
211 if [[ "$GERRIT_BRANCH" == "master" ]] ; then
212 gs_base="artifacts.opnfv.org/$GERRIT_PROJECT"
214 gs_base="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH"
216 gs_path="$gs_base/docs"
217 local_path="upload/docs"
220 mv output "$local_path"
221 gsutil -m cp -r "$local_path" "gs://$gs_base"
223 if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
225 -h "Content-Type:text/html" \
226 -h "Cache-Control:private, max-age=0, no-transform" \
227 "gs://$gs_path"/**.html
230 echo "Document link(s):" >> gerrit_comment.txt
231 find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
232 sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt
235 name: report-docs-build-result-to-gerrit
239 export PATH=$PATH:/usr/local/bin/
240 if [[ -e gerrit_comment.txt ]] ; then
242 echo "posting review comment to gerrit..."
244 cat gerrit_comment.txt
246 ssh -p 29418 gerrit.opnfv.org \
247 "gerrit review -p $GERRIT_PROJECT \
248 -m '$(cat gerrit_comment.txt)' \
249 $GERRIT_PATCHSET_REVISION"
253 name: remove-old-docs-from-opnfv-artifacts
257 export PATH=$PATH:/usr/local/bin/
259 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
261 gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
263 if gsutil ls "gs://$gs_path" > /dev/null 2>&1 ; then
265 echo "Deleting Out-of-dated Documents..."
266 gsutil -m rm -r "gs://$gs_path"
270 name: upload-review-docs
272 - build-html-and-pdf-docs-output
273 - upload-under-review-docs-to-opnfv-artifacts
274 - report-docs-build-result-to-gerrit
277 name: upload-merged-docs
279 - build-html-and-pdf-docs-output
280 - upload-merged-docs-to-opnfv-artifacts
281 - report-docs-build-result-to-gerrit
282 - remove-old-docs-from-opnfv-artifacts