Switch to using global-jjb mvn macros
[releng/builder.git] / jjb / autorelease / autorelease-templates.yaml
1 ---
2 # Autorelease build jobs
3 - job-template:
4     name: 'autorelease-release-{stream}'
5
6     project-type: freestyle
7     node: centos7-autorelease-4c-16g
8     jdk: '{jdk}'
9     cron: 'H 0 * * *'
10
11     # Default variable values
12     mvn-version: mvn33
13     extra-mvn-opts: ''
14
15     properties:
16       - lf-infra-properties:
17           build-days-to-keep: 30
18
19     parameters:
20       - lf-infra-parameters:
21           project: '{project}'
22           stream: '{stream}'
23           branch: '{branch}'
24       - lf-infra-maven-parameters:
25           mvn-version: '{mvn-version}'
26           mvn-params:
27           mvn-opts:
28           staging-profile-id:
29       - distribution-karaf-version:
30           karaf-version: '{karaf-version}'
31       - autorelease-release-tag:
32           release-tag: '{next-release-tag}'
33       - string:
34           name: EXTRA_MVN_OPTS
35           default: '{extra-mvn-opts}'
36           description: |
37               Additional optional Maven Options to pass to the Maven Goals
38               parameter.
39
40               Examples:
41               -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
42               --fail-never   # NEVER fail the build, regardless of project result
43               --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
44       - string:
45           name: ARCHIVE_ARTIFACTS
46           default: '{archive-artifacts}'
47           description: Artifacts to archive to the logs server.
48
49     scm:
50       - git:
51           credentials-id: 'opendaylight-jenkins-ssh'
52           url: '$GIT_BASE'
53           refspec: '$GERRIT_REFSPEC'
54           branches:
55             - '$GERRIT_BRANCH'
56           choosing-strategy: 'gerrit'
57           skip-tag: true
58           submodule:
59             recursive: true
60             timeout: 60
61
62     wrappers:
63       - opendaylight-infra-wrappers:
64           build-timeout: '900'
65
66     triggers:
67       - timed: '{cron}'
68
69     builders:
70       # force jenkins install of maven version before any shell scripts use it
71       - lf-maven-install:
72           mvn-version: '{mvn-version}'
73       - wipe-local-maven-repo
74       - jacoco-nojava-workaround
75       - shell: "./scripts/list-project-dependencies.sh"
76       - autorelease-determine-merge-order
77       - autorelease-cfp:
78           autorelease-settings: 'autorelease-settings'
79           global-settings: 'odl-global-settings'
80       - autorelease-generate-taglist
81       - autorelease-distribute-taglist
82       - distribute-build-url:
83           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
84       - autorelease-generate-release-patches
85       # In a perfect world projects should be releasing separately and we consume them
86       # via a project that pulls the release bits from each project from Nexus.
87       # Keep the patches compatible with that ideal, but apply an edit
88       # to enable building in a single maven reactor afterwards.
89       - autorelease-fix-relative-paths
90       - maven-target:
91           maven-version: 'mvn33'
92           pom: 'pom.xml'
93           goals: |
94               clean deploy
95               $EXTRA_MVN_OPTS
96               -Pintegrationtests,docs,repoBuild
97               -Dcheckstyle.skip=true
98               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
99               {opendaylight-infra-mvn-opts}
100           java-opts:
101             - '-Xmx10g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
102           settings: 'autorelease-settings'
103           settings-type: cfp
104           global-settings: 'global-settings'
105           global-settings-type: cfp
106       - autorelease-maven-deploy
107       - autorelease-get-integration-test-variables
108       - autorelease-maven-sources:
109           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
110           maven-version: 'mvn33'
111           settings: 'autorelease-settings'
112           global-settings: 'global-settings'
113       - autorelease-maven-sources-post-process
114       - shell: |
115           mkdir -p archives/
116           cp *.log *.prop $_
117
118     publishers:
119       - opendaylight-infra-notify-status
120       - trigger-parameterized-builds:
121           - project: 'integration-distribution-test-{integration-test}'
122             condition: UNSTABLE_OR_BETTER
123             property-file: variables.jenkins-trigger
124             fail-on-missing: true
125           - project: 'integration-distribution-test-{integration-test}'
126             condition: FAILED
127             trigger-with-no-params: true
128           - project: 'integration-sanity-test-{integration-test}'
129             condition: UNSTABLE_OR_BETTER
130             property-file: variables.jenkins-trigger
131             fail-on-missing: true
132           - project: 'integration-sanity-test-{integration-test}'
133             condition: FAILED
134             trigger-with-no-params: true
135           - project: 'packaging-build-rpm-{stream}'
136             condition: UNSTABLE_OR_BETTER
137             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
138             property-file: variables.jenkins-trigger
139             fail-on-missing: true
140           - project: 'packaging-build-deb-{stream}'
141             condition: UNSTABLE_OR_BETTER
142             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
143             property-file: variables.jenkins-trigger
144             fail-on-missing: true
145       - lf-infra-publish
146
147 - job-template:
148     name: autorelease-update-validate-jobs-{stream}
149     project-type: freestyle
150     node: centos7-java-builder-2c-4g
151
152     properties:
153       - lf-infra-properties:
154           build-days-to-keep: 7
155
156     parameters:
157       - lf-infra-parameters:
158           project: releng/builder
159           branch: '{branch}'
160           stream: '{stream}'
161
162     scm:
163       - lf-infra-gerrit-scm:
164           git-url: '$GIT_URL/releng/builder'
165           branch: master
166           refspec: 'refs/heads/master'
167           jenkins-ssh-credential: opendaylight-jenkins-ssh
168           submodule-recursive: true
169           choosing-strategy: default
170
171     triggers:
172       - gerrit:
173           server-name: '{gerrit-server-name}'
174           trigger-on:
175             - change-merged-event
176             - comment-added-contains-event:
177                 comment-contains-value: remerge$
178           projects:
179             - project-compare-type: ANT
180               project-pattern: '{project}'
181               branches:
182                 - branch-compare-type: ANT
183                   branch-pattern: '**/{branch}'
184               file-paths:
185                 - compare-type: ANT
186                   pattern: pom.xml
187
188     wrappers:
189       - lf-infra-wrappers:
190           build-timeout: 10
191           jenkins-ssh-credential: opendaylight-jenkins-ssh
192
193     builders:
194       - shell: !include-raw-escape:
195           - update-validate-autorelease-projects.sh
196       - opendaylight-infra-push-gerrit-patch:
197           project: 'releng/builder'
198           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
199           gerrit-commit-message: |
200               Update validate autorelease projects for {stream}
201
202     publishers:
203       - lf-infra-publish
204
205 - job-template:
206     name: autorelease-version-bump-{stream}
207     project-type: freestyle
208     node: centos7-autorelease-4c-16g
209
210     properties:
211       - opendaylight-infra-properties:
212           build-days-to-keep: 7
213
214     parameters:
215       - lf-infra-parameters:
216           project: releng/autorelease
217           branch: '{branch}'
218           stream: '{stream}'
219           refspec: 'refs/heads/{branch}'
220       - string:
221           name: RELEASE_TAG
222           default: '{next-release-tag}'
223           description: |
224               Release that is being version bumped.
225               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
226       - bool:
227           name: DRY_RUN
228           default: true
229           description: |
230               If DRY_RUN is enabled modifications are not published to Gerrit.
231       - maven-exec:
232           maven-version: mvn33
233
234     scm:
235       - lf-infra-gerrit-scm:
236           git-url: '$GIT_URL/$GERRIT_PROJECT'
237           branch: '{branch}'
238           refspec: 'refs/heads/{branch}'
239           jenkins-ssh-credential: opendaylight-jenkins-ssh
240           submodule-recursive: true
241           choosing-strategy: default
242
243     wrappers:
244       - lf-infra-wrappers:
245           build-timeout: 240
246           jenkins-ssh-credential: opendaylight-jenkins-ssh
247
248     builders:
249       # force jenkins install of maven version before any shell scripts use it
250       - maven-target:
251           maven-version: mvn33
252           goals: '-version'
253           settings: autorelease-settings
254           settings-type: cfp
255           global-settings: global-settings
256           global-settings-type: cfp
257       - autorelease-cfp
258       - shell: !include-raw-escape:
259           - ../global-jjb/shell/lftools-install.sh
260           - version-bump.sh
261
262     publishers:
263       - trigger-parameterized-builds:
264           - project: 'autorelease-generate-release-notes-{stream}'
265             condition: UNSTABLE_OR_BETTER
266             trigger-with-no-params: true
267       - lf-infra-publish
268
269 - job-template:
270     name: 'autorelease-generate-release-notes-{stream}'
271
272     project-type: freestyle
273     node: centos7-java-builder-2c-4g
274
275     properties:
276       - lf-infra-properties:
277           build-days-to-keep: 7
278
279     parameters:
280       - lf-infra-parameters:
281           project: '{project}'
282           branch: '{branch}'
283           stream: '{stream}'
284
285     scm:
286       - lf-infra-gerrit-scm:
287           git-url: '$GIT_URL/$GERRIT_PROJECT'
288           branch: '{branch}'
289           refspec: 'refs/heads/{branch}'
290           jenkins-ssh-credential: opendaylight-jenkins-ssh
291           submodule-recursive: true
292           choosing-strategy: default
293
294     wrappers:
295       - lf-infra-wrappers:
296           build-timeout: 10
297           jenkins-ssh-credential: opendaylight-jenkins-ssh
298
299     triggers:
300       - timed: '0 0 * * 0'
301
302     builders:
303       - lf-maven-install:
304           mvn-version: mvn33
305       - maven-target:
306           maven-version: mvn33
307           pom: '$WORKSPACE/scripts/release_notes_management/pom.xml'
308           goals: |
309               clean package
310               {opendaylight-infra-mvn-opts}
311           settings: autorelease-settings
312           settings-type: cfp
313           global-settings: global-settings
314           global-settings-type: cfp
315       - autorelease-generate-release-notes
316
317     publishers:
318       - lf-infra-publish