c6de39a151a9b0ab85c21fd5bb68e6b5983db41b
[releng/builder.git] / jjb-templates / merge.yaml
1 - job-template:
2     name: 'PROJECT_SHORTNAME-merge-{stream}'
3
4     # Job template for ODL merge jobs
5     #
6     # The purpose of this job template is to setup a ODL merge job
7     # and deploy artifacts to Nexus.
8     #
9     # Required Variables:
10     #     stream:    release stream (eg. stable-lithium or beryllium)
11     #     branch:    git branch (eg. stable/lithium or master)
12
13     project-type: maven
14     node: dynamic_merge
15     jdk: '{jdk}'
16
17     logrotate:
18         daysToKeep: '14'
19         numToKeep: '10'
20         artifactDaysToKeep: '{build-artifact-days-to-keep}'
21         artifactNumToKeep: '{build-artifact-num-to-keep}'
22
23     parameters:
24         - project-parameter:
25             project: '{project}'
26         - gerrit-parameters:
27             project: '{project}'
28             branch: '{branch}'
29             refspec: 'refs/heads/{branch}'
30
31     scm:
32         - gerrit-trigger-scm:
33             credentials-id: '{ssh-credentials}'
34             refspec: ''
35             choosing-strategy: 'default'
36
37     wrappers:
38         - build-timeout
39         - ssh-agent-credentials:
40             users:
41                 - '{ssh-credentials}'
42
43     triggers:
44         - timed: 'H H * * 0'
45         - gerrit-trigger-patch-merged:
46             name: 'PROJECT_PATH'
47             branch: '{branch}'
48
49     prebuilders:
50         - wipe-org-opendaylight-repo
51         - jacoco-nojava-workaround
52         - provide-maven-settings:
53             global-settings-file: 'odl-global-settings'
54             settings-file: 'JENKINS_SETTINGS'
55
56     maven:
57         maven-name: '{mvn33}'
58         root-pom: 'POM'
59         goals: 'MAVEN_GOALS -V -B -Djenkins -Dmerge -Dstream={stream}'
60         maven-opts: 'MAVEN_OPTS'
61         settings: 'JENKINS_SETTINGS'
62         settings-type: cfp
63         global-settings: 'odl-global-settings'
64         global-settings-type: cfp
65         post-step-run-condition: UNSTABLE
66
67     postbuilders:
68         - conditional-step:
69             condition-kind: file-exists
70             condition-filename: deploy-site.xml
71             condition-basedir: workspace
72
73             # The strategy here is intentional to run Maven site:deploy twice
74             # once using regular pom.xml to produce a staged-site which is
75             # then used by deploy-site.xml to push to Nexus. This is a
76             # workaround to Maven Site's default linking code which creates
77             # incorrect URLs for sites due to auto-detection assuming your
78             # project is configured in a certain way which ODL is not.
79             steps:
80             - maven-target:
81                 maven-version: '{mvn33}'
82                 pom: pom.xml
83                 goals: 'site:deploy -V -B -Dstream={stream}'
84                 java-opts:
85                     - '-Xmx2g'
86                 settings: 'JENKINS_SETTINGS'
87                 settings-type: cfp
88                 global-settings: 'odl-global-settings'
89                 global-settings-type: cfp
90             - maven-target:
91                 maven-version: '{mvn33}'
92                 pom: deploy-site.xml
93                 goals: 'site:deploy -V -B -Dstream={stream}'
94                 java-opts:
95                     - '-Xmx2g'
96                 settings: 'JENKINS_SETTINGS'
97                 settings-type: cfp
98                 global-settings: 'odl-global-settings'
99                 global-settings-type: cfp
100
101     reporters:
102         - findbugs
103
104     publishers:
105         ARCHIVE_ARTIFACTS
106         - email-notification:
107             email-prefix: '[PROJECT_SHORTNAME]'
108         - maven-deploy:
109             id: ''
110             unique-version: true
111             deploy-unstable: false
112         - jacoco-report
113         - archive-build:
114             maven-version: '{mvn33}'