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