Remove deprecated lftools-install.sh
[releng/global-jjb.git] / jjb / lf-c-cpp-jobs.yaml
1 ---
2 ###############
3 # CMAKE STAGE #
4 ###############
5
6 - lf_cmake_stage: &lf_cmake_stage
7     name: lf-cmake-stage
8
9     ######################
10     # Default parameters #
11     ######################
12
13     branch: master
14     build-days-to-keep: 7
15     build-dir: '$WORKSPACE/target'
16     build-timeout: 15
17     cmake-opts: ''
18     cron: '@daily'
19     disable-job: false
20     git-url: '$GIT_URL/$PROJECT'
21     github-url: 'https://github.com'
22     install-prefix: '$BUILD_DIR/output'
23     make-opts: ''
24     mvn-global-settings: global-settings
25     pre-build: ''
26     stream: master
27     submodule-recursive: true
28     submodule-timeout: 10
29     version: ''
30
31     #####################
32     # Job Configuration #
33     #####################
34
35     project-type: freestyle
36     node: '{build-node}'
37     disabled: '{disable-job}'
38
39     properties:
40       - lf-infra-properties:
41           build-days-to-keep: '{build-days-to-keep}'
42
43     parameters:
44       - lf-infra-parameters:
45           project: '{project}'
46           branch: '{branch}'
47           stream: '{stream}'
48       - lf-cmake-parameters:
49           build-dir: '{build-dir}'
50           cmake-opts: '{cmake-opts}'
51           install-prefix: '{install-prefix}'
52           make-opts: '{make-opts}'
53       - string:
54           name: NEXUS_GROUP_ID
55           default: '{nexus-group-id}'
56           description: 'Project Group ID in Nexus to upload to.'
57       - string:
58           name: STAGING_PROFILE_ID
59           default: '{staging-profile-id}'
60           description: 'Nexus staging profile ID.'
61       - string:
62           name: VERSION
63           default: '{version}'
64           description: |
65               (default: '')
66
67               Project version to stage release as. There are 2 methods for
68               using this value:
69
70                   1) Defined explicitly here.
71                   2) Leave this value blank and set /tmp/artifact_version
72
73               Use method 2 in conjunction with 'pre-build' configuration to
74               generate the artifact_version automatically from files in the
75               project's repository. For example with pre-build script:
76
77               #!/bin/bash
78               MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt \
79                   | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
80               MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt \
81                   | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
82               PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt \
83                   | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
84               echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
85
86     wrappers:
87       - lf-infra-wrappers:
88           build-timeout: '{build-timeout}'
89           jenkins-ssh-credential: '{jenkins-ssh-credential}'
90
91     builders:
92       - lf-infra-pre-build
93       - lf-provide-maven-settings:
94           global-settings-file: '{mvn-global-settings}'
95           settings-file: '{mvn-settings}'
96       - lf-infra-create-netrc:
97           server-id: staging
98       - shell: '{pre-build}'
99       - shell: !include-raw-escape: ../shell/cmake-build.sh
100       - shell: !include-raw-escape: ../shell/cmake-stage.sh
101       - lf-provide-maven-settings-cleanup
102
103     publishers:
104       - lf-infra-publish
105
106 - job-template:
107     name: '{project-name}-cmake-stage-{stream}'
108     id: gerrit-cmake-stage
109     concurrent: true
110     <<: *lf_cmake_stage
111
112     scm:
113       - lf-infra-gerrit-scm:
114           branch: '$GERRIT_BRANCH'
115           jenkins-ssh-credential: '{jenkins-ssh-credential}'
116           git-url: '{git-url}'
117           refspec: '$GERRIT_REFSPEC'
118           submodule-recursive: '{submodule-recursive}'
119           submodule-timeout: '{submodule-timeout}'
120           choosing-strategy: gerrit
121
122     triggers:
123       - timed: '{obj:cron}'
124       - gerrit:
125           server-name: '{gerrit-server-name}'
126           trigger-on:
127             - comment-added-contains-event:
128                 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(stage-release)$'
129           projects:
130             - project-compare-type: 'ANT'
131               project-pattern: '{project}'
132               branches:
133                 - branch-compare-type: 'ANT'
134                   branch-pattern: '**/{branch}'
135
136 - job-template:
137     name: '{project-name}-cmake-stage-{stream}'
138     id: github-cmake-stage
139     concurrent: true
140     <<: *lf_cmake_stage
141
142     properties:
143       - lf-infra-properties:
144           build-days-to-keep: '{build-days-to-keep}'
145       - github:
146           url: '{github-url}/{github-org}/{project}'
147
148     scm:
149       - lf-infra-github-scm:
150           url: '{git-clone-url}{github-org}/{project}'
151           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
152           branch: '$sha1'
153           submodule-recursive: '{submodule-recursive}'
154           submodule-timeout: '{submodule-timeout}'
155           choosing-strategy: default
156           jenkins-ssh-credential: '{jenkins-ssh-credential}'
157
158     triggers:
159       - timed: '{obj:cron}'
160       - github-pull-request:
161           trigger-phrase: '^(stage-release)$'
162           only-trigger-phrase: true
163           status-context: 'CMake Stage'
164           permit-all: true
165           github-hooks: true
166           white-list-target-branches:
167             - '{branch}'
168
169
170 ################
171 # CMAKE VERIFY #
172 ################
173
174 - lf_cmake_verify: &lf_cmake_verify
175     name: lf-cmake-verify
176
177     ######################
178     # Default parameters #
179     ######################
180
181     branch: master
182     build-days-to-keep: 7
183     build-dir: '$WORKSPACE/target'
184     build-timeout: 15
185     cmake-opts: ''
186     disable-job: false
187     git-url: '$GIT_URL/$PROJECT'
188     github-url: 'https://github.com'
189     install-prefix: '$BUILD_DIR/output'
190     make-opts: ''
191     pre-build: ''
192     stream: master
193     submodule-recursive: true
194     submodule-timeout: 10
195
196     gerrit_verify_triggers:
197       - patchset-created-event:
198           exclude-drafts: true
199           exclude-trivial-rebase: false
200           exclude-no-code-change: false
201       - draft-published-event
202       - comment-added-contains-event:
203           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
204
205     gerrit_trigger_file_paths:
206       - compare-type: REG_EXP
207         pattern: '.*'
208
209     # github_included_regions MUST match gerrit_trigger_file_paths
210     github_included_regions:
211       - '.*'
212
213     #####################
214     # Job Configuration #
215     #####################
216
217     project-type: freestyle
218     node: '{build-node}'
219     disabled: '{disable-job}'
220
221     properties:
222       - lf-infra-properties:
223           build-days-to-keep: '{build-days-to-keep}'
224
225     parameters:
226       - lf-infra-parameters:
227           project: '{project}'
228           branch: '{branch}'
229           stream: '{stream}'
230       - lf-cmake-parameters:
231           build-dir: '{build-dir}'
232           cmake-opts: '{cmake-opts}'
233           install-prefix: '{install-prefix}'
234           make-opts: '{make-opts}'
235
236     wrappers:
237       - lf-infra-wrappers:
238           build-timeout: '{build-timeout}'
239           jenkins-ssh-credential: '{jenkins-ssh-credential}'
240
241     builders:
242       - shell: '{pre-build}'
243       - shell: !include-raw-escape: ../shell/cmake-build.sh
244
245     publishers:
246       - lf-infra-publish
247
248 - job-template:
249     name: '{project-name}-cmake-verify-{stream}'
250     id: gerrit-cmake-verify
251     concurrent: true
252     <<: *lf_cmake_verify
253
254     scm:
255       - lf-infra-gerrit-scm:
256           branch: '$GERRIT_BRANCH'
257           jenkins-ssh-credential: '{jenkins-ssh-credential}'
258           git-url: '{git-url}'
259           refspec: '$GERRIT_REFSPEC'
260           submodule-recursive: '{submodule-recursive}'
261           submodule-timeout: '{submodule-timeout}'
262           choosing-strategy: gerrit
263
264     triggers:
265       - gerrit:
266           server-name: '{gerrit-server-name}'
267           trigger-on: '{obj:gerrit_verify_triggers}'
268           projects:
269             - project-compare-type: 'ANT'
270               project-pattern: '{project}'
271               branches:
272                 - branch-compare-type: 'ANT'
273                   branch-pattern: '**/{branch}'
274               file-paths: '{obj:gerrit_trigger_file_paths}'
275
276 - job-template:
277     name: '{project-name}-cmake-verify-{stream}'
278     id: github-cmake-verify
279     concurrent: true
280     <<: *lf_cmake_verify
281
282     properties:
283       - lf-infra-properties:
284           build-days-to-keep: '{build-days-to-keep}'
285       - github:
286           url: '{github-url}/{github-org}/{project}'
287
288     scm:
289       - lf-infra-github-scm:
290           url: '{git-clone-url}{github-org}/{project}'
291           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
292           branch: '$sha1'
293           submodule-recursive: '{submodule-recursive}'
294           submodule-timeout: '{submodule-timeout}'
295           choosing-strategy: default
296           jenkins-ssh-credential: '{jenkins-ssh-credential}'
297
298     triggers:
299       - github-pull-request:
300           trigger-phrase: '^(recheck|reverify)$'
301           only-trigger-phrase: false
302           status-context: 'CMake Verify'
303           permit-all: true
304           github-hooks: true
305           included-regions: '{obj:github_included_regions}'
306           white-list-target-branches:
307             - '{branch}'