Delete stack upon the completion of build
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-onap.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying cloud-infra
23 # engine from the tip of the master branch periodically to check the stability of it.
24 #
25 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
26 # The slaves have
27 #   - Ubuntu1604 as the base distro
28 #   - nested virtualization
29 #   - internet access
30 #   - passwordless sudo
31 #   - 16 CPUs/32GB RAM/200 GB Disk
32 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
33 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
34 #
35 # The slaves should not have a cloud infra scenario deployed on them.
36 #--------------------------------------------------------------------------------------
37
38 - project:
39     name: 'cloud-infra-periodic-onap'
40
41     project: 'infra/engine'
42
43     onap-branch:
44       - 'dublin':
45           nordix-branch: master
46           onap-version: 4.0.0-ONAP
47           onap-flavor: full
48           engine-version: master
49           engine-refspec: "refs/changes/71/1771/4"
50           deploy-scenario-version: "9a215b7935ab2b14cc7451ba15ea575e62e26da7"
51           deploy-scenario-refspec: "refs/changes/65/1765/12"
52           disabled: false
53       - 'master':
54           nordix-branch: master
55           onap-version: master
56           onap-flavor: full
57           engine-version: master
58           engine-refspec: master
59           deploy-scenario-version: master
60           deploy-scenario-refspec: master
61           disabled: true
62
63     distro:
64       - ubuntu1804
65
66     deploy-scenario:
67       - onap-oom-nofeature
68
69     type:
70       - cloud:
71           provisioner-type: heat
72           installer-type: kubespray
73           slave-label: 'jumphost-onap-ubuntu1804'
74
75     phase:
76       - onap-deploy:
77           build-timeout: 150
78       - oom-healthcheck:
79           build-timeout: 30
80           test-type: oom-healthcheck
81       - onap-healthcheck:
82           build-timeout: 30
83           test-type: onap-healthcheck
84       - promote-onap:
85           build-timeout: 5
86       - delete-stack:
87           build-timeout: 5
88
89     jobs:
90       - '{deploy-scenario}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
91       - '{phase}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
92
93 - job-template:
94     name: '{deploy-scenario}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
95
96     project-type: multijob
97
98     disabled: '{obj:disabled}'
99
100     concurrent: true
101
102     parameters:
103       - project-parameters:
104           project: '{project}'
105           branch: '{nordix-branch}'
106       - nordix-gerrit-parameters
107       - label:
108           name: SLAVE_LABEL
109           default: '{slave-label}'
110           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
111       - string:
112           name: DISTRO
113           default: '{distro}'
114           description: 'Distribution to use for configuring target nodes (networking etc.)'
115       - string:
116           name: PROVISIONER_TYPE
117           default: '{provisioner-type}'
118           description: 'Provisioner to use for provisioning nodes'
119       - string:
120           name: INSTALLER_TYPE
121           default: '{installer-type}'
122           description: 'Installer to use for deploying the scenario'
123       - string:
124           name: DEPLOY_SCENARIO
125           default: '{deploy-scenario}'
126           description: 'Scenario to deploy and test'
127       - string:
128           name: DEPLOY_TYPE
129           default: '{type}'
130           description: 'Type of the deployment'
131       - string:
132           name: ONAP_VERSION
133           default: '{onap-version}'
134           description: 'ONAP version to deploy'
135       - string:
136           name: ONAP_FLAVOR
137           default: '{onap-flavor}'
138           description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.'
139       - string:
140           name: ENGINE_REPO_URL
141           default: 'https://gerrit.nordix.org/infra/engine.git'
142           description: 'URL to Nordix cloud-infra/engine repository'
143       - string:
144           name: ENGINE_VERSION
145           default: '{engine-version}'
146           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Could be sha, branch'
147       - string:
148           name: ENGINE_REFSPEC
149           default: '{engine-refspec}'
150           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Must be refspec.'
151       - string:
152           name: DEPLOY_SCENARIO_VERSION
153           default: '{deploy-scenario-version}'
154           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
155       - string:
156           name: DEPLOY_SCENARIO_REFSPEC
157           default: '{deploy-scenario-refspec}'
158           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
159       - string:
160           name: XTESTING_REPO_URL
161           default: 'https://gerrit.nordix.org/opnfv/xtesting-onap.git'
162           description: 'URL to Nordix xtesting-onap repository'
163       - string:
164           name: ENGINE_ANSIBLE_PARAMS
165           default: ''
166           description: 'Extra parameters that can be added when run the play books.'
167       - string:
168           name: CLEANUP
169           default: 'true'
170           description: 'Cleanup leftovers of the previous run'
171
172     properties:
173       - logrotate
174       - build-blocker:
175           use-build-blocker: true
176           blocking-jobs:
177             - 'cloud-infra-periodic-engine-.*'
178             - 'onap-.*'
179             - 'k8-.*'
180           block-level: 'NODE'
181       - throttle:
182           max-per-node: 1
183           max-total: 3
184           option: project
185
186     wrappers:
187       - build-timeout:
188           timeout: 220
189       - fix-workspace-permissions
190
191     scm:
192       - git-scm:
193           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
194           branch: '{nordix-branch}'
195           refspec: ''
196           wipe_workspace: true
197           clean_before: false
198
199     builders:
200       - description-setter:
201           description: $INSTALLER_TYPE | $DEPLOY_SCENARIO
202       - multijob:
203           name: Deploy ONAP
204           condition: SUCCESSFUL
205           projects:
206             - name: 'onap-deploy-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
207               current-parameters: false
208               predefined-parameters: |
209                 DISTRO=$DISTRO
210                 DEPLOY_TYPE=$DEPLOY_TYPE
211                 PROVISIONER_TYPE=$PROVISIONER_TYPE
212                 INSTALLER_TYPE=$INSTALLER_TYPE
213                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
214                 ONAP_VERSION=$ONAP_VERSION
215                 ONAP_FLAVOR=$ONAP_FLAVOR
216                 ENGINE_VERSION=$ENGINE_VERSION
217                 ENGINE_REFSPEC=$ENGINE_REFSPEC
218                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
219                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
220                 XTESTING_REPO_URL=$XTESTING_REPO_URL
221                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
222                 CLEANUP=$CLEANUP
223               git-revision: true
224               node-parameters: true
225               kill-phase-on: FAILURE
226               abort-all-job: true
227       - multijob:
228           name: OOM Healthcheck xtesting
229           condition: ALWAYS
230           projects:
231             - name: 'oom-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
232               current-parameters: false
233               predefined-parameters: |
234                 DISTRO=$DISTRO
235                 DEPLOY_TYPE=$DEPLOY_TYPE
236                 PROVISIONER_TYPE=$PROVISIONER_TYPE
237                 INSTALLER_TYPE=$INSTALLER_TYPE
238                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
239                 ONAP_VERSION=$ONAP_VERSION
240                 ONAP_FLAVOR=full
241                 TEST_TYPE=oom-healthcheck
242                 ENGINE_VERSION=$ENGINE_VERSION
243                 ENGINE_REFSPEC=$ENGINE_REFSPEC
244                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
245                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
246                 XTESTING_REPO_URL=$XTESTING_REPO_URL
247                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
248                 CLEANUP=$CLEANUP
249               node-parameters: true
250               kill-phase-on: NEVER
251               abort-all-job: false
252       - multijob:
253           name: ONAP Healthcheck xtesting
254           condition: ALWAYS
255           projects:
256             - name: 'onap-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
257               current-parameters: false
258               predefined-parameters: |
259                 DISTRO=$DISTRO
260                 DEPLOY_TYPE=$DEPLOY_TYPE
261                 PROVISIONER_TYPE=$PROVISIONER_TYPE
262                 INSTALLER_TYPE=$INSTALLER_TYPE
263                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
264                 ONAP_VERSION=$ONAP_VERSION
265                 ONAP_FLAVOR=core
266                 TEST_TYPE=onap-healthcheck
267                 ENGINE_VERSION=$ENGINE_VERSION
268                 ENGINE_REFSPEC=$ENGINE_REFSPEC
269                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
270                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
271                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
272                 XTESTING_REPO_URL=$XTESTING_REPO_URL
273                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
274                 CLEANUP=$CLEANUP
275               node-parameters: true
276               kill-phase-on: NEVER
277               abort-all-job: false
278             - name: 'onap-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
279               current-parameters: false
280               predefined-parameters: |
281                 DISTRO=$DISTRO
282                 DEPLOY_TYPE=$DEPLOY_TYPE
283                 PROVISIONER_TYPE=$PROVISIONER_TYPE
284                 INSTALLER_TYPE=$INSTALLER_TYPE
285                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
286                 ONAP_VERSION=$ONAP_VERSION
287                 ONAP_FLAVOR=small
288                 TEST_TYPE=onap-healthcheck
289                 ENGINE_VERSION=$ENGINE_VERSION
290                 ENGINE_REFSPEC=$ENGINE_REFSPEC
291                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
292                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
293                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
294                 XTESTING_REPO_URL=$XTESTING_REPO_URL
295                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
296                 CLEANUP=$CLEANUP
297               node-parameters: true
298               kill-phase-on: NEVER
299               abort-all-job: false
300             - name: 'onap-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
301               current-parameters: false
302               predefined-parameters: |
303                 DISTRO=$DISTRO
304                 DEPLOY_TYPE=$DEPLOY_TYPE
305                 PROVISIONER_TYPE=$PROVISIONER_TYPE
306                 INSTALLER_TYPE=$INSTALLER_TYPE
307                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
308                 ONAP_VERSION=$ONAP_VERSION
309                 ONAP_FLAVOR=medium
310                 TEST_TYPE=onap-healthcheck
311                 ENGINE_VERSION=$ENGINE_VERSION
312                 ENGINE_REFSPEC=$ENGINE_REFSPEC
313                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
314                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
315                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
316                 XTESTING_REPO_URL=$XTESTING_REPO_URL
317                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
318                 CLEANUP=$CLEANUP
319               node-parameters: true
320               kill-phase-on: NEVER
321               abort-all-job: false
322             - name: 'onap-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
323               current-parameters: false
324               predefined-parameters: |
325                 DISTRO=$DISTRO
326                 DEPLOY_TYPE=$DEPLOY_TYPE
327                 PROVISIONER_TYPE=$PROVISIONER_TYPE
328                 INSTALLER_TYPE=$INSTALLER_TYPE
329                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
330                 ONAP_VERSION=$ONAP_VERSION
331                 ONAP_FLAVOR=full
332                 TEST_TYPE=onap-healthcheck
333                 ENGINE_VERSION=$ENGINE_VERSION
334                 ENGINE_REFSPEC=$ENGINE_REFSPEC
335                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
336                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
337                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
338                 XTESTING_REPO_URL=$XTESTING_REPO_URL
339                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
340                 CLEANUP=$CLEANUP
341               node-parameters: true
342               kill-phase-on: NEVER
343               abort-all-job: false
344       - multijob:
345           name: Promote ONAP
346           condition: ALWAYS
347           projects:
348             - name: 'promote-onap-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
349               current-parameters: false
350               predefined-parameters: |
351                 DISTRO=$DISTRO
352                 DEPLOY_TYPE=$DEPLOY_TYPE
353                 INSTALLER_TYPE=$INSTALLER_TYPE
354                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
355                 ONAP_VERSION=$ONAP_VERSION
356                 ONAP_FLAVOR=$ONAP_FLAVOR
357                 ENGINE_VERSION=$ENGINE_VERSION
358                 ENGINE_REFSPEC=$ENGINE_REFSPEC
359                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
360                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
361                 XTESTING_REPO_URL=$XTESTING_REPO_URL
362                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
363                 CLEANUP=$CLEANUP
364               node-parameters: true
365               kill-phase-on: NEVER
366               abort-all-job: false
367       - multijob:
368           name: Cleanup
369           condition: ALWAYS
370           projects:
371             - name: 'delete-stack-onap-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
372               current-parameters: false
373               predefined-parameters: |
374                 DISTRO=$DISTRO
375                 DEPLOY_TYPE=$DEPLOY_TYPE
376                 INSTALLER_TYPE=$INSTALLER_TYPE
377                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
378                 ONAP_VERSION=$ONAP_VERSION
379                 ONAP_FLAVOR=$ONAP_FLAVOR
380                 ENGINE_VERSION=$ENGINE_VERSION
381                 ENGINE_REFSPEC=$ENGINE_REFSPEC
382                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
383                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
384                 XTESTING_REPO_URL=$XTESTING_REPO_URL
385                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
386                 CLEANUP=$CLEANUP
387               node-parameters: true
388               kill-phase-on: NEVER
389               abort-all-job: false
390
391 - job-template:
392     name: '{phase}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
393
394     disabled: false
395
396     concurrent: true
397
398     properties:
399       - logrotate
400
401     parameters:
402       - project-parameters:
403           project: '{project}'
404           branch: '{nordix-branch}'
405       - nordix-gerrit-parameters
406       - label:
407           name: SLAVE_LABEL
408           default: 'jumphost-onap-ubuntu1804'
409           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
410       - string:
411           name: DISTRO
412           default: 'ubuntu1804'
413           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
414       - string:
415           name: PROVISIONER_TYPE
416           default: 'heat'
417           description: 'Provisioner to use for provisioning nodes'
418       - string:
419           name: INSTALLER_TYPE
420           default: 'kubespray'
421           description: 'Installer to use for deploying the scenario'
422       - string:
423           name: DEPLOY_SCENARIO
424           default: 'onap-oom-nofeature'
425           description: 'Scenario to deploy and test'
426       - string:
427           name: HEAT_ENVIRONMENT_FILE
428           default: "file://$WORKSPACE/.cache/repos/swconfig/scenarios/$DEPLOY_SCENARIO/$INSTALLER_TYPE/role/$DEPLOY_SCENARIO/files/heat-environment-full.yaml"
429           description: 'Type of the deployment'
430       - string:
431           name: DEPLOY_TYPE
432           default: 'cloud'
433           description: 'Type of the deployment. Overriden by upstream job.'
434       - string:
435           name: ONAP_VERSION
436           default: 'master'
437           description: 'ONAP version to deploy'
438       - string:
439           name: ONAP_FLAVOR
440           default: '{onap-flavor}'
441           description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.'
442       - string:
443           name: TEST_TYPE
444           default: 'oom-healthcheck'
445           description: 'Test type to run. Could be oom-healthcheck or onap-healthcheck'
446       - string:
447           name: ENGINE_VERSION
448           default: 'master'
449           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Could be sha, branch'
450       - string:
451           name: ENGINE_REFSPEC
452           default: 'master'
453           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Must be refspec.'
454       - string:
455           name: DEPLOY_SCENARIO_VERSION
456           default: 'master'
457           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
458       - string:
459           name: DEPLOY_SCENARIO_REFSPEC
460           default: 'master'
461           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
462       - string:
463           name: XTESTING_REPO_URL
464           default: 'https://gerrit.nordix.org/opnfv/xtesting-onap.git'
465           description: 'URL to Nordix xtesting-onap repository'
466       - string:
467           name: ENGINE_ANSIBLE_PARAMS
468           default: ''
469           description: 'Extra parameters that can be added when run the play books.'
470       - string:
471           name: CLEANUP
472           default: 'true'
473
474     wrappers:
475       - credentials-binding:
476           - file:
477               credential-id: nordix-jenkins-openrcfile-city-frankfurt-defaultproject
478               variable: OPENRC_FILE
479       - mask-passwords
480       - build-timeout:
481           timeout: '{build-timeout}'
482       - fix-workspace-permissions
483
484     scm:
485       - git-scm:
486           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
487           branch: '{nordix-branch}'
488           refspec: ''
489           wipe_workspace: true
490           clean_before: false
491
492     builders:
493       - description-setter:
494           description: $INSTALLER_TYPE $DEPLOY_SCENARIO
495       - '{phase}-macro'
496
497 # vim: set ts=2 sw=2 expandtab: