Refactor verification job templates
[ci-management.git] / jjb / integration / integration-templates-csit.yaml
1 ---
2 - job-template:
3     name: '{project-name}-{stream}-verify-csit-{functionality}'
4     disabled: '{disabled}'
5
6     project-type: freestyle
7     build-node: 'ubuntu1804-docker-8c-8g'
8     node: '{build-node}'
9     recipients: ''
10     java-version: 'openjdk11'
11     python-version: python3
12
13     properties:
14       - lf-infra-properties:
15           project: 'integration/csit'
16           build-days-to-keep: '{build-days-to-keep}'
17
18     parameters:
19       - infra-parameters:
20           project: 'integration/csit'
21           branch: '{branch}'
22           refspec: 'refs/heads/{branch}'
23           artifacts: '{archive-artifacts}'
24       - integration-test-plan:
25           test-plan: 'plans/{project-name}/{functionality}'
26       - integration-test-options:
27           test-options: '{robot-options}'
28
29     scm:
30       - gerrit-trigger-scm:
31           refspec: '$GERRIT_REFSPEC'
32           choosing-strategy: 'gerrit'
33           submodule-recursive: '{submodule-recursive}'
34
35     wrappers:
36       - lf-infra-wrappers:
37           build-timeout: '{build-timeout}'
38           jenkins-ssh-credential: '{jenkins-ssh-credential}'
39
40     triggers:
41       - gerrit-trigger-patch-submitted:
42           server: '{server-name}'
43           project: 'integration/csit'
44           branch: '{branch}'
45           files: '**/{project-name}/**'
46
47     builders:
48       - lf-update-java-alternatives:
49           java-version: '{java-version}'
50       - integration-install-robotframework
51       - inject:
52           properties-file: 'env.properties'
53       - integration-run-test
54
55     publishers:
56       - integration-robot:
57           unstable-if: 0.0
58           pass-if: 100.0
59       - lf-infra-publish
60       - email:
61           recipients: '{recipients}'
62           notify-every-unstable-build: false
63           send-to-individuals: true
64
65 - job-template:
66     name: '{project-name}-{stream}-csit-{functionality}'
67     disabled: '{disabled}'
68
69     project-type: freestyle
70     build-node: 'ubuntu1804-docker-8c-8g'
71     node: '{build-node}'
72     recipients: ''
73     java-version: 'openjdk11'
74     python-version: python3
75
76     properties:
77       - lf-infra-properties:
78           project: 'integration/csit'
79           build-days-to-keep: '{build-days-to-keep}'
80
81     parameters:
82       - infra-parameters:
83           project: 'integration/csit'
84           branch: '{branch}'
85           refspec: 'refs/heads/{branch}'
86           artifacts: '{archive-artifacts}'
87       - integration-test-plan:
88           test-plan: 'plans/{project-name}/{functionality}'
89       - integration-test-options:
90           test-options: '{robot-options}'
91
92     scm:
93       - gerrit-trigger-scm:
94           refspec: ''
95           choosing-strategy: 'default'
96           submodule-recursive: '{submodule-recursive}'
97
98     wrappers:
99       - lf-infra-wrappers:
100           build-timeout: '{build-timeout}'
101           jenkins-ssh-credential: '{jenkins-ssh-credential}'
102
103     triggers:
104       - gerrit-trigger-patch-merged:
105           server: '{server-name}'
106           project: 'integration/csit'
107           branch: '{branch}'
108           files: '**/{project-name}/**'
109       - timed: '@daily'
110       - reverse:
111           jobs: '{obj:trigger_jobs}'
112
113     builders:
114       - lf-infra-pre-build
115       - lf-update-java-alternatives:
116           java-version: '{java-version}'
117       - integration-install-robotframework
118       - inject:
119           properties-file: 'env.properties'
120       - integration-run-test
121
122     publishers:
123       - integration-robot:
124           unstable-if: 0.0
125           pass-if: 100.0
126       - lf-infra-publish
127       - email:
128           recipients: '{recipients}'
129           notify-every-unstable-build: false
130           send-to-individuals: true
131
132 - job-template:
133     # Job template for project-specific CSIT jobs
134     #
135     # The purpose of this job template is to execute
136     # project-specific CSIT test cases for docker image versions 
137     # identified by unique docker tag input parameter
138     #
139
140     name: '{project-name}-{stream}-project-csit'
141     disabled: '{disabled}'
142     project-type: freestyle
143     build-node: 'ubuntu1804-docker-8c-8g'
144     node: '{build-node}'
145     recipients: ''
146     java-version: 'openjdk11'
147     python-version: python3
148
149     properties:
150       - lf-infra-properties:
151           project: '{project}'
152           build-days-to-keep: '{build-days-to-keep}'
153
154     parameters:
155       - infra-parameters:
156           project: '{project}'
157           branch: '{branch}'
158           refspec: 'refs/heads/{branch}'
159           artifacts: '{archive-artifacts}'
160       - integration-test-options:
161           test-options: '{robot-options}'
162
163     scm:
164       - gerrit-trigger-scm:
165           refspec: '$GERRIT_REFSPEC'
166           choosing-strategy: 'gerrit'
167           submodule-recursive: '{submodule-recursive}'
168
169     wrappers:
170       - lf-infra-wrappers:
171           build-timeout: '{build-timeout}'
172           jenkins-ssh-credential: '{jenkins-ssh-credential}'
173
174     builders:
175       - lf-infra-pre-build
176       - lf-update-java-alternatives:
177           java-version: '{java-version}'
178       - integration-install-robotframework
179       - inject:
180           properties-file: 'env.properties'
181       - integration-run-project-test
182
183     publishers:
184       - integration-project-robot:
185           unstable-if: 0.0
186           pass-if: 100.0
187       - lf-infra-publish
188       - email:
189           recipients: '{recipients}'
190           notify-every-unstable-build: false
191           send-to-individuals: true
192
193 - verification_maven_job_boiler_plate: &verification_maven_job_boiler_plate
194     name: verification_maven_job_boiler_plate
195
196     ######################
197     # Default parameters #
198     ######################
199
200     branch: master
201     build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
202     build-node: ubuntu1804-docker-8c-8g
203     build-timeout: 60
204     container-public-registry: 'nexus3.onap.org:10001'
205     git-url: "$GIT_URL/$PROJECT"
206     github-url: "https://github.com"
207     maven-versions-plugin: false
208     version-properties-file: version.properties
209     mvn-central: false
210     mvn-global-settings: global-settings
211     mvn-goals: clean deploy
212     mvn-opts: ""
213     mvn-pom: ""
214     mvn-version: mvn36
215     stream: master
216     submodule-recursive: true
217     submodule-timeout: 10
218     submodule-disable: false
219
220     disabled: '{disabled}'
221     archive-artifacts: >
222       **/*.log
223       **/hs_err_*.log
224       **/target/**/feature.xml
225       **/target/failsafe-reports/failsafe-summary.xml
226       **/target/surefire-reports/*-output.txt
227
228     project-type: freestyle
229     node: '{build-node}'
230     java-version: 'openjdk11'
231
232     #####################
233     # Job Configuration #
234     #####################
235
236     properties:
237       - lf-infra-properties:
238           project: '{project}'
239           build-days-to-keep: '{build-days-to-keep}'
240     parameters:
241       - infra-parameters:
242           project: '{project}'
243           branch: '{branch}'
244           refspec: 'refs/heads/{branch}'
245           artifacts: '{archive-artifacts}'
246       - lf-infra-maven-parameters:
247           mvn-opts: "{mvn-opts}"
248           mvn-params: "{mvn-params}"
249           mvn-version: "{mvn-version}"
250       - string:
251           name: ARCHIVE_ARTIFACTS
252           default: "{archive-artifacts}"
253           description: Artifacts to archive to the logs server.
254       - integration-test-options:
255           test-options: '{robot-options}'
256     wrappers:
257       - lf-infra-wrappers:
258           build-timeout: '{build-timeout}'
259           jenkins-ssh-credential: '{jenkins-ssh-credential}'
260     builders:
261       - lf-infra-pre-build
262       - lf-jacoco-nojava-workaround
263       - lf-maven-install:
264           mvn-version: "{mvn-version}"
265       - lf-update-java-alternatives:
266           java-version: "{java-version}"
267       - lf-infra-docker-login:
268           global-settings-file: "{mvn-global-settings}"
269           settings-file: "{mvn-settings}"
270       # must provide maven settings AFTER docker-login due to its cleanup
271       - lf-provide-maven-settings:
272           global-settings-file: "{mvn-global-settings}"
273           settings-file: "{mvn-settings}"
274       - lf-maven-versions-plugin:
275           maven-versions-plugin: "{maven-versions-plugin}"
276           version-properties-file: "{version-properties-file}"
277           mvn-version: "{mvn-version}"
278           mvn-pom: "{mvn-pom}"
279           mvn-settings: "{mvn-settings}"
280       - inject:
281           properties-content: |
282             CONTAINER_PULL_REGISTRY={container-public-registry}
283       - lf-maven-build:
284           mvn-goals: "{mvn-goals}"
285       - integration-install-robotframework
286       - inject:
287           properties-file: 'env.properties'
288       - integration-run-project-test
289       - lf-provide-maven-settings-cleanup
290     publishers:
291       - lf-infra-publish
292
293 - job-template:
294     # Job template for unified review verification jobs in
295     # project-specific CSIT flow for projects built with maven
296     #
297     # The purpose of this job template is to:
298     #  1. build local snapshot docker images with maven
299     #  2. run CSIT job with the local images
300     #  3. give a verify vote to the triggering review
301     #
302
303     name: '{project-name}-review-verification-maven-{stream}'
304
305     <<: *verification_maven_job_boiler_plate
306
307     scm:
308       - gerrit-trigger-scm:
309           refspec: '$GERRIT_REFSPEC'
310           choosing-strategy: 'gerrit'
311           submodule-recursive: '{submodule-recursive}'
312     triggers:
313       - gerrit-trigger-patch-submitted:
314           server: '{server-name}'
315           project: '{project}'
316           branch: '{branch}'
317           files: '**'
318
319 - job-template:
320     # Job template for unified merge verification jobs in
321     # project-specific CSIT flow for projects built with maven
322     #
323     # The purpose of this job template is to:
324     #  1. build local snapshot docker images from master with maven
325     #  2. run CSIT job with the local images
326     #
327
328     name: '{project-name}-merge-verification-maven-{stream}'
329
330     <<: *verification_maven_job_boiler_plate
331
332     scm:
333       - gerrit-trigger-scm:
334           refspec: ''
335           choosing-strategy: 'default'
336           submodule-recursive: '{submodule-recursive}'
337     triggers:
338       - gerrit-trigger-patch-merged:
339           server: '{server-name}'
340           project: '{project}'
341           branch: '{branch}'
342           files: '**'