Add missing stream declaration in clm job
[releng/global-jjb.git] / jjb / lf-maven-jobs.yaml
1 ---
2 # This file contains job templates for Maven projects.
3
4 - job-group:
5     name: '{project-name}-maven-jobs'
6
7     # This job group contains all the recommended jobs that should be deployed
8     # for any project ci.
9
10     jobs:
11       - gerrit-maven-clm
12       - gerrit-maven-release
13
14 - job-group:
15     name: '{project-name}-github-maven-jobs'
16
17     # This job group contains all the recommended jobs that should be deployed
18     # for any project ci that is using github.
19
20     jobs:
21       - gerrit-maven-clm
22       - github-maven-release
23
24 ####################
25 # Anchors & Macros #
26 ####################
27
28 - lf_maven_clm: &lf_maven_clm
29     name: lf-maven-clm
30
31     # Produces a CLM scan of the code into Nexus IQ Server.
32     #
33     # Required parameters:
34     #     build-node:    The node to run build on.
35     #     jenkins-ssh-credential: Credential to use for SSH. (Generally should
36     #                             be configured in defaults.yaml)
37     #     settings-file: The name of settings file containing credentials for
38     #                    the project.
39     #     global-settings-file: The name of the Maven global settings to use for
40     #                           Maven configuration.
41
42     project-type: freestyle
43     node: '{build-node}'
44     jdk: '{java-version}'
45
46     ######################
47     # Default parameters #
48     ######################
49
50     branch: master
51     build-timeout: 15
52     git-url: '$GIT_URL/$PROJECT'
53     global-settings-file: global-settings
54     java-version: openjdk8
55     mvn-opts: ''
56     mvn-params: ''
57     mvn-version: mvn33
58     stream: master
59     submodule-recursive: true
60
61     #####################
62     # Job Configuration #
63     #####################
64
65     properties:
66       - lf-infra-properties:
67           # Keep around for 30 days for troubleshooting purposes.
68           build-days-to-keep: 30
69
70     parameters:
71       - lf-infra-parameters:
72           project: '{project}'
73           branch: '{branch}'
74           stream: '{stream}'
75       - lf-infra-maven-parameters
76
77     wrappers:
78       - lf-infra-wrappers:
79           build-timeout: '{build-timeout}'
80           jenkins-ssh-credential: '{jenkins-ssh-credential}'
81
82     builders:
83       - lf-maven-install:
84           mvn-version: '{mvn-version}'
85       - lf-provide-maven-settings:
86           global-settings-file: '{global-settings-file}'
87           settings-file: '{settings-file}'
88       - shell: !include-raw-escape:
89           - ../shell/lftools-install.sh
90           - ../shell/common-variables.sh
91           - ../shell/sonatype-clm.sh
92       - lf-provide-maven-settings-cleanup
93       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
94       - sonatype-clm:
95           application-name: '{project-name}'
96
97     publishers:
98       - lf-infra-publish
99
100 - lf_maven_release: &lf_maven_release
101     name: lf-maven-release
102
103     # Produces a release candidate by creating a staging repo in Nexus.
104     #
105     # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
106     # directory can then be reused later to deploy to Nexus.
107     #
108     # Required parameters:
109     #     build-node:    The node to run build on.
110     #     jenkins-ssh-credential: Credential to use for SSH. (Generally should
111     #                             be configured in defaults.yaml)
112     #     settings-file: The name of settings file containing credentials for
113     #                    the project.
114     #     global-settings-file: The name of the Maven global settings to use for
115     #                           Maven configuration.
116     #     staging-profile-id: Profile ID of the project's Nexus staging profile.
117
118     project-type: freestyle
119     node: '{build-node}'
120     jdk: '{java-version}'
121
122     ######################
123     # Default parameters #
124     ######################
125
126     branch: master
127     build-timeout: 30
128     git-url: '$GIT_URL/$PROJECT'
129     global-settings-file: global-settings
130     java-version: openjdk8
131     mvn-opts: ''
132     mvn-params: ''
133     mvn-version: mvn33
134     stream: master
135     submodule-recursive: true
136
137     #####################
138     # Job Configuration #
139     #####################
140
141     properties:
142       - lf-infra-properties:
143           # Keep around for 30 days in case a release takes long to get approved.
144           build-days-to-keep: 30
145
146     parameters:
147       - lf-infra-parameters:
148           project: '{project}'
149           branch: '{branch}'
150           stream: '{stream}'
151       - lf-infra-maven-parameters:
152           mvn-opts: '{mvn-opts}'
153           mvn-params: '{mvn-params}'
154           mvn-version: '{mvn-version}'
155           staging-profile-id: '{staging-profile-id}'
156
157     wrappers:
158       - lf-infra-wrappers:
159           build-timeout: '{build-timeout}'
160           jenkins-ssh-credential: '{jenkins-ssh-credential}'
161
162     builders:
163       - lf-jacoco-nojava-workaround
164       - lf-maven-install:
165           mvn-version: '{mvn-version}'
166       - lf-provide-maven-settings:
167           global-settings-file: '{global-settings-file}'
168           settings-file: '{settings-file}'
169       - lf-infra-create-netrc:
170           server-id: opendaylight-staging
171       - shell: !include-raw-escape:
172           - ../shell/lftools-install.sh
173           - ../shell/common-variables.sh
174           - ../shell/maven-patch-release.sh
175           - ../shell/maven-build.sh
176           - ../shell/maven-stage.sh
177       - lf-provide-maven-settings-cleanup
178
179     publishers:
180       # TODO: Make email notification work.
181       # - lf-infra-email-notify:
182       #     email-recipients: '{email-recipients}'
183       #     email-prefix: '[releng]'
184       - lf-infra-publish
185
186
187 #################
188 # Job Templates #
189 #################
190
191 - job-template:
192     name: '{project-name}-maven-clm-{stream}'
193     id: gerrit-maven-clm
194     <<: *lf_maven_clm
195
196     scm:
197       - lf-infra-gerrit-scm:
198           jenkins-ssh-credential: '{jenkins-ssh-credential}'
199           git-url: '{git-url}'
200           refspec: '$GERRIT_REFSPEC'
201           branch: '$GERRIT_BRANCH'
202           submodule-recursive: '{submodule-recursive}'
203           choosing-strategy: default
204
205 - job-template:
206     name: '{project-name}-maven-clm-{stream}'
207     id: github-maven-clm
208     <<: *lf_maven_clm
209
210     properties:
211       - github:
212           url: '{git-url}/{github-org}/{project}'
213
214     scm:
215       - lf-infra-github-scm:
216           url: '{git-clone-url}{github-org}/{project}'
217           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
218           branch: '{branch}'
219           submodule-recursive: '{submodule-recursive}'
220           choosing-strategy: default
221           jenkins-ssh-credential: '{jenkins-ssh-credential}'
222
223 - job-template:
224     name: '{project-name}-maven-release-{stream}'
225     id: gerrit-maven-release
226     <<: *lf_maven_release
227
228     scm:
229       - lf-infra-gerrit-scm:
230           jenkins-ssh-credential: '{jenkins-ssh-credential}'
231           git-url: '{git-url}'
232           refspec: '$GERRIT_REFSPEC'
233           branch: '$GERRIT_BRANCH'
234           submodule-recursive: '{submodule-recursive}'
235           choosing-strategy: default
236
237 - job-template:
238     name: '{project-name}-maven-release-{stream}'
239     id: github-maven-release
240     <<: *lf_maven_release
241
242     properties:
243       - github:
244           url: '{git-url}/{github-org}/{project}'
245
246     scm:
247       - lf-infra-github-scm:
248           url: '{git-clone-url}{github-org}/{project}'
249           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
250           branch: '{branch}'
251           submodule-recursive: '{submodule-recursive}'
252           choosing-strategy: default
253           jenkins-ssh-credential: '{jenkins-ssh-credential}'