6 - lf_cmake_sonar: &lf_cmake_sonar
10 # Default parameters #
11 ######################
15 build-dir: "$WORKSPACE/target"
20 git-url: "$GIT_URL/$PROJECT"
21 github-url: "https://github.com"
22 install-prefix: "$BUILD_DIR/output"
25 sonar-scanner-version: 3.3.0.1492
26 sonarcloud-api-token: ""
27 sonarcloud-organization: ""
28 sonarcloud-project-key: ""
30 submodule-recursive: true
32 submodule-disable: false
38 project-type: freestyle
40 disabled: "{disable-job}"
43 - lf-infra-properties:
44 build-days-to-keep: "{build-days-to-keep}"
47 - lf-infra-parameters:
51 lftools-version: "{lftools-version}"
52 - lf-cmake-parameters:
53 build-dir: "{build-dir}"
54 cmake-opts: "{cmake-opts}"
55 install-prefix: "{install-prefix}"
56 make-opts: "{make-opts}"
60 build-timeout: "{build-timeout}"
61 jenkins-ssh-credential: "{jenkins-ssh-credential}"
65 - shell: "{pre-build}"
67 # Switch this to the sonar wrapper when JJB 2.0 is available
69 SONAR_HOST_URL=https://sonarcloud.io
70 SONAR_SCANNER_VERSION={sonar-scanner-version}
71 PROJECT_KEY={sonarcloud-project-key}
72 PROJECT_ORGANIZATION={sonarcloud-organization}
73 API_TOKEN={sonarcloud-api-token}
74 - shell: !include-raw-escape: ../shell/cmake-sonar.sh
75 - lf-provide-maven-settings-cleanup
81 name: "{project-name}-cmake-sonar"
82 id: gerrit-cmake-sonar
87 - lf-infra-gerrit-scm:
88 branch: "$GERRIT_BRANCH"
89 jenkins-ssh-credential: "{jenkins-ssh-credential}"
91 refspec: "$GERRIT_REFSPEC"
92 submodule-recursive: "{submodule-recursive}"
93 submodule-timeout: "{submodule-timeout}"
94 submodule-disable: "{submodule-disable}"
95 choosing-strategy: gerrit
100 server-name: "{gerrit-server-name}"
102 - comment-added-contains-event:
103 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
105 - project-compare-type: "ANT"
106 project-pattern: "{project}"
108 - branch-compare-type: "ANT"
109 branch-pattern: "**/{branch}"
112 name: "{project-name}-cmake-sonar"
113 id: github-cmake-sonar
118 - lf-infra-properties:
119 build-days-to-keep: "{build-days-to-keep}"
121 url: "{github-url}/{github-org}/{project}"
124 - lf-infra-github-scm:
125 url: "{git-clone-url}{github-org}/{project}"
126 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
128 submodule-recursive: "{submodule-recursive}"
129 submodule-timeout: "{submodule-timeout}"
130 submodule-disable: "{submodule-disable}"
131 choosing-strategy: default
132 jenkins-ssh-credential: "{jenkins-ssh-credential}"
135 - timed: "{obj:cron}"
141 - lf_cmake_stage: &lf_cmake_stage
144 ######################
145 # Default parameters #
146 ######################
149 build-days-to-keep: 7
150 build-dir: "$WORKSPACE/target"
155 git-url: "$GIT_URL/$PROJECT"
156 github-url: "https://github.com"
157 install-prefix: "$BUILD_DIR/output"
159 mvn-global-settings: global-settings
162 submodule-recursive: true
163 submodule-timeout: 10
164 submodule-disable: false
167 #####################
168 # Job Configuration #
169 #####################
171 project-type: freestyle
173 disabled: "{disable-job}"
176 - lf-infra-properties:
177 build-days-to-keep: "{build-days-to-keep}"
180 - lf-infra-parameters:
184 - lf-cmake-parameters:
185 build-dir: "{build-dir}"
186 cmake-opts: "{cmake-opts}"
187 install-prefix: "{install-prefix}"
188 make-opts: "{make-opts}"
191 default: "{nexus-group-id}"
192 description: "Project Group ID in Nexus to upload to."
194 name: STAGING_PROFILE_ID
195 default: "{staging-profile-id}"
196 description: "Nexus staging profile ID."
203 Project version to stage release as. There are 2 methods for
206 1) Defined explicitly here.
207 2) Leave this value blank and set /tmp/artifact_version
209 Use method 2 in conjunction with 'pre-build' configuration to
210 generate the artifact_version automatically from files in the
211 project's repository. For example with pre-build script:
214 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
215 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
216 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
217 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
218 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
219 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
220 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
224 build-timeout: "{build-timeout}"
225 jenkins-ssh-credential: "{jenkins-ssh-credential}"
229 - lf-provide-maven-settings:
230 global-settings-file: "{mvn-global-settings}"
231 settings-file: "{mvn-settings}"
232 - lf-infra-create-netrc:
234 - shell: "{pre-build}"
235 - shell: !include-raw-escape: ../shell/cmake-build.sh
236 - shell: !include-raw-escape: ../shell/cmake-stage.sh
237 - lf-provide-maven-settings-cleanup
243 name: "{project-name}-cmake-stage-{stream}"
244 id: gerrit-cmake-stage
249 - lf-infra-gerrit-scm:
250 branch: "$GERRIT_BRANCH"
251 jenkins-ssh-credential: "{jenkins-ssh-credential}"
253 refspec: "$GERRIT_REFSPEC"
254 submodule-recursive: "{submodule-recursive}"
255 submodule-timeout: "{submodule-timeout}"
256 submodule-disable: "{submodule-disable}"
257 choosing-strategy: gerrit
260 - timed: "{obj:cron}"
262 server-name: "{gerrit-server-name}"
264 - comment-added-contains-event:
265 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
267 - project-compare-type: "ANT"
268 project-pattern: "{project}"
270 - branch-compare-type: "ANT"
271 branch-pattern: "**/{branch}"
274 name: "{project-name}-cmake-stage-{stream}"
275 id: github-cmake-stage
280 - lf-infra-properties:
281 build-days-to-keep: "{build-days-to-keep}"
283 url: "{github-url}/{github-org}/{project}"
286 - lf-infra-github-scm:
287 url: "{git-clone-url}{github-org}/{project}"
288 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
290 submodule-recursive: "{submodule-recursive}"
291 submodule-timeout: "{submodule-timeout}"
292 submodule-disable: "{submodule-disable}"
293 choosing-strategy: default
294 jenkins-ssh-credential: "{jenkins-ssh-credential}"
297 - timed: "{obj:cron}"
298 - github-pull-request:
299 trigger-phrase: "^(stage-release)$"
300 only-trigger-phrase: true
301 status-context: "CMake Stage"
304 white-list-target-branches:
311 - lf_cmake_verify: &lf_cmake_verify
312 name: lf-cmake-verify
314 ######################
315 # Default parameters #
316 ######################
319 build-days-to-keep: 7
320 build-dir: "$WORKSPACE/target"
324 git-url: "$GIT_URL/$PROJECT"
325 github-url: "https://github.com"
326 install-prefix: "$BUILD_DIR/output"
330 submodule-recursive: true
331 submodule-timeout: 10
332 submodule-disable: false
334 gerrit_verify_triggers:
335 - patchset-created-event:
337 exclude-trivial-rebase: false
338 exclude-no-code-change: false
339 - draft-published-event
340 - comment-added-contains-event:
341 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
343 gerrit_trigger_file_paths:
344 - compare-type: REG_EXP
347 # github_included_regions MUST match gerrit_trigger_file_paths
348 github_included_regions:
351 #####################
352 # Job Configuration #
353 #####################
355 project-type: freestyle
357 disabled: "{disable-job}"
360 - lf-infra-properties:
361 build-days-to-keep: "{build-days-to-keep}"
364 - lf-infra-parameters:
368 - lf-cmake-parameters:
369 build-dir: "{build-dir}"
370 cmake-opts: "{cmake-opts}"
371 install-prefix: "{install-prefix}"
372 make-opts: "{make-opts}"
376 build-timeout: "{build-timeout}"
377 jenkins-ssh-credential: "{jenkins-ssh-credential}"
380 - shell: "{pre-build}"
381 - shell: !include-raw-escape: ../shell/cmake-build.sh
387 name: "{project-name}-cmake-verify-{stream}"
388 id: gerrit-cmake-verify
393 - lf-infra-gerrit-scm:
394 branch: "$GERRIT_BRANCH"
395 jenkins-ssh-credential: "{jenkins-ssh-credential}"
397 refspec: "$GERRIT_REFSPEC"
398 submodule-recursive: "{submodule-recursive}"
399 submodule-timeout: "{submodule-timeout}"
400 submodule-disable: "{submodule-disable}"
401 choosing-strategy: gerrit
405 server-name: "{gerrit-server-name}"
406 trigger-on: "{obj:gerrit_verify_triggers}"
408 - project-compare-type: "ANT"
409 project-pattern: "{project}"
411 - branch-compare-type: "ANT"
412 branch-pattern: "**/{branch}"
413 file-paths: "{obj:gerrit_trigger_file_paths}"
416 name: "{project-name}-cmake-verify-{stream}"
417 id: github-cmake-verify
422 - lf-infra-properties:
423 build-days-to-keep: "{build-days-to-keep}"
425 url: "{github-url}/{github-org}/{project}"
428 - lf-infra-github-scm:
429 url: "{git-clone-url}{github-org}/{project}"
430 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
432 submodule-recursive: "{submodule-recursive}"
433 submodule-timeout: "{submodule-timeout}"
434 submodule-disable: "{submodule-disable}"
435 choosing-strategy: default
436 jenkins-ssh-credential: "{jenkins-ssh-credential}"
439 - github-pull-request:
440 trigger-phrase: "^(recheck|reverify)$"
441 only-trigger-phrase: false
442 status-context: "CMake Verify"
445 included-regions: "{obj:github_included_regions}"
446 white-list-target-branches: