Add Maven Site JJB configuration for ODL
[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: '{build-days-to-keep}'
19         numToKeep: '{build-num-to-keep}'
20         artifactDaysToKeep: '{build-artifact-days-to-keep}'
21         artifactNumToKeep: '{build-artifact-num-to-keep}'
22
23     parameters:
24         - project-parameter:
25             project: '{project}'
26
27     scm:
28         - gerrit-trigger-scm:
29             credentials-id: '{ssh-credentials}'
30             refspec: ''
31             choosing-strategy: 'default'
32
33     wrappers:
34         - build-timeout
35         - ssh-agent-credentials:
36             users:
37                 - '{ssh-credentials}'
38
39     triggers:
40         - gerrit-trigger-patch-merged:
41             name: 'PROJECT_PATH'
42             branch: '{branch}'
43
44     prebuilders:
45         - wipe-org-opendaylight-repo
46         - jacoco-nojava-workaround
47         - provide-maven-settings:
48             global-settings-file: '{odl-global-settings}'
49             settings-file: '{JENKINS_SETTINGS}'
50
51     maven:
52         maven-name: '{mvn33}'
53         root-pom: 'POM'
54         goals: 'MAVEN_GOALS -Dmerge -Dstream={stream}'
55         maven-opts: 'MAVEN_OPTS'
56         settings: '{JENKINS_SETTINGS}'
57         global-settings: '{odl-global-settings}'
58         post-step-run-condition: UNSTABLE
59
60     postbuilders:
61         - conditional-step:
62             condition-kind: file-exists
63             condition-filename: deploy-site.xml
64             condition-basedir: workspace
65
66             # The strategy here is intentional to run Maven site:deploy twice
67             # once using regular pom.xml to produce a staged-site which is
68             # then used by deploy-site.xml to push to Nexus. This is a
69             # workaround to Maven Site's default linking code which creates
70             # incorrect URLs for sites due to auto-detection assuming your
71             # project is configured in a certain way which ODL is not.
72             steps:
73             - maven-target:
74                 maven-version: '{mvn33}'
75                 pom: pom.xml
76                 goals: 'site:deploy -Dstream={stream}'
77                 java-opts:
78                     - '-Xmx2g'
79                 settings: '{JENKINS_SETTINGS}'
80                 global-settings: '{odl-global-settings}'
81             - maven-target:
82                 maven-version: '{mvn33}'
83                 pom: deploy-site.xml
84                 goals: 'site:deploy -Dstream={stream}'
85                 java-opts:
86                     - '-Xmx2g'
87                 settings: '{JENKINS_SETTINGS}'
88                 global-settings: '{odl-global-settings}'
89
90     reporters:
91         - findbugs
92
93     publishers:
94         ARCHIVE_ARTIFACTS
95         - email-notification:
96             email-prefix: '[PROJECT_SHORTNAME]'
97         - maven-deploy:
98             id: ''
99             unique-version: true
100             deploy-unstable: false
101         - jacoco-report