Fix github-maven-merge scm config
[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     version: ''
29
30     #####################
31     # Job Configuration #
32     #####################
33
34     project-type: freestyle
35     node: '{build-node}'
36     disabled: '{disable-job}'
37
38     properties:
39       - lf-infra-properties:
40           build-days-to-keep: '{build-days-to-keep}'
41
42     parameters:
43       - lf-infra-parameters:
44           project: '{project}'
45           branch: '{branch}'
46           stream: '{stream}'
47           lftools-version: '{lftools-version}'
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       - shell: !include-raw-escape: ../shell/lftools-install.sh
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           choosing-strategy: gerrit
120
121     triggers:
122       - timed: '{obj:cron}'
123       - gerrit:
124           server-name: '{gerrit-server-name}'
125           trigger-on:
126             - comment-added-contains-event:
127                 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(stage-release)$'
128           projects:
129             - project-compare-type: 'ANT'
130               project-pattern: '{project}'
131               branches:
132                 - branch-compare-type: 'ANT'
133                   branch-pattern: '**/{branch}'
134
135 - job-template:
136     name: '{project-name}-cmake-stage-{stream}'
137     id: github-cmake-stage
138     concurrent: true
139     <<: *lf_cmake_stage
140
141     properties:
142       - lf-infra-properties:
143           build-days-to-keep: '{build-days-to-keep}'
144       - github:
145           url: '{github-url}/{github-org}/{project}'
146
147     scm:
148       - lf-infra-github-scm:
149           url: '{git-clone-url}{github-org}/{project}'
150           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
151           branch: '$sha1'
152           submodule-recursive: '{submodule-recursive}'
153           choosing-strategy: default
154           jenkins-ssh-credential: '{jenkins-ssh-credential}'
155
156     triggers:
157       - timed: '{obj:cron}'
158       - github-pull-request:
159           trigger-phrase: '^(stage-release)$'
160           only-trigger-phrase: true
161           status-context: 'CMake Stage'
162           permit-all: true
163           github-hooks: true
164           white-list-target-branches:
165             - '{branch}'
166
167
168 ################
169 # CMAKE VERIFY #
170 ################
171
172 - lf_cmake_verify: &lf_cmake_verify
173     name: lf-cmake-verify
174
175     ######################
176     # Default parameters #
177     ######################
178
179     branch: master
180     build-days-to-keep: 7
181     build-dir: '$WORKSPACE/target'
182     build-timeout: 15
183     cmake-opts: ''
184     disable-job: false
185     git-url: '$GIT_URL/$PROJECT'
186     github-url: 'https://github.com'
187     install-prefix: '$BUILD_DIR/output'
188     make-opts: ''
189     pre-build: ''
190     stream: master
191     submodule-recursive: true
192
193     gerrit_verify_triggers:
194       - patchset-created-event:
195           exclude-drafts: true
196           exclude-trivial-rebase: false
197           exclude-no-code-change: false
198       - draft-published-event
199       - comment-added-contains-event:
200           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
201
202     gerrit_trigger_file_paths:
203       - compare-type: REG_EXP
204         pattern: '.*'
205
206     # github_included_regions MUST match gerrit_trigger_file_paths
207     github_included_regions:
208       - '.*'
209
210     #####################
211     # Job Configuration #
212     #####################
213
214     project-type: freestyle
215     node: '{build-node}'
216     disabled: '{disable-job}'
217
218     properties:
219       - lf-infra-properties:
220           build-days-to-keep: '{build-days-to-keep}'
221
222     parameters:
223       - lf-infra-parameters:
224           project: '{project}'
225           branch: '{branch}'
226           stream: '{stream}'
227           lftools-version: '{lftools-version}'
228       - lf-cmake-parameters:
229           build-dir: '{build-dir}'
230           cmake-opts: '{cmake-opts}'
231           install-prefix: '{install-prefix}'
232           make-opts: '{make-opts}'
233
234     wrappers:
235       - lf-infra-wrappers:
236           build-timeout: '{build-timeout}'
237           jenkins-ssh-credential: '{jenkins-ssh-credential}'
238
239     builders:
240       - shell: '{pre-build}'
241       - shell: !include-raw-escape: ../shell/cmake-build.sh
242
243     publishers:
244       - lf-infra-publish
245
246 - job-template:
247     name: '{project-name}-cmake-verify-{stream}'
248     id: gerrit-cmake-verify
249     concurrent: true
250     <<: *lf_cmake_verify
251
252     scm:
253       - lf-infra-gerrit-scm:
254           branch: '$GERRIT_BRANCH'
255           jenkins-ssh-credential: '{jenkins-ssh-credential}'
256           git-url: '{git-url}'
257           refspec: '$GERRIT_REFSPEC'
258           submodule-recursive: '{submodule-recursive}'
259           choosing-strategy: gerrit
260
261     triggers:
262       - gerrit:
263           server-name: '{gerrit-server-name}'
264           trigger-on: '{obj:gerrit_verify_triggers}'
265           projects:
266             - project-compare-type: 'ANT'
267               project-pattern: '{project}'
268               branches:
269                 - branch-compare-type: 'ANT'
270                   branch-pattern: '**/{branch}'
271               file-paths: '{obj:gerrit_trigger_file_paths}'
272
273 - job-template:
274     name: '{project-name}-cmake-verify-{stream}'
275     id: github-cmake-verify
276     concurrent: true
277     <<: *lf_cmake_verify
278
279     properties:
280       - lf-infra-properties:
281           build-days-to-keep: '{build-days-to-keep}'
282       - github:
283           url: '{github-url}/{github-org}/{project}'
284
285     scm:
286       - lf-infra-github-scm:
287           url: '{git-clone-url}{github-org}/{project}'
288           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
289           branch: '$sha1'
290           submodule-recursive: '{submodule-recursive}'
291           choosing-strategy: default
292           jenkins-ssh-credential: '{jenkins-ssh-credential}'
293
294     triggers:
295       - github-pull-request:
296           trigger-phrase: '^(recheck|reverify)$'
297           only-trigger-phrase: false
298           status-context: 'CMake Verify'
299           permit-all: true
300           github-hooks: true
301           included-regions: '{obj:github_included_regions}'
302           white-list-target-branches:
303             - '{branch}'