Convert templates to be single-use minions
[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         - openstack:
43             single-use: true
44
45     triggers:
46         - timed: 'H H * * 0'
47         - gerrit-trigger-patch-merged:
48             name: 'PROJECT_PATH'
49             branch: '{branch}'
50
51     prebuilders:
52         - jacoco-nojava-workaround
53         - provide-maven-settings:
54             global-settings-file: 'odl-global-settings'
55             settings-file: 'JENKINS_SETTINGS'
56
57     maven:
58         maven-name: '{mvn33}'
59         root-pom: 'POM'
60         goals: 'MAVEN_GOALS -V -B -Djenkins -Dmerge -Dstream={stream}'
61         maven-opts: 'MAVEN_OPTS'
62         settings: 'JENKINS_SETTINGS'
63         settings-type: cfp
64         global-settings: 'odl-global-settings'
65         global-settings-type: cfp
66         post-step-run-condition: UNSTABLE
67
68     postbuilders:
69         - conditional-step:
70             condition-kind: file-exists
71             condition-filename: deploy-site.xml
72             condition-basedir: workspace
73
74             # The strategy here is intentional to run Maven site:deploy twice
75             # once using regular pom.xml to produce a staged-site which is
76             # then used by deploy-site.xml to push to Nexus. This is a
77             # workaround to Maven Site's default linking code which creates
78             # incorrect URLs for sites due to auto-detection assuming your
79             # project is configured in a certain way which ODL is not.
80             steps:
81             - maven-target:
82                 maven-version: '{mvn33}'
83                 pom: pom.xml
84                 goals: 'site:deploy -V -B -Dstream={stream}'
85                 java-opts:
86                     - '-Xmx2g'
87                 settings: 'JENKINS_SETTINGS'
88                 settings-type: cfp
89                 global-settings: 'odl-global-settings'
90                 global-settings-type: cfp
91             - maven-target:
92                 maven-version: '{mvn33}'
93                 pom: deploy-site.xml
94                 goals: 'site:deploy -V -B -Dstream={stream}'
95                 java-opts:
96                     - '-Xmx2g'
97                 settings: 'JENKINS_SETTINGS'
98                 settings-type: cfp
99                 global-settings: 'odl-global-settings'
100                 global-settings-type: cfp
101
102     reporters:
103         - findbugs
104
105     publishers:
106         ARCHIVE_ARTIFACTS
107         - email-notification:
108             email-prefix: '[PROJECT_SHORTNAME]'
109         - maven-deploy:
110             id: ''
111             unique-version: true
112             deploy-unstable: false
113         - jacoco-report
114         - archive-build:
115             maven-version: '{mvn33}'