Use GIT_BASE to dynamically determine project and credentials to clone
[releng/builder.git] / jjb / job.yaml.template
1 # REMOVE THIS LINE IF YOU WANT TO CUSTOMIZE ANYTHING BELOW
2 # Otherwise this file will be automatically overwritten by the template
3 # autobuilder.
4
5 # ODL Releng build templates
6 - project:
7     name: PROJECT
8     jobs:
9         - 'PROJECT-verify-{stream}'
10         - 'PROJECT-merge-{stream}'
11         - 'PROJECT-daily-{stream}'
12
13     # stream:    branch with - in place of / (eg. stable-helium)
14     # branch:    branch (eg. stable/helium)
15     stream:
16         - master:
17             branch: 'master'
18         - stable-helium:
19             branch: 'stable/helium'
20
21
22 # For the Job templates below replace instances of:
23 # PROJECT with your project name (eg. controller)
24 # MAVEN_GOALS with your maven goals to build
25 # MAVEN_OPTS with your maven options to build
26
27 - job-template:
28     name: 'PROJECT-verify-{stream}'
29
30     # Job template for ODL verify jobs
31     #
32     # The purpose of this job template is to setup a ODL verify job
33     #
34     # Required Variables:
35     #     stream:    branch with - in place of / (eg. stable-helium)
36     #     branch:    branch (eg. stable/helium)
37
38     project-type: maven
39     node: dynamic_verify
40
41     logrotate:
42         daysToKeep: '{build-days-to-keep}'
43         numToKeep: '{build-num-to-keep}'
44         artifactDaysToKeep: '{build-artifact-days-to-keep}'
45         artifactNumToKeep: '{build-artifact-num-to-keep}'
46
47     parameters:
48         - project-parameter:
49             project: '{project}'
50         - gerrit-parameter:
51             branch: '{branch}'
52
53     scm:
54         - gerrit-trigger-scm:
55             credentials-id: '{ssh-credentials}'
56             refspec: '$GERRIT_REFSPEC'
57             choosing-strategy: 'gerrit'
58
59     wrappers:
60         - ssh-agent-credentials:
61             user: '{ssh-credentials}'
62
63     triggers:
64         - gerrit-trigger-patch-submitted:
65             name: 'PROJECT'
66             branch: '{branch}'
67
68     maven:
69         maven-name: '{mvn32}'
70         root-pom: 'pom.xml'
71         goals: 'MAVEN_GOALS'
72         maven-opts: 'MAVEN_OPTS'
73         settings: '{PROJECT-settings}'
74         global-settings: '{odl-global-settings}'
75         ignore-upstream-changes: false
76
77     publishers:
78         - email-notification:
79             email-prefix: '[PROJECT]'
80
81 - job-template:
82     name: 'PROJECT-merge-{stream}'
83
84     # Job template for ODL merge jobs
85     #
86     # The purpose of this job template is to setup a ODL merge job
87     # and deploy artifacts to Nexus.
88     #
89     # Required Variables:
90     #     stream:    branch with - in place of / (eg. stable-helium)
91     #     branch:    branch (eg. stable/helium)
92
93     project-type: maven
94     node: dynamic_merge
95
96     logrotate:
97         daysToKeep: '{build-days-to-keep}'
98         numToKeep: '{build-num-to-keep}'
99         artifactDaysToKeep: '{build-artifact-days-to-keep}'
100         artifactNumToKeep: '{build-artifact-num-to-keep}'
101
102     parameters:
103         - project-parameter:
104             project: '{project}'
105
106     scm:
107         - gerrit-trigger-scm:
108             credentials-id: '{ssh-credentials}'
109             refspec: ''
110             choosing-strategy: 'default'
111
112     wrappers:
113         - ssh-agent-credentials:
114             user: '{ssh-credentials}'
115
116     triggers:
117         - gerrit-trigger-patch-merged:
118             name: 'PROJECT'
119             branch: '{branch}'
120
121     maven:
122         maven-name: '{mvn32}'
123         root-pom: 'pom.xml'
124         goals: 'MAVEN_GOALS'
125         maven-opts: 'MAVEN_OPTS'
126         settings: '{PROJECT-settings}'
127         global-settings: '{odl-global-settings}'
128
129     publishers:
130         - email-notification:
131             email-prefix: '[PROJECT]'
132         - maven-deploy:
133             id: ''
134             unique-version: true
135             deploy-unstable: false
136
137 - job-template:
138     name: 'PROJECT-daily-{stream}'
139
140     # Job template for daily builders
141     #
142     # The purpose of this job template is to setup a daily/nightly
143     # builder and pushes to Sonar analysis.
144     #
145     # Required Variables:
146     #     stream:    branch with - in place of / (eg. stable-helium)
147     #     branch:    branch (eg. stable/helium)
148
149     project-type: maven
150     node: dynamic_verify
151
152     logrotate:
153         daysToKeep: '{build-days-to-keep}'
154         numToKeep: '{build-num-to-keep}'
155         artifactDaysToKeep: '{build-artifact-days-to-keep}'
156         artifactNumToKeep: '{build-artifact-num-to-keep}'
157
158     parameters:
159         - project-parameter:
160             project: '{project}'
161
162     scm:
163         - git-scm:
164             credentials-id: '{ssh-credentials}'
165             refspec: ''
166             branch: '{branch}'
167
168     wrappers:
169         - ssh-agent-credentials:
170             user: '{ssh-credentials}'
171
172     triggers:
173         - timed: 'H H * * *'
174
175     maven:
176         maven-name: '{mvn32}'
177         root-pom: 'pom.xml'
178         goals: 'MAVEN_GOALS'
179         maven-opts: 'MAVEN_OPTS'
180         settings: '{PROJECT-settings}'
181         global-settings: '{odl-global-settings}'
182
183     publishers:
184         - email-notification:
185             email-prefix: '[PROJECT]'
186         - sonar:
187             branch: '{stream}'
188             language: 'java'
189             maven-opts: 'MAVEN_OPTS'