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