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"
163 submodule-recursive: true
164 submodule-timeout: 10
165 submodule-disable: false
168 sonar-additional-args: ""
170 sonar-prescan-script: ""
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: "{sonar-prescan-script}"
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
232 - lf-infra-gerrit-scm:
233 branch: "$GERRIT_BRANCH"
234 jenkins-ssh-credential: "{jenkins-ssh-credential}"
236 refspec: "$GERRIT_REFSPEC"
237 submodule-recursive: "{submodule-recursive}"
238 submodule-timeout: "{submodule-timeout}"
239 submodule-disable: "{submodule-disable}"
240 choosing-strategy: default
243 - timed: "{obj:cron}"
245 server-name: "{gerrit-server-name}"
247 - comment-added-contains-event:
248 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
250 - project-compare-type: "ANT"
251 project-pattern: "{project}"
253 - branch-compare-type: "ANT"
254 branch-pattern: "**/{branch}"
257 name: "{project-name}-cmake-sonarqube"
258 id: github-cmake-sonarqube
260 <<: *lf_cmake_sonarqube
263 - lf-infra-github-scm:
265 jenkins-ssh-credential: "{jenkins-ssh-credential}"
266 url: "{git-clone-url}{github-org}/{project}"
267 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
268 submodule-recursive: "{submodule-recursive}"
269 submodule-timeout: "{submodule-timeout}"
270 submodule-disable: "{submodule-disable}"
271 choosing-strategy: default
274 - github-pull-request:
275 trigger-phrase: "^run-sonar$"
276 only-trigger-phrase: false
277 status-context: "CMake Sonarqube"
280 white-list-target-branches:
287 - lf_cmake_stage: &lf_cmake_stage
290 ######################
291 # Default parameters #
292 ######################
295 build-days-to-keep: 7
296 build-dir: "$WORKSPACE/target"
301 git-url: "$GIT_URL/$PROJECT"
302 github-url: "https://github.com"
303 install-prefix: "$BUILD_DIR/output"
305 mvn-global-settings: global-settings
308 submodule-recursive: true
309 submodule-timeout: 10
310 submodule-disable: false
313 #####################
314 # Job Configuration #
315 #####################
317 project-type: freestyle
319 disabled: "{disable-job}"
322 - lf-infra-properties:
323 build-days-to-keep: "{build-days-to-keep}"
326 - lf-infra-parameters:
330 - lf-cmake-parameters:
331 build-dir: "{build-dir}"
332 cmake-opts: "{cmake-opts}"
333 install-prefix: "{install-prefix}"
334 make-opts: "{make-opts}"
337 default: "{nexus-group-id}"
338 description: "Project Group ID in Nexus to upload to."
340 name: STAGING_PROFILE_ID
341 default: "{staging-profile-id}"
342 description: "Nexus staging profile ID."
349 Project version to stage release as. There are 2 methods for
352 1) Defined explicitly here.
353 2) Leave this value blank and set /tmp/artifact_version
355 Use method 2 in conjunction with 'pre-build' configuration to
356 generate the artifact_version automatically from files in the
357 project's repository. For example with pre-build script:
360 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
361 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
362 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
363 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
364 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
365 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
366 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
370 build-timeout: "{build-timeout}"
371 jenkins-ssh-credential: "{jenkins-ssh-credential}"
375 - lf-provide-maven-settings:
376 global-settings-file: "{mvn-global-settings}"
377 settings-file: "{mvn-settings}"
378 - lf-infra-create-netrc:
380 - shell: "{pre-build}"
381 - shell: !include-raw-escape: ../shell/cmake-build.sh
382 - shell: !include-raw-escape: ../shell/cmake-stage.sh
383 - lf-provide-maven-settings-cleanup
389 name: "{project-name}-cmake-stage-{stream}"
390 id: gerrit-cmake-stage
395 - lf-infra-gerrit-scm:
396 branch: "$GERRIT_BRANCH"
397 jenkins-ssh-credential: "{jenkins-ssh-credential}"
399 refspec: "$GERRIT_REFSPEC"
400 submodule-recursive: "{submodule-recursive}"
401 submodule-timeout: "{submodule-timeout}"
402 submodule-disable: "{submodule-disable}"
403 choosing-strategy: gerrit
406 - timed: "{obj:cron}"
408 server-name: "{gerrit-server-name}"
410 - comment-added-contains-event:
411 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
413 - project-compare-type: "ANT"
414 project-pattern: "{project}"
416 - branch-compare-type: "ANT"
417 branch-pattern: "**/{branch}"
420 name: "{project-name}-cmake-stage-{stream}"
421 id: github-cmake-stage
426 - lf-infra-properties:
427 build-days-to-keep: "{build-days-to-keep}"
429 url: "{github-url}/{github-org}/{project}"
432 - lf-infra-github-scm:
433 url: "{git-clone-url}{github-org}/{project}"
434 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
436 submodule-recursive: "{submodule-recursive}"
437 submodule-timeout: "{submodule-timeout}"
438 submodule-disable: "{submodule-disable}"
439 choosing-strategy: default
440 jenkins-ssh-credential: "{jenkins-ssh-credential}"
443 - timed: "{obj:cron}"
444 - github-pull-request:
445 trigger-phrase: "^(stage-release)$"
446 only-trigger-phrase: true
447 status-context: "CMake Stage"
450 white-list-target-branches:
457 - lf_cmake_verify: &lf_cmake_verify
458 name: lf-cmake-verify
460 ######################
461 # Default parameters #
462 ######################
465 build-days-to-keep: 7
466 build-dir: "$WORKSPACE/target"
470 git-url: "$GIT_URL/$PROJECT"
471 github-url: "https://github.com"
472 install-prefix: "$BUILD_DIR/output"
476 submodule-recursive: true
477 submodule-timeout: 10
478 submodule-disable: false
480 gerrit_verify_triggers:
481 - patchset-created-event:
483 exclude-trivial-rebase: false
484 exclude-no-code-change: false
485 - draft-published-event
486 - comment-added-contains-event:
487 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
489 gerrit_trigger_file_paths:
490 - compare-type: REG_EXP
493 # github_included_regions MUST match gerrit_trigger_file_paths
494 github_included_regions:
497 #####################
498 # Job Configuration #
499 #####################
501 project-type: freestyle
503 disabled: "{disable-job}"
506 - lf-infra-properties:
507 build-days-to-keep: "{build-days-to-keep}"
510 - lf-infra-parameters:
514 - lf-cmake-parameters:
515 build-dir: "{build-dir}"
516 cmake-opts: "{cmake-opts}"
517 install-prefix: "{install-prefix}"
518 make-opts: "{make-opts}"
522 build-timeout: "{build-timeout}"
523 jenkins-ssh-credential: "{jenkins-ssh-credential}"
526 - shell: "{pre-build}"
527 - shell: !include-raw-escape: ../shell/cmake-build.sh
533 name: "{project-name}-cmake-verify-{stream}"
534 id: gerrit-cmake-verify
539 - lf-infra-gerrit-scm:
540 branch: "$GERRIT_BRANCH"
541 jenkins-ssh-credential: "{jenkins-ssh-credential}"
543 refspec: "$GERRIT_REFSPEC"
544 submodule-recursive: "{submodule-recursive}"
545 submodule-timeout: "{submodule-timeout}"
546 submodule-disable: "{submodule-disable}"
547 choosing-strategy: gerrit
551 server-name: "{gerrit-server-name}"
552 trigger-on: "{obj:gerrit_verify_triggers}"
554 - project-compare-type: "ANT"
555 project-pattern: "{project}"
557 - branch-compare-type: "ANT"
558 branch-pattern: "**/{branch}"
559 file-paths: "{obj:gerrit_trigger_file_paths}"
562 name: "{project-name}-cmake-verify-{stream}"
563 id: github-cmake-verify
568 - lf-infra-properties:
569 build-days-to-keep: "{build-days-to-keep}"
571 url: "{github-url}/{github-org}/{project}"
574 - lf-infra-github-scm:
575 url: "{git-clone-url}{github-org}/{project}"
576 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
578 submodule-recursive: "{submodule-recursive}"
579 submodule-timeout: "{submodule-timeout}"
580 submodule-disable: "{submodule-disable}"
581 choosing-strategy: default
582 jenkins-ssh-credential: "{jenkins-ssh-credential}"
585 - github-pull-request:
586 trigger-phrase: "^(recheck|reverify)$"
587 only-trigger-phrase: false
588 status-context: "CMake Verify"
591 included-regions: "{obj:github_included_regions}"
592 white-list-target-branches: