Archive control node nova.conf
[releng/builder.git] / jjb / releng-templates-java.yaml
1 ---
2 - job-template:
3     # Template used for running CLM scans
4     # Arguements:
5     #   {name}         - Project Shortname
6     #   {project}      - Fully qualified project name
7     #   {mvn-settings} - Project maven settings file
8     #   {stream}
9     #   {jdk}
10     name: '{project-name}-clm-{stream}'
11
12     project-type: freestyle
13     node: '{build-node}'
14     jdk: '{jdk}'
15
16     properties:
17       - opendaylight-infra-properties:
18           build-days-to-keep: '{build-days-to-keep}'
19
20     parameters:
21       - opendaylight-infra-parameters:
22           project: '{project}'
23           branch: '{branch}'
24           refspec: 'refs/heads/{branch}'
25           artifacts: '{archive-artifacts}'
26
27     scm:
28       - git-scm:
29           refspec: ''
30           branch: '{branch}'
31
32     wrappers:
33       - opendaylight-infra-wrappers:
34           build-timeout: '{build-timeout}'
35
36     triggers:
37       - timed: 'H H * * 6'
38
39     builders:
40       - provide-maven-settings:
41           global-settings-file: 'odl-global-settings'
42           settings-file: '{mvn-settings}'
43       - maven-target:
44           maven-version: 'mvn33'
45           pom: 'pom.xml'
46           goals: >
47               clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index
48               -V -B -Pq
49               -Djenkins
50               -Dmaven.repo.local=/tmp/r
51               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
52           java-opts:
53             - '-Xmx4096m -XX:MaxPermSize=512m'
54           settings: '{mvn-settings}'
55           settings-type: cfp
56           global-settings: 'odl-global-settings'
57           global-settings-type: cfp
58       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
59       - check-clm:
60           application-name: '{project-name}'
61
62     publishers:
63       - email-notification:
64           email-recipients: '{email-recipients}'
65           email-prefix: '[{project-name}]'
66       - opendaylight-infra-shiplogs:
67           maven-version: 'mvn33'
68
69 - job-template:
70     # Template: {project-name}-distribution-check-{stream}
71     # Goal: Build a patch and make sure the distribution can deploy with this change.
72     # Operation: This job template builds a patch, creates a distribution containing
73     #            the patch (making sure dependencies are specified),
74     #            and performs the distribution deploy test.
75
76     name: '{project-name}-distribution-check-{stream}'
77     disabled: false
78
79     project-type: freestyle
80     node: '{build-node}'
81     concurrent: true
82     jdk: '{jdk}'
83
84     properties:
85       - opendaylight-infra-properties:
86           build-days-to-keep: '{build-days-to-keep}'
87
88     parameters:
89       - opendaylight-infra-parameters:
90           project: '{project}'
91           branch: '{branch}'
92           refspec: 'refs/heads/{branch}'
93           artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
94       - integration-distribution-git-url:
95           git-url: '{git-url}'
96
97     scm:
98       - integration-gerrit-scm:
99           basedir: '$GERRIT_PROJECT'
100           refspec: '$GERRIT_REFSPEC'
101           branch: '{branch}'
102       - integration-distribution-scm:
103           branch: '{distribution_branch}'
104
105     wrappers:
106       - opendaylight-infra-wrappers:
107           # Distro-check jobs typically run within 10 - 30 minutes
108           # with 45 minutes being the occassional edge case.
109           # enforce a 60 minute limit to ensure stuck jobs get
110           # cleared up sooner.
111           build-timeout: '60'
112
113     triggers:
114       - gerrit-trigger-patch-submitted:
115           server: '{server-name}'
116           project: '{project}'
117           branch: '{branch}'
118           files: '**'
119
120     builders:
121       - distribution-check-wipe
122       - distribution-check-build-project:
123           pom: '$GERRIT_PROJECT/pom.xml'
124       - distribution-check-verify-groupid:
125           gerrit-project: '$GERRIT_PROJECT'
126       - distribution-check-download-deps:
127           dist-pom: 'distribution/pom.xml'
128       - distribution-check-delete-snapshots
129       - distribution-check-configure-remotes
130       - distribution-check-repeat-build:
131           dist-pom: 'distribution/pom.xml'
132       - integration-distribution-check
133
134     publishers:
135       - email-notification:
136           email-recipients: '{email-recipients}'
137           email-prefix: '[{project-name}]'
138       - postbuildscript:
139           builders:
140             - shell: |
141                 #!/bin/bash
142                 mkdir -p $WORKSPACE/archives
143                 cp karaf*.log $WORKSPACE/archives
144           script-only-if-succeeded: false
145           script-only-if-failed: false
146           mark-unstable-if-failed: true
147       - archive:
148           artifacts: '*.zip'
149       - opendaylight-infra-shiplogs:
150           maven-version: 'mvn33'
151
152 - job-template:
153     name: '{project-name}-integration-{stream}'
154
155     # Job template for ODL integration verify jobs
156     #
157     # This is similar to a normal verify job, but it runs
158     # when a project that's a dependency of your project
159     # is successfully built.
160     #
161     # Required Variables:
162     #     stream:    release stream (eg. boron or carbon)
163     #     branch:    git branch (eg. stable/boron or master)
164
165     project-type: freestyle
166     node: '{build-node}'
167     jdk: '{jdk}'
168
169     properties:
170       - opendaylight-infra-properties:
171           build-days-to-keep: '{build-days-to-keep}'
172
173     parameters:
174       - opendaylight-infra-parameters:
175           project: '{project}'
176           branch: '{branch}'
177           refspec: 'refs/heads/{branch}'
178           artifacts: '{archive-artifacts}'
179
180     scm:
181       - git-scm:
182           refspec: ''
183           branch: '{branch}'
184
185     wrappers:
186       - opendaylight-infra-wrappers:
187           build-timeout: '{build-timeout}'
188
189     triggers:
190       - reverse:
191           jobs: '{dependencies}'
192           result: 'success'
193
194     builders:
195       - jacoco-nojava-workaround
196       - provide-maven-settings:
197           global-settings-file: 'odl-global-settings'
198           settings-file: '{mvn-settings}'
199       - maven-target:
200           maven-version: 'mvn33'
201           goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
202           java-opts:
203             - '{mvn-opts}'
204           settings: '{mvn-settings}'
205           settings-type: cfp
206           global-settings: 'odl-global-settings'
207           global-settings-type: cfp
208
209     publishers:
210       - email-notification:
211           email-recipients: '{email-recipients}'
212           email-prefix: '{email-upstream}'
213       - findbugs
214       - jacoco-report
215       - opendaylight-infra-shiplogs:
216           maven-version: 'mvn33'
217
218 - job-template:
219     name: '{project-name}-merge-{stream}'
220
221     # Job template for ODL merge jobs
222     #
223     # The purpose of this job template is to setup a ODL merge job
224     # and deploy artifacts to Nexus.
225     #
226     # Required Variables:
227     #     stream:    release stream (eg. boron or carbon)
228     #     branch:    git branch (eg. stable/boron or master)
229
230     # Need to keep jobs that deploy to Nexus at end of build as Maven
231     # projects. Maybe reconsider this once upstream moves deploy to a
232     # separate lifecycle:
233     #     https://issues.apache.org/jira/browse/MNG-5666
234     project-type: maven
235     node: '{build-node}'
236     jdk: '{jdk}'
237
238     properties:
239       - opendaylight-infra-properties:
240           build-days-to-keep: 14
241
242     parameters:
243       - opendaylight-infra-parameters:
244           project: '{project}'
245           branch: '{branch}'
246           refspec: 'refs/heads/{branch}'
247           artifacts: '{archive-artifacts}'
248
249     scm:
250       - gerrit-trigger-scm:
251           refspec: ''
252           choosing-strategy: 'default'
253
254     wrappers:
255       - opendaylight-infra-wrappers:
256           build-timeout: '{build-timeout}'
257
258     triggers:
259       - timed: 'H H * * 0'
260       - gerrit-trigger-patch-merged:
261           server-name: '{server-name}'
262           name: '{project}'
263           branch: '{branch}'
264
265     prebuilders:
266       - jacoco-nojava-workaround
267       - provide-maven-settings:
268           global-settings-file: 'odl-global-settings'
269           settings-file: '{mvn-settings}'
270
271     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
272     maven:
273       maven-name: 'mvn33'
274       goals: >
275           {mvn-goals}
276           -V -B
277           -Djenkins
278           -Dmerge
279           -Dstream={stream}
280           -Dmaven.repo.local=/tmp/r
281           -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
282       maven-opts: '{mvn-opts}'
283       settings: '{mvn-settings}'
284       settings-type: cfp
285       global-settings: 'odl-global-settings'
286       global-settings-type: cfp
287       post-step-run-condition: UNSTABLE
288
289     postbuilders:
290       - conditional-step:
291           condition-kind: file-exists
292           condition-filename: deploy-site.xml
293           condition-basedir: workspace
294
295           # The strategy here is intentional to run Maven site:deploy twice
296           # once using regular pom.xml to produce a staged-site which is
297           # then used by deploy-site.xml to push to Nexus. This is a
298           # workaround to Maven Site's default linking code which creates
299           # incorrect URLs for sites due to auto-detection assuming your
300           # project is configured in a certain way which ODL is not.
301           steps:
302             - maven-target:
303                 maven-version: 'mvn33'
304                 pom: pom.xml
305                 goals: 'site:deploy -V -B -Dstream={stream}'
306                 java-opts:
307                   - '-Xmx2g'
308                 settings: '{mvn-settings}'
309                 settings-type: cfp
310                 global-settings: 'odl-global-settings'
311                 global-settings-type: cfp
312             - maven-target:
313                 maven-version: 'mvn33'
314                 pom: deploy-site.xml
315                 goals: 'site:deploy -V -B -Dstream={stream}'
316                 java-opts:
317                   - '-Xmx2g'
318                 settings: '{mvn-settings}'
319                 settings-type: cfp
320                 global-settings: 'odl-global-settings'
321                 global-settings-type: cfp
322
323     reporters:
324       - findbugs
325
326     publishers:
327       - email-notification:
328           email-recipients: '{email-recipients}'
329           email-prefix: '[{project-name}]'
330       - maven-deploy:
331           id: ''
332           unique-version: true
333           deploy-unstable: false
334       - jacoco-report
335       - opendaylight-infra-shiplogs:
336           maven-version: 'mvn33'
337       - trigger:
338           project: 'distribution-merge-{stream}'
339           threshold: SUCCESS
340
341 - job-template:
342     name: '{project-name}-sonar'
343     disabled: false
344
345     project-type: freestyle
346     node: '{build-node}'
347     jdk: 'openjdk8'
348
349     properties:
350       - opendaylight-infra-properties:
351           build-days-to-keep: 7
352
353     parameters:
354       - opendaylight-infra-parameters:
355           project: '{project}'
356           branch: '{branch}'
357           refspec: 'refs/heads/{branch}'
358           artifacts: '{archive-artifacts}'
359
360     scm:
361       - git-scm:
362           refspec: ''
363           branch: 'master'
364
365     wrappers:
366       - opendaylight-infra-wrappers:
367           build-timeout: '{build-timeout}'
368
369     triggers:
370       - timed: 'H H * * 6'
371       - gerrit-trigger-patch-sonar:
372           server-name: '{server-name}'
373           name: '{project}'
374           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
375
376     builders:
377       - jacoco-nojava-workaround
378       - provide-maven-settings:
379           global-settings-file: 'odl-global-settings'
380           settings-file: '{mvn-settings}'
381       - maven-target:
382           maven-version: 'mvn33'
383           goals: >
384               {mvn-goals}
385               -V -B
386               -Djenkins
387               -Dsonar
388               -Dmaven.repo.local=/tmp/r
389               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
390           maven-opts:
391             - '{mvn-opts}'
392           settings: '{mvn-settings}'
393           settings-type: cfp
394           global-settings: 'odl-global-settings'
395           global-settings-type: cfp
396       - maven-target:
397           maven-version: 'mvn33'
398           # We should switch to the recommended configuration of sonar once
399           # JJB adds support for configurating the Sonar wrapper:
400           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
401           goals: >
402               sonar:sonar
403               -V -B -Djenkins
404               -Dsonar
405               -Dsonar.host.url=https://sonar.opendaylight.org
406               -Dmaven.repo.local=/tmp/r
407               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
408           maven-opts:
409             - '{mvn-opts}'
410           settings: '{mvn-settings}'
411           settings-type: cfp
412           global-settings: 'odl-global-settings'
413           global-settings-type: cfp
414
415     publishers:
416       - email-notification:
417           email-recipients: '{email-recipients}'
418           email-prefix: '[{project-name}]'
419       - jacoco-report
420       - findbugs
421       - opendaylight-infra-shiplogs:
422           maven-version: 'mvn33'
423
424 - job-template:
425     name: '{project-name}-validate-autorelease-{stream}'
426     disabled: false
427
428     project-type: freestyle
429     node: '{build-node}'
430     concurrent: true
431     jdk: '{jdk}'
432
433     properties:
434       - opendaylight-infra-properties:
435           build-days-to-keep: 7
436
437     parameters:
438       - opendaylight-infra-parameters:
439           project: '{project}'
440           branch: '{branch}'
441           refspec: 'refs/heads/{branch}'
442           artifacts: '{archive-artifacts}'
443       - autorelease-release-tag:
444           release-tag: 'validate'
445       - autorelease-release-branch:
446           release-branch: '{branch}'
447       - string:
448           name: CLONE_URL
449           default: '{git-url}/releng/autorelease'
450           description: "Autorelease clone URL"
451
452     scm:
453       - git:
454           url: '$CLONE_URL'
455           credentials-id: 'opendaylight-jenkins-ssh'
456           refspec: ''
457           branches:
458             - 'origin/{branch}'
459           skip-tag: true
460           submodule:
461             recursive: true
462             timeout: 60
463
464     wrappers:
465       - opendaylight-infra-wrappers:
466           build-timeout: '{build-timeout}'
467
468     triggers:
469       - gerrit-trigger-patch-submitted:
470           server: '{server-name}'
471           project: '{project}'
472           branch: '{branch}'
473           files: '**/*.xml'
474
475     builders:
476       - jacoco-nojava-workaround
477       - autorelease-checkout-gerrit-patch
478       - autorelease-generate-release-patches
479       # In a perfect world projects should be releasing separately and we consume them
480       # via a project that pulls the release bits from each project from Nexus.
481       # Keep the patches compatible with that ideal, but apply an edit
482       # to enable building in a single maven reactor afterwards.
483       - autorelease-fix-relative-paths
484       - maven-target:
485           maven-version: 'mvn33'
486           pom: validate-pom.xml
487           goals: >
488               clean install dependency:tree
489               -V -B -T1.5C -Pq
490               -Djenkins
491               -Dmaven.repo.local=/tmp/r
492               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
493           java-opts:
494             - '-Xmx8g'
495           settings: 'autorelease-settings'
496           settings-type: cfp
497           global-settings: 'odl-global-settings'
498           global-settings-type: cfp
499       - maven-target:
500           maven-version: 'mvn33'
501           pom: 'pom.xml'
502           goals: >
503               clean validate
504               -V -B -Pq
505               -Djenkins
506               -Dmaven.repo.local=/tmp/r
507               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
508           java-opts:
509             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
510           settings: 'autorelease-settings'
511           settings-type: cfp
512           global-settings: 'odl-global-settings'
513           global-settings-type: cfp
514       - autorelease-sys-stats
515
516     publishers:
517       - email-notification:
518           email-recipients: '{email-recipients}'
519           email-prefix: '[autorelease] [{project-name}]'
520       - opendaylight-infra-shiplogs:
521           maven-version: 'mvn33'
522
523 - job-template:
524     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
525
526     # Job template for ODL verify jobs
527     #
528     # The purpose of this job template is to setup a ODL verify job
529     #
530     # Required Variables:
531     #     stream:    release stream (eg. boron or carbon)
532     #     branch:    git branch (eg. stable/boron or master)
533
534     project-type: freestyle
535     node: '{build-node}'
536     concurrent: true
537     jdk: '{jdks}'
538
539     properties:
540       - opendaylight-infra-properties:
541           build-days-to-keep: 7
542
543     parameters:
544       - opendaylight-infra-parameters:
545           project: '{project}'
546           branch: '{branch}'
547           refspec: 'refs/heads/{branch}'
548           artifacts: '{archive-artifacts}'
549
550     scm:
551       - gerrit-trigger-scm:
552           refspec: '$GERRIT_REFSPEC'
553           choosing-strategy: 'gerrit'
554
555     wrappers:
556       - opendaylight-infra-wrappers:
557           build-timeout: '{build-timeout}'
558
559     triggers:
560       - gerrit-trigger-patch-submitted:
561           server: '{server-name}'
562           project: '{project}'
563           branch: '{branch}'
564           files: '**'
565
566     builders:
567       - jacoco-nojava-workaround
568       - provide-maven-settings:
569           global-settings-file: 'odl-global-settings'
570           settings-file: '{mvn-settings}'
571       - maven-target:
572           maven-version: '{mvn-version}'
573           goals: >
574               {mvn-goals} -V -B
575               -Djenkins
576               -Dstream={stream}
577               -Dmaven.repo.local=/tmp/r
578               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
579           java-opts:
580             - '{mvn-opts}'
581           settings: '{mvn-settings}'
582           settings-type: cfp
583           global-settings: 'odl-global-settings'
584           global-settings-type: cfp
585
586     publishers:
587       - findbugs
588       - email-notification:
589           email-recipients: '{email-recipients}'
590           email-prefix: '[{project-name}]'
591       - jacoco-report
592       - opendaylight-infra-shiplogs:
593           maven-version: '{mvn-version}'