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