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"
296 install-prefix: "$BUILD_DIR/output"
298 mvn-global-settings: global-settings
301 submodule-recursive: true
302 submodule-timeout: 10
303 submodule-disable: false
307 - lf-infra-parameters:
311 - lf-cmake-parameters:
312 build-dir: "{build-dir}"
313 cmake-opts: "{cmake-opts}"
314 install-prefix: "{install-prefix}"
315 make-opts: "{make-opts}"
319 description: "Install build products to /usr/local (true/false)."
322 default: "{nexus-group-id}"
323 description: "Project Group ID in Nexus to upload to."
325 name: STAGING_PROFILE_ID
326 default: "{staging-profile-id}"
327 description: "Nexus staging profile ID."
334 Project version to stage release as. There are 2 methods for
337 1) Defined explicitly here.
338 2) Leave this value blank and set /tmp/artifact_version
340 Use method 2 in conjunction with 'pre-build' configuration to
341 generate the artifact_version automatically from files in the
342 project's repository. For example with pre-build script:
345 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
346 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
347 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
348 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
349 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
350 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
351 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
355 - lf-provide-maven-settings:
356 global-settings-file: "{mvn-global-settings}"
357 settings-file: "{mvn-settings}"
358 - lf-infra-create-netrc:
360 - shell: "{pre-build}"
361 - shell: !include-raw-escape: ../shell/cmake-build.sh
362 - shell: !include-raw-escape: ../shell/cmake-stage.sh
363 - lf-provide-maven-settings-cleanup
366 name: "{project-name}-cmake-stage-{stream}"
367 id: gerrit-cmake-stage
373 - lf-infra-gerrit-scm:
374 branch: "$GERRIT_BRANCH"
375 jenkins-ssh-credential: "{jenkins-ssh-credential}"
377 refspec: "$GERRIT_REFSPEC"
378 submodule-recursive: "{submodule-recursive}"
379 submodule-timeout: "{submodule-timeout}"
380 submodule-disable: "{submodule-disable}"
381 choosing-strategy: gerrit
384 - timed: "{obj:cron}"
386 server-name: "{gerrit-server-name}"
388 - comment-added-contains-event:
389 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
391 - project-compare-type: "ANT"
392 project-pattern: "{project}"
394 - branch-compare-type: "ANT"
395 branch-pattern: "**/{branch}"
398 name: "{project-name}-cmake-stage-{stream}"
399 id: github-cmake-stage
405 - lf-infra-properties:
406 build-days-to-keep: "{build-days-to-keep}"
408 url: "{github-url}/{github-org}/{project}"
411 - lf-infra-github-scm:
412 url: "{git-clone-url}{github-org}/{project}"
413 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
415 submodule-recursive: "{submodule-recursive}"
416 submodule-timeout: "{submodule-timeout}"
417 submodule-disable: "{submodule-disable}"
418 choosing-strategy: default
419 jenkins-ssh-credential: "{jenkins-ssh-credential}"
422 - timed: "{obj:cron}"
423 - github-pull-request:
424 trigger-phrase: "^(stage-release)$"
425 only-trigger-phrase: true
426 status-context: "CMake Stage"
429 white-list-target-branches:
436 - lf_cmake_pc_stage: &lf_cmake_pc_stage
437 name: lf-cmake-packagecloud-stage
439 ######################
440 # Default parameters #
441 ######################
444 build-days-to-keep: 7
445 build-dir: "$WORKSPACE/build"
449 git-url: "$GIT_URL/$PROJECT"
450 github-url: "https://github.com"
452 install-prefix: "$BUILD_DIR/output"
456 submodule-recursive: true
457 submodule-timeout: 10
458 submodule-disable: false
460 gerrit_trigger_file_paths:
461 - compare-type: REG_EXP
464 # github_included_regions MUST match gerrit_trigger_file_paths
465 github_included_regions:
469 - lf-infra-parameters:
473 - lf-cmake-parameters:
474 build-dir: "{build-dir}"
475 cmake-opts: "{cmake-opts}"
476 install-prefix: "{install-prefix}"
477 make-opts: "{make-opts}"
481 description: "Install build products to /usr/local (true/false)."
484 - config-file-provider:
486 - file-id: ".packagecloud"
487 target: "$HOME/.packagecloud"
488 - shell: "{pre-build}"
489 - shell: !include-raw-escape: ../shell/cmake-build.sh
490 - lf-packagecloud-push:
491 build-dir: "{build-dir}"
492 packagecloud-account: "{packagecloud-account}"
493 packagecloud-repo: "{packagecloud-repo}"
494 debian-distribution-versions: "{debian-distribution-versions}"
495 rpm-distribution-versions: "{rpm-distribution-versions}"
498 # build with cmake and publish to PackageCloud on command
499 name: "{project-name}-cmake-packagecloud-stage-{stream}"
500 id: gerrit-cmake-packagecloud-stage
502 <<: *lf_cmake_pc_stage
504 ######################
505 # Default parameters #
506 ######################
508 gerrit_stage_triggers:
509 - comment-added-contains-event:
510 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
512 #####################
513 # Job Configuration #
514 #####################
517 - lf-infra-gerrit-scm:
518 jenkins-ssh-credential: "{jenkins-ssh-credential}"
520 refspec: "$GERRIT_REFSPEC"
521 branch: "$GERRIT_BRANCH"
522 submodule-recursive: "{submodule-recursive}"
523 submodule-timeout: "{submodule-timeout}"
524 submodule-disable: "{submodule-disable}"
525 # stage jobs always build from tip
526 choosing-strategy: default
530 server-name: "{gerrit-server-name}"
531 trigger-on: "{obj:gerrit_stage_triggers}"
533 - project-compare-type: ANT
534 project-pattern: "{project}"
536 - branch-compare-type: ANT
537 branch-pattern: "**/{branch}"
538 file-paths: "{obj:gerrit_trigger_file_paths}"
541 name: "{project-name}-cmake-packagecloud-stage-{stream}"
542 id: github-cmake-packagecloud-stage
545 <<: *lf_cmake_pc_stage
548 - lf-infra-properties:
549 build-days-to-keep: "{build-days-to-keep}"
551 url: "{github-url}/{github-org}/{project}"
554 - lf-infra-github-scm:
555 url: "{git-clone-url}{github-org}/{project}"
556 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
558 submodule-recursive: "{submodule-recursive}"
559 submodule-timeout: "{submodule-timeout}"
560 submodule-disable: "{submodule-disable}"
561 choosing-strategy: default
562 jenkins-ssh-credential: "{jenkins-ssh-credential}"
565 - github-pull-request:
566 trigger-phrase: "^(stage-release)$"
567 only-trigger-phrase: true
568 status-context: "CMake PackageCloud Stage"
571 white-list-target-branches:
578 - lf_cmake_verify: &lf_cmake_verify
579 name: lf-cmake-verify
581 ######################
582 # Default parameters #
583 ######################
586 build-days-to-keep: 7
587 build-dir: "$WORKSPACE/target"
591 git-url: "$GIT_URL/$PROJECT"
592 github-url: "https://github.com"
594 install-prefix: "$BUILD_DIR/output"
598 submodule-recursive: true
599 submodule-timeout: 10
600 submodule-disable: false
602 gerrit_verify_triggers:
603 - patchset-created-event:
605 exclude-trivial-rebase: false
606 exclude-no-code-change: false
607 - draft-published-event
608 - comment-added-contains-event:
609 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
611 gerrit_trigger_file_paths:
612 - compare-type: REG_EXP
615 # github_included_regions MUST match gerrit_trigger_file_paths
616 github_included_regions:
620 - lf-infra-parameters:
624 - lf-cmake-parameters:
625 build-dir: "{build-dir}"
626 cmake-opts: "{cmake-opts}"
627 install-prefix: "{install-prefix}"
628 make-opts: "{make-opts}"
632 description: "Install build products to /usr/local (true/false)."
635 - shell: "{pre-build}"
636 - shell: !include-raw-escape: ../shell/cmake-build.sh
639 name: "{project-name}-cmake-verify-{stream}"
640 id: gerrit-cmake-verify
646 - lf-infra-gerrit-scm:
647 branch: "$GERRIT_BRANCH"
648 jenkins-ssh-credential: "{jenkins-ssh-credential}"
650 refspec: "$GERRIT_REFSPEC"
651 submodule-recursive: "{submodule-recursive}"
652 submodule-timeout: "{submodule-timeout}"
653 submodule-disable: "{submodule-disable}"
654 choosing-strategy: gerrit
658 server-name: "{gerrit-server-name}"
659 trigger-on: "{obj:gerrit_verify_triggers}"
661 - project-compare-type: "ANT"
662 project-pattern: "{project}"
664 - branch-compare-type: "ANT"
665 branch-pattern: "**/{branch}"
666 file-paths: "{obj:gerrit_trigger_file_paths}"
669 name: "{project-name}-cmake-verify-{stream}"
670 id: github-cmake-verify
676 - lf-infra-properties:
677 build-days-to-keep: "{build-days-to-keep}"
679 url: "{github-url}/{github-org}/{project}"
682 - lf-infra-github-scm:
683 url: "{git-clone-url}{github-org}/{project}"
684 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
686 submodule-recursive: "{submodule-recursive}"
687 submodule-timeout: "{submodule-timeout}"
688 submodule-disable: "{submodule-disable}"
689 choosing-strategy: default
690 jenkins-ssh-credential: "{jenkins-ssh-credential}"
693 - github-pull-request:
694 trigger-phrase: "^(recheck|reverify)$"
695 only-trigger-phrase: false
696 status-context: "CMake Verify"
699 included-regions: "{obj:github_included_regions}"
700 white-list-target-branches: