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: ""
29 submodule-recursive: true
31 submodule-disable: false
37 project-type: freestyle
39 disabled: "{disable-job}"
42 - lf-infra-properties:
43 build-days-to-keep: "{build-days-to-keep}"
46 - lf-infra-parameters:
50 lftools-version: "{lftools-version}"
51 - lf-cmake-parameters:
52 build-dir: "{build-dir}"
53 cmake-opts: "{cmake-opts}"
54 install-prefix: "{install-prefix}"
55 make-opts: "{make-opts}"
59 build-timeout: "{build-timeout}"
60 jenkins-ssh-credential: "{jenkins-ssh-credential}"
64 - shell: "{pre-build}"
66 # Switch this to the sonar wrapper when JJB 2.0 is available
68 SONAR_HOST_URL=https://sonarcloud.io
69 SONAR_SCANNER_VERSION={sonar-scanner-version}
70 PROJECT_KEY={sonarcloud-project-key}
71 PROJECT_ORGANIZATION={sonarcloud-organization}
72 API_TOKEN={sonarcloud-api-token}
73 - shell: !include-raw-escape: ../shell/cmake-sonar.sh
74 - lf-provide-maven-settings-cleanup
80 name: "{project-name}-cmake-sonar"
81 id: gerrit-cmake-sonar
86 - lf-infra-gerrit-scm:
87 branch: "$GERRIT_BRANCH"
88 jenkins-ssh-credential: "{jenkins-ssh-credential}"
90 refspec: "$GERRIT_REFSPEC"
91 submodule-recursive: "{submodule-recursive}"
92 submodule-timeout: "{submodule-timeout}"
93 submodule-disable: "{submodule-disable}"
94 choosing-strategy: gerrit
99 server-name: "{gerrit-server-name}"
101 - comment-added-contains-event:
102 comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
104 - project-compare-type: "ANT"
105 project-pattern: "{project}"
107 - branch-compare-type: "ANT"
108 branch-pattern: "**/{branch}"
111 name: "{project-name}-cmake-sonar"
112 id: github-cmake-sonar
117 - lf-infra-properties:
118 build-days-to-keep: "{build-days-to-keep}"
120 url: "{github-url}/{github-org}/{project}"
123 - lf-infra-github-scm:
124 url: "{git-clone-url}{github-org}/{project}"
125 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
127 submodule-recursive: "{submodule-recursive}"
128 submodule-timeout: "{submodule-timeout}"
129 submodule-disable: "{submodule-disable}"
130 choosing-strategy: default
131 jenkins-ssh-credential: "{jenkins-ssh-credential}"
134 - timed: "{obj:cron}"
140 - lf_cmake_stage: &lf_cmake_stage
143 ######################
144 # Default parameters #
145 ######################
148 build-days-to-keep: 7
149 build-dir: "$WORKSPACE/target"
154 git-url: "$GIT_URL/$PROJECT"
155 github-url: "https://github.com"
156 install-prefix: "$BUILD_DIR/output"
158 mvn-global-settings: global-settings
161 submodule-recursive: true
162 submodule-timeout: 10
163 submodule-disable: false
166 #####################
167 # Job Configuration #
168 #####################
170 project-type: freestyle
172 disabled: "{disable-job}"
175 - lf-infra-properties:
176 build-days-to-keep: "{build-days-to-keep}"
179 - lf-infra-parameters:
183 - lf-cmake-parameters:
184 build-dir: "{build-dir}"
185 cmake-opts: "{cmake-opts}"
186 install-prefix: "{install-prefix}"
187 make-opts: "{make-opts}"
190 default: "{nexus-group-id}"
191 description: "Project Group ID in Nexus to upload to."
193 name: STAGING_PROFILE_ID
194 default: "{staging-profile-id}"
195 description: "Nexus staging profile ID."
202 Project version to stage release as. There are 2 methods for
205 1) Defined explicitly here.
206 2) Leave this value blank and set /tmp/artifact_version
208 Use method 2 in conjunction with 'pre-build' configuration to
209 generate the artifact_version automatically from files in the
210 project's repository. For example with pre-build script:
213 MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
214 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
215 MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
216 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
217 PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
218 | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
219 echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
223 build-timeout: "{build-timeout}"
224 jenkins-ssh-credential: "{jenkins-ssh-credential}"
228 - lf-provide-maven-settings:
229 global-settings-file: "{mvn-global-settings}"
230 settings-file: "{mvn-settings}"
231 - lf-infra-create-netrc:
233 - shell: "{pre-build}"
234 - shell: !include-raw-escape: ../shell/cmake-build.sh
235 - shell: !include-raw-escape: ../shell/cmake-stage.sh
236 - lf-provide-maven-settings-cleanup
242 name: "{project-name}-cmake-stage-{stream}"
243 id: gerrit-cmake-stage
248 - lf-infra-gerrit-scm:
249 branch: "$GERRIT_BRANCH"
250 jenkins-ssh-credential: "{jenkins-ssh-credential}"
252 refspec: "$GERRIT_REFSPEC"
253 submodule-recursive: "{submodule-recursive}"
254 submodule-timeout: "{submodule-timeout}"
255 submodule-disable: "{submodule-disable}"
256 choosing-strategy: gerrit
259 - timed: "{obj:cron}"
261 server-name: "{gerrit-server-name}"
263 - comment-added-contains-event:
264 comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
266 - project-compare-type: "ANT"
267 project-pattern: "{project}"
269 - branch-compare-type: "ANT"
270 branch-pattern: "**/{branch}"
273 name: "{project-name}-cmake-stage-{stream}"
274 id: github-cmake-stage
279 - lf-infra-properties:
280 build-days-to-keep: "{build-days-to-keep}"
282 url: "{github-url}/{github-org}/{project}"
285 - lf-infra-github-scm:
286 url: "{git-clone-url}{github-org}/{project}"
287 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
289 submodule-recursive: "{submodule-recursive}"
290 submodule-timeout: "{submodule-timeout}"
291 submodule-disable: "{submodule-disable}"
292 choosing-strategy: default
293 jenkins-ssh-credential: "{jenkins-ssh-credential}"
296 - timed: "{obj:cron}"
297 - github-pull-request:
298 trigger-phrase: "^(stage-release)$"
299 only-trigger-phrase: true
300 status-context: "CMake Stage"
303 white-list-target-branches:
310 - lf_cmake_verify: &lf_cmake_verify
311 name: lf-cmake-verify
313 ######################
314 # Default parameters #
315 ######################
318 build-days-to-keep: 7
319 build-dir: "$WORKSPACE/target"
323 git-url: "$GIT_URL/$PROJECT"
324 github-url: "https://github.com"
325 install-prefix: "$BUILD_DIR/output"
329 submodule-recursive: true
330 submodule-timeout: 10
331 submodule-disable: false
333 gerrit_verify_triggers:
334 - patchset-created-event:
336 exclude-trivial-rebase: false
337 exclude-no-code-change: false
338 - draft-published-event
339 - comment-added-contains-event:
340 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
342 gerrit_trigger_file_paths:
343 - compare-type: REG_EXP
346 # github_included_regions MUST match gerrit_trigger_file_paths
347 github_included_regions:
350 #####################
351 # Job Configuration #
352 #####################
354 project-type: freestyle
356 disabled: "{disable-job}"
359 - lf-infra-properties:
360 build-days-to-keep: "{build-days-to-keep}"
363 - lf-infra-parameters:
367 - lf-cmake-parameters:
368 build-dir: "{build-dir}"
369 cmake-opts: "{cmake-opts}"
370 install-prefix: "{install-prefix}"
371 make-opts: "{make-opts}"
375 build-timeout: "{build-timeout}"
376 jenkins-ssh-credential: "{jenkins-ssh-credential}"
379 - shell: "{pre-build}"
380 - shell: !include-raw-escape: ../shell/cmake-build.sh
386 name: "{project-name}-cmake-verify-{stream}"
387 id: gerrit-cmake-verify
392 - lf-infra-gerrit-scm:
393 branch: "$GERRIT_BRANCH"
394 jenkins-ssh-credential: "{jenkins-ssh-credential}"
396 refspec: "$GERRIT_REFSPEC"
397 submodule-recursive: "{submodule-recursive}"
398 submodule-timeout: "{submodule-timeout}"
399 submodule-disable: "{submodule-disable}"
400 choosing-strategy: gerrit
404 server-name: "{gerrit-server-name}"
405 trigger-on: "{obj:gerrit_verify_triggers}"
407 - project-compare-type: "ANT"
408 project-pattern: "{project}"
410 - branch-compare-type: "ANT"
411 branch-pattern: "**/{branch}"
412 file-paths: "{obj:gerrit_trigger_file_paths}"
415 name: "{project-name}-cmake-verify-{stream}"
416 id: github-cmake-verify
421 - lf-infra-properties:
422 build-days-to-keep: "{build-days-to-keep}"
424 url: "{github-url}/{github-org}/{project}"
427 - lf-infra-github-scm:
428 url: "{git-clone-url}{github-org}/{project}"
429 refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
431 submodule-recursive: "{submodule-recursive}"
432 submodule-timeout: "{submodule-timeout}"
433 submodule-disable: "{submodule-disable}"
434 choosing-strategy: default
435 jenkins-ssh-credential: "{jenkins-ssh-credential}"
438 - github-pull-request:
439 trigger-phrase: "^(recheck|reverify)$"
440 only-trigger-phrase: false
441 status-context: "CMake Verify"
444 included-regions: "{obj:github_included_regions}"
445 white-list-target-branches: