6 - lf_cmake_common: &lf_cmake_common
13 project-type: freestyle
15 disabled: "{disable-job}"
18 - lf-infra-properties:
19 build-days-to-keep: "{build-days-to-keep}"
22 - lf-infra-parameters:
26 - lf-cmake-parameters:
27 build-dir: "{build-dir}"
28 cmake-opts: "{cmake-opts}"
29 install-prefix: "{install-prefix}"
30 make-opts: "{make-opts}"
34 build-timeout: "{build-timeout}"
35 jenkins-ssh-credential: "{jenkins-ssh-credential}"
44 - lf_cmake_sonar: &lf_cmake_sonar
47 ######################
48 # Default parameters #
49 ######################
53 build-dir: "$WORKSPACE/target"
58 git-url: "$GIT_URL/$PROJECT"
59 github-url: "https://github.com"
60 install-prefix: "$BUILD_DIR/output"
63 sonar-scanner-version: 3.3.0.1492
64 sonarcloud-api-token: ""
65 sonarcloud-organization: ""
66 sonarcloud-project-key: ""
68 submodule-recursive: true
70 submodule-disable: false
74 - shell: "{pre-build}"
76 # Switch this to the sonar wrapper when JJB 2.0 is available
78 SONAR_HOST_URL=https://sonarcloud.io
79 SONAR_SCANNER_VERSION={sonar-scanner-version}
80 PROJECT_KEY={sonarcloud-project-key}
81 PROJECT_ORGANIZATION={sonarcloud-organization}
82 API_TOKEN={sonarcloud-api-token}
83 - shell: !include-raw-escape: ../shell/cmake-sonar.sh
84 - lf-provide-maven-settings-cleanup
87 name: "{project-name}-cmake-sonar"
88 id: gerrit-cmake-sonar
94 - lf-infra-gerrit-scm:
95 branch: "$GERRIT_BRANCH"
96 jenkins-ssh-credential: "{jenkins-ssh-credential}"
98 refspec: "$GERRIT_REFSPEC"
99 submodule-recursive: "{submodule-recursive}"
100 submodule-timeout: "{submodule-timeout}"
101 submodule-disable: "{submodule-disable}"
102 choosing-strategy: gerrit
105 - timed: "{obj:cron}"
107 server-name: "{gerrit-server-name}"
109 - comment-added-contains-event:
110 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
112 - project-compare-type: "ANT"
113 project-pattern: "{project}"
115 - branch-compare-type: "ANT"
116 branch-pattern: "**/{branch}"
119 name: "{project-name}-cmake-sonar"
120 id: github-cmake-sonar
126 - lf-infra-properties:
127 build-days-to-keep: "{build-days-to-keep}"
129 url: "{github-url}/{github-org}/{project}"
132 - lf-infra-github-scm:
133 url: "{git-clone-url}{github-org}/{project}"
134 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
136 submodule-recursive: "{submodule-recursive}"
137 submodule-timeout: "{submodule-timeout}"
138 submodule-disable: "{submodule-disable}"
139 choosing-strategy: default
140 jenkins-ssh-credential: "{jenkins-ssh-credential}"
143 - timed: "{obj:cron}"
149 - lf_cmake_sonarqube: &lf_cmake_sonarqube
150 name: lf-cmake-sonarqube
152 ######################
153 # Default parameters #
154 ######################
158 branch: master # Sonar should always be run on master branch
159 build-days-to-keep: 7
160 build-dir: "$WORKSPACE/build"
162 build-wrap-dir: "$WORKSPACE/bw-output"
166 git-url: "$GIT_URL/$PROJECT"
167 github-url: "https://github.com"
168 install-prefix: "$BUILD_DIR/output"
172 submodule-recursive: true
173 submodule-timeout: 10
174 submodule-disable: false
177 sonar-additional-args: ""
179 sonar-project-file: "sonar-project.properties"
184 - lf-infra-parameters:
188 - lf-cmake-parameters:
189 build-dir: "{build-dir}"
190 cmake-opts: "{cmake-opts}"
191 install-prefix: "{install-prefix}"
192 make-opts: "{make-opts}"
194 name: ARCHIVE_ARTIFACTS
195 default: "{archive-artifacts}"
196 description: Artifacts to archive to the logs server.
199 default: "{build-wrap-dir}"
200 description: SonarQube build wrapper output directory.
204 - shell: "{pre-build}"
205 - shell: !include-raw-escape: ../shell/cmake-sonarqube.sh
207 sonar-task: "{sonar-task}"
208 sonar-project-file: "{sonar-project-file}"
209 sonar-properties: "{sonar-properties}"
210 sonar-java-opts: "{sonar-java-opts}"
211 sonar-additional-args: "{sonar-additional-args}"
214 name: "{project-name}-cmake-sonarqube"
215 id: gerrit-cmake-sonarqube
218 <<: *lf_cmake_sonarqube
220 gerrit_sonar_triggers:
221 - comment-added-contains-event:
222 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
225 - lf-infra-gerrit-scm:
226 branch: "$GERRIT_BRANCH"
227 jenkins-ssh-credential: "{jenkins-ssh-credential}"
229 refspec: "$GERRIT_REFSPEC"
230 submodule-recursive: "{submodule-recursive}"
231 submodule-timeout: "{submodule-timeout}"
232 submodule-disable: "{submodule-disable}"
233 choosing-strategy: default
236 - timed: "{obj:cron}"
238 server-name: "{gerrit-server-name}"
239 trigger-on: "{obj:gerrit_sonar_triggers}"
241 - project-compare-type: "ANT"
242 project-pattern: "{project}"
244 - branch-compare-type: "ANT"
245 branch-pattern: "**/{branch}"
248 name: "{project-name}-cmake-sonarqube"
249 id: github-cmake-sonarqube
252 <<: *lf_cmake_sonarqube
255 - lf-infra-github-scm:
257 jenkins-ssh-credential: "{jenkins-ssh-credential}"
258 url: "{git-clone-url}{github-org}/{project}"
259 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
260 submodule-recursive: "{submodule-recursive}"
261 submodule-timeout: "{submodule-timeout}"
262 submodule-disable: "{submodule-disable}"
263 choosing-strategy: default
266 - github-pull-request:
267 trigger-phrase: "^run-sonar$"
268 only-trigger-phrase: false
269 status-context: "CMake Sonarqube"
272 white-list-target-branches:
279 - lf_cmake_stage: &lf_cmake_stage
282 ######################
283 # Default parameters #
284 ######################
287 build-days-to-keep: 7
288 build-dir: "$WORKSPACE/target"
293 git-url: "$GIT_URL/$PROJECT"
294 github-url: "https://github.com"
295 install-prefix: "$BUILD_DIR/output"
297 mvn-global-settings: global-settings
300 submodule-recursive: true
301 submodule-timeout: 10
302 submodule-disable: false
306 - lf-infra-parameters:
310 - lf-cmake-parameters:
311 build-dir: "{build-dir}"
312 cmake-opts: "{cmake-opts}"
313 install-prefix: "{install-prefix}"
314 make-opts: "{make-opts}"
317 default: "{nexus-group-id}"
318 description: "Project Group ID in Nexus to upload to."
320 name: STAGING_PROFILE_ID
321 default: "{staging-profile-id}"
322 description: "Nexus staging profile ID."
329 Project version to stage release as. There are 2 methods for
332 1) Defined explicitly here.
333 2) Leave this value blank and set /tmp/artifact_version
335 Use method 2 in conjunction with 'pre-build' configuration to
336 generate the artifact_version automatically from files in the
337 project's repository. For example with pre-build script:
340 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
341 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
342 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
343 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
344 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
345 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
346 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
350 - lf-provide-maven-settings:
351 global-settings-file: "{mvn-global-settings}"
352 settings-file: "{mvn-settings}"
353 - lf-infra-create-netrc:
355 - shell: "{pre-build}"
356 - shell: !include-raw-escape: ../shell/cmake-build.sh
357 - shell: !include-raw-escape: ../shell/cmake-stage.sh
358 - lf-provide-maven-settings-cleanup
361 name: "{project-name}-cmake-stage-{stream}"
362 id: gerrit-cmake-stage
368 - lf-infra-gerrit-scm:
369 branch: "$GERRIT_BRANCH"
370 jenkins-ssh-credential: "{jenkins-ssh-credential}"
372 refspec: "$GERRIT_REFSPEC"
373 submodule-recursive: "{submodule-recursive}"
374 submodule-timeout: "{submodule-timeout}"
375 submodule-disable: "{submodule-disable}"
376 choosing-strategy: gerrit
379 - timed: "{obj:cron}"
381 server-name: "{gerrit-server-name}"
383 - comment-added-contains-event:
384 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
386 - project-compare-type: "ANT"
387 project-pattern: "{project}"
389 - branch-compare-type: "ANT"
390 branch-pattern: "**/{branch}"
393 name: "{project-name}-cmake-stage-{stream}"
394 id: github-cmake-stage
400 - lf-infra-properties:
401 build-days-to-keep: "{build-days-to-keep}"
403 url: "{github-url}/{github-org}/{project}"
406 - lf-infra-github-scm:
407 url: "{git-clone-url}{github-org}/{project}"
408 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
410 submodule-recursive: "{submodule-recursive}"
411 submodule-timeout: "{submodule-timeout}"
412 submodule-disable: "{submodule-disable}"
413 choosing-strategy: default
414 jenkins-ssh-credential: "{jenkins-ssh-credential}"
417 - timed: "{obj:cron}"
418 - github-pull-request:
419 trigger-phrase: "^(stage-release)$"
420 only-trigger-phrase: true
421 status-context: "CMake Stage"
424 white-list-target-branches:
431 - lf_cmake_verify: &lf_cmake_verify
432 name: lf-cmake-verify
434 ######################
435 # Default parameters #
436 ######################
439 build-days-to-keep: 7
440 build-dir: "$WORKSPACE/target"
444 git-url: "$GIT_URL/$PROJECT"
445 github-url: "https://github.com"
446 install-prefix: "$BUILD_DIR/output"
450 submodule-recursive: true
451 submodule-timeout: 10
452 submodule-disable: false
454 gerrit_verify_triggers:
455 - patchset-created-event:
457 exclude-trivial-rebase: false
458 exclude-no-code-change: false
459 - draft-published-event
460 - comment-added-contains-event:
461 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
463 gerrit_trigger_file_paths:
464 - compare-type: REG_EXP
467 # github_included_regions MUST match gerrit_trigger_file_paths
468 github_included_regions:
472 - shell: "{pre-build}"
473 - shell: !include-raw-escape: ../shell/cmake-build.sh
476 name: "{project-name}-cmake-verify-{stream}"
477 id: gerrit-cmake-verify
483 - lf-infra-gerrit-scm:
484 branch: "$GERRIT_BRANCH"
485 jenkins-ssh-credential: "{jenkins-ssh-credential}"
487 refspec: "$GERRIT_REFSPEC"
488 submodule-recursive: "{submodule-recursive}"
489 submodule-timeout: "{submodule-timeout}"
490 submodule-disable: "{submodule-disable}"
491 choosing-strategy: gerrit
495 server-name: "{gerrit-server-name}"
496 trigger-on: "{obj:gerrit_verify_triggers}"
498 - project-compare-type: "ANT"
499 project-pattern: "{project}"
501 - branch-compare-type: "ANT"
502 branch-pattern: "**/{branch}"
503 file-paths: "{obj:gerrit_trigger_file_paths}"
506 name: "{project-name}-cmake-verify-{stream}"
507 id: github-cmake-verify
513 - lf-infra-properties:
514 build-days-to-keep: "{build-days-to-keep}"
516 url: "{github-url}/{github-org}/{project}"
519 - lf-infra-github-scm:
520 url: "{git-clone-url}{github-org}/{project}"
521 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
523 submodule-recursive: "{submodule-recursive}"
524 submodule-timeout: "{submodule-timeout}"
525 submodule-disable: "{submodule-disable}"
526 choosing-strategy: default
527 jenkins-ssh-credential: "{jenkins-ssh-credential}"
530 - github-pull-request:
531 trigger-phrase: "^(recheck|reverify)$"
532 only-trigger-phrase: false
533 status-context: "CMake Verify"
536 included-regions: "{obj:github_included_regions}"
537 white-list-target-branches: