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_sonarqube: &lf_cmake_sonarqube
142 name: lf-cmake-sonarqube
144 ######################
145 # Default parameters #
146 ######################
150 branch: master # Sonar should always be run on master branch
151 build-days-to-keep: 7
152 build-dir: "$WORKSPACE/build"
154 build-wrap-dir: "$WORKSPACE/bw-output"
158 git-url: "$GIT_URL/$PROJECT"
159 github-url: "https://github.com"
160 install-prefix: "$BUILD_DIR/output"
164 submodule-recursive: true
165 submodule-timeout: 10
166 submodule-disable: false
169 sonar-additional-args: ""
171 sonar-project-file: "sonar-project.properties"
175 #####################
176 # Job Configuration #
177 #####################
179 project-type: freestyle
181 disabled: "{disable-job}"
184 - lf-infra-properties:
185 build-days-to-keep: "{build-days-to-keep}"
189 build-timeout: "{build-timeout}"
190 jenkins-ssh-credential: "{jenkins-ssh-credential}"
193 - lf-infra-parameters:
197 - lf-cmake-parameters:
198 build-dir: "{build-dir}"
199 cmake-opts: "{cmake-opts}"
200 install-prefix: "{install-prefix}"
201 make-opts: "{make-opts}"
203 name: ARCHIVE_ARTIFACTS
204 default: "{archive-artifacts}"
205 description: Artifacts to archive to the logs server.
208 default: "{build-wrap-dir}"
209 description: SonarQube build wrapper output directory.
213 - shell: "{pre-build}"
214 - shell: !include-raw-escape: ../shell/cmake-sonarqube.sh
216 sonar-task: "{sonar-task}"
217 sonar-project-file: "{sonar-project-file}"
218 sonar-properties: "{sonar-properties}"
219 sonar-java-opts: "{sonar-java-opts}"
220 sonar-additional-args: "{sonar-additional-args}"
226 name: "{project-name}-cmake-sonarqube"
227 id: gerrit-cmake-sonarqube
229 <<: *lf_cmake_sonarqube
231 ######################
232 # Default parameters #
233 ######################
235 gerrit_sonar_triggers:
236 - comment-added-contains-event:
237 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
240 - lf-infra-gerrit-scm:
241 branch: "$GERRIT_BRANCH"
242 jenkins-ssh-credential: "{jenkins-ssh-credential}"
244 refspec: "$GERRIT_REFSPEC"
245 submodule-recursive: "{submodule-recursive}"
246 submodule-timeout: "{submodule-timeout}"
247 submodule-disable: "{submodule-disable}"
248 choosing-strategy: default
251 - timed: "{obj:cron}"
253 server-name: "{gerrit-server-name}"
254 trigger-on: "{obj:gerrit_sonar_triggers}"
256 - project-compare-type: "ANT"
257 project-pattern: "{project}"
259 - branch-compare-type: "ANT"
260 branch-pattern: "**/{branch}"
263 name: "{project-name}-cmake-sonarqube"
264 id: github-cmake-sonarqube
266 <<: *lf_cmake_sonarqube
269 - lf-infra-github-scm:
271 jenkins-ssh-credential: "{jenkins-ssh-credential}"
272 url: "{git-clone-url}{github-org}/{project}"
273 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
274 submodule-recursive: "{submodule-recursive}"
275 submodule-timeout: "{submodule-timeout}"
276 submodule-disable: "{submodule-disable}"
277 choosing-strategy: default
280 - github-pull-request:
281 trigger-phrase: "^run-sonar$"
282 only-trigger-phrase: false
283 status-context: "CMake Sonarqube"
286 white-list-target-branches:
293 - lf_cmake_stage: &lf_cmake_stage
296 ######################
297 # Default parameters #
298 ######################
301 build-days-to-keep: 7
302 build-dir: "$WORKSPACE/target"
307 git-url: "$GIT_URL/$PROJECT"
308 github-url: "https://github.com"
309 install-prefix: "$BUILD_DIR/output"
311 mvn-global-settings: global-settings
314 submodule-recursive: true
315 submodule-timeout: 10
316 submodule-disable: false
319 #####################
320 # Job Configuration #
321 #####################
323 project-type: freestyle
325 disabled: "{disable-job}"
328 - lf-infra-properties:
329 build-days-to-keep: "{build-days-to-keep}"
332 - lf-infra-parameters:
336 - lf-cmake-parameters:
337 build-dir: "{build-dir}"
338 cmake-opts: "{cmake-opts}"
339 install-prefix: "{install-prefix}"
340 make-opts: "{make-opts}"
343 default: "{nexus-group-id}"
344 description: "Project Group ID in Nexus to upload to."
346 name: STAGING_PROFILE_ID
347 default: "{staging-profile-id}"
348 description: "Nexus staging profile ID."
355 Project version to stage release as. There are 2 methods for
358 1) Defined explicitly here.
359 2) Leave this value blank and set /tmp/artifact_version
361 Use method 2 in conjunction with 'pre-build' configuration to
362 generate the artifact_version automatically from files in the
363 project's repository. For example with pre-build script:
366 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
367 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
368 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
369 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
370 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
371 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
372 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
376 build-timeout: "{build-timeout}"
377 jenkins-ssh-credential: "{jenkins-ssh-credential}"
381 - lf-provide-maven-settings:
382 global-settings-file: "{mvn-global-settings}"
383 settings-file: "{mvn-settings}"
384 - lf-infra-create-netrc:
386 - shell: "{pre-build}"
387 - shell: !include-raw-escape: ../shell/cmake-build.sh
388 - shell: !include-raw-escape: ../shell/cmake-stage.sh
389 - lf-provide-maven-settings-cleanup
395 name: "{project-name}-cmake-stage-{stream}"
396 id: gerrit-cmake-stage
401 - lf-infra-gerrit-scm:
402 branch: "$GERRIT_BRANCH"
403 jenkins-ssh-credential: "{jenkins-ssh-credential}"
405 refspec: "$GERRIT_REFSPEC"
406 submodule-recursive: "{submodule-recursive}"
407 submodule-timeout: "{submodule-timeout}"
408 submodule-disable: "{submodule-disable}"
409 choosing-strategy: gerrit
412 - timed: "{obj:cron}"
414 server-name: "{gerrit-server-name}"
416 - comment-added-contains-event:
417 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
419 - project-compare-type: "ANT"
420 project-pattern: "{project}"
422 - branch-compare-type: "ANT"
423 branch-pattern: "**/{branch}"
426 name: "{project-name}-cmake-stage-{stream}"
427 id: github-cmake-stage
432 - lf-infra-properties:
433 build-days-to-keep: "{build-days-to-keep}"
435 url: "{github-url}/{github-org}/{project}"
438 - lf-infra-github-scm:
439 url: "{git-clone-url}{github-org}/{project}"
440 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
442 submodule-recursive: "{submodule-recursive}"
443 submodule-timeout: "{submodule-timeout}"
444 submodule-disable: "{submodule-disable}"
445 choosing-strategy: default
446 jenkins-ssh-credential: "{jenkins-ssh-credential}"
449 - timed: "{obj:cron}"
450 - github-pull-request:
451 trigger-phrase: "^(stage-release)$"
452 only-trigger-phrase: true
453 status-context: "CMake Stage"
456 white-list-target-branches:
463 - lf_cmake_verify: &lf_cmake_verify
464 name: lf-cmake-verify
466 ######################
467 # Default parameters #
468 ######################
471 build-days-to-keep: 7
472 build-dir: "$WORKSPACE/target"
476 git-url: "$GIT_URL/$PROJECT"
477 github-url: "https://github.com"
478 install-prefix: "$BUILD_DIR/output"
482 submodule-recursive: true
483 submodule-timeout: 10
484 submodule-disable: false
486 gerrit_verify_triggers:
487 - patchset-created-event:
489 exclude-trivial-rebase: false
490 exclude-no-code-change: false
491 - draft-published-event
492 - comment-added-contains-event:
493 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
495 gerrit_trigger_file_paths:
496 - compare-type: REG_EXP
499 # github_included_regions MUST match gerrit_trigger_file_paths
500 github_included_regions:
503 #####################
504 # Job Configuration #
505 #####################
507 project-type: freestyle
509 disabled: "{disable-job}"
512 - lf-infra-properties:
513 build-days-to-keep: "{build-days-to-keep}"
516 - lf-infra-parameters:
520 - lf-cmake-parameters:
521 build-dir: "{build-dir}"
522 cmake-opts: "{cmake-opts}"
523 install-prefix: "{install-prefix}"
524 make-opts: "{make-opts}"
528 build-timeout: "{build-timeout}"
529 jenkins-ssh-credential: "{jenkins-ssh-credential}"
532 - shell: "{pre-build}"
533 - shell: !include-raw-escape: ../shell/cmake-build.sh
539 name: "{project-name}-cmake-verify-{stream}"
540 id: gerrit-cmake-verify
545 - lf-infra-gerrit-scm:
546 branch: "$GERRIT_BRANCH"
547 jenkins-ssh-credential: "{jenkins-ssh-credential}"
549 refspec: "$GERRIT_REFSPEC"
550 submodule-recursive: "{submodule-recursive}"
551 submodule-timeout: "{submodule-timeout}"
552 submodule-disable: "{submodule-disable}"
553 choosing-strategy: gerrit
557 server-name: "{gerrit-server-name}"
558 trigger-on: "{obj:gerrit_verify_triggers}"
560 - project-compare-type: "ANT"
561 project-pattern: "{project}"
563 - branch-compare-type: "ANT"
564 branch-pattern: "**/{branch}"
565 file-paths: "{obj:gerrit_trigger_file_paths}"
568 name: "{project-name}-cmake-verify-{stream}"
569 id: github-cmake-verify
574 - lf-infra-properties:
575 build-days-to-keep: "{build-days-to-keep}"
577 url: "{github-url}/{github-org}/{project}"
580 - lf-infra-github-scm:
581 url: "{git-clone-url}{github-org}/{project}"
582 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
584 submodule-recursive: "{submodule-recursive}"
585 submodule-timeout: "{submodule-timeout}"
586 submodule-disable: "{submodule-disable}"
587 choosing-strategy: default
588 jenkins-ssh-credential: "{jenkins-ssh-credential}"
591 - github-pull-request:
592 trigger-phrase: "^(recheck|reverify)$"
593 only-trigger-phrase: false
594 status-context: "CMake Verify"
597 included-regions: "{obj:github_included_regions}"
598 white-list-target-branches: