Make delete-stack a postbuild step
[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 deploying and testing
23 # ONAP scenario onap-nofeature-noha.
24 #--------------------------------------------------------------------------------------
25
26 - project:
27     name: 'cloud-infra-periodic-onap'
28
29     project: 'infra/engine'
30
31     onap-branch:
32       - 'dublin':
33           nordix-branch: master
34           onap-version: 4.0.0-ONAP
35           engine-version: master
36           engine-refspec: master
37           deploy-scenario-version: master
38           deploy-scenario-refspec: master
39           disabled: false
40       - 'master':
41           nordix-branch: master
42           onap-version: master
43           engine-version: master
44           engine-refspec: master
45           deploy-scenario-version: master
46           deploy-scenario-refspec: master
47           disabled: false
48
49     distro:
50       - ubuntu1804
51
52     deploy-scenario:
53       - onap-oom-nofeature
54
55     type:
56       - cloud:
57           provisioner-type: heat
58           installer-type: kubespray
59           slave-label: 'jumphost-onap-ubuntu1804'
60
61     onap-other-phases:
62       - onap-deploy:
63           build-timeout: 150
64       - oom-healthcheck:
65           build-timeout: 30
66           test-type: oom-healthcheck
67       - promote-onap:
68           build-timeout: 5
69
70     onap-healthcheck-phases:
71       - onap-healthcheck-core:
72           build-timeout: 30
73           test-type: onap-healthcheck
74       - onap-healthcheck-small:
75           build-timeout: 30
76           test-type: onap-healthcheck
77       - onap-healthcheck-medium:
78           build-timeout: 30
79           test-type: onap-healthcheck
80       - onap-healthcheck-full:
81           build-timeout: 30
82           test-type: onap-healthcheck
83
84     jobs:
85       - '{deploy-scenario}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
86       - '{onap-other-phases}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
87       - '{onap-healthcheck-phases}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
88
89 - job-template:
90     name: '{deploy-scenario}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
91
92     project-type: multijob
93
94     disabled: '{obj:disabled}'
95
96     concurrent: true
97
98     parameters:
99       - project-parameters:
100           project: '{project}'
101           branch: '{nordix-branch}'
102       - nordix-gerrit-parameters
103       - onap-parameter-macro
104       - string:
105           name: ONAP_VERSION
106           default: '{onap-version}'
107           description: 'ONAP version to deploy'
108       - string:
109           name: ENGINE_VERSION
110           default: '{engine-version}'
111           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Could be sha, branch'
112       - string:
113           name: ENGINE_REFSPEC
114           default: '{engine-refspec}'
115           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Must be refspec.'
116       - string:
117           name: DEPLOY_SCENARIO_VERSION
118           default: '{deploy-scenario-version}'
119           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
120       - string:
121           name: DEPLOY_SCENARIO_REFSPEC
122           default: '{deploy-scenario-refspec}'
123           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
124
125     properties:
126       - logrotate
127       - build-blocker:
128           use-build-blocker: true
129           blocking-jobs:
130             - 'cloud-infra-periodic-engine-.*'
131             - 'onap-.*'
132             - 'k8-.*'
133           block-level: 'NODE'
134       - throttle:
135           max-per-node: 1
136           max-total: 3
137           option: project
138
139     wrappers:
140       - build-timeout:
141           timeout: 220
142       - fix-workspace-permissions
143       - openstack:
144           single-use: True
145
146     scm:
147       - git-scm:
148           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
149           branch: '{nordix-branch}'
150           refspec: ''
151           wipe_workspace: true
152           clean_before: false
153
154     builders:
155       - description-setter:
156           description: $INSTALLER_TYPE | $DEPLOY_SCENARIO
157       - multijob:
158           name: Deploy ONAP using OOM
159           condition: SUCCESSFUL
160           projects:
161             - name: 'onap-deploy-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
162               current-parameters: false
163               predefined-parameters: |
164                 DISTRO=$DISTRO
165                 DEPLOY_TYPE=$DEPLOY_TYPE
166                 PROVISIONER_TYPE=$PROVISIONER_TYPE
167                 INSTALLER_TYPE=$INSTALLER_TYPE
168                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
169                 ONAP_VERSION=$ONAP_VERSION
170                 ONAP_FLAVOR=$ONAP_FLAVOR
171                 ENGINE_VERSION=$ENGINE_VERSION
172                 ENGINE_REFSPEC=$ENGINE_REFSPEC
173                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
174                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
175                 XTESTING_REPO_URL=$XTESTING_REPO_URL
176                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
177                 CLEANUP=$CLEANUP
178               git-revision: true
179               node-parameters: true
180               kill-phase-on: FAILURE
181               abort-all-job: true
182       - multijob:
183           name: K8S and OOM Healthcheck using xtesting
184           condition: ALWAYS
185           projects:
186             - name: 'oom-healthcheck-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
187               current-parameters: false
188               predefined-parameters: |
189                 DISTRO=$DISTRO
190                 DEPLOY_TYPE=$DEPLOY_TYPE
191                 PROVISIONER_TYPE=$PROVISIONER_TYPE
192                 INSTALLER_TYPE=$INSTALLER_TYPE
193                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
194                 ONAP_VERSION=$ONAP_VERSION
195                 ONAP_FLAVOR=full
196                 TEST_TYPE=oom-healthcheck
197                 ENGINE_VERSION=$ENGINE_VERSION
198                 ENGINE_REFSPEC=$ENGINE_REFSPEC
199                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
200                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
201                 XTESTING_REPO_URL=$XTESTING_REPO_URL
202                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
203                 CLEANUP=$CLEANUP
204               node-parameters: true
205               kill-phase-on: NEVER
206               abort-all-job: false
207       - multijob:
208           name: ONAP Healthcheck using xtesting
209           condition: ALWAYS
210           projects:
211             - name: 'onap-healthcheck-core-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
212               current-parameters: false
213               predefined-parameters: |
214                 SLAVE_LABEL=$SLAVE_LABEL
215                 DISTRO=$DISTRO
216                 PROVISIONER_TYPE=$PROVISIONER_TYPE
217                 INSTALLER_TYPE=$INSTALLER_TYPE
218                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
219                 DEPLOY_TYPE=$DEPLOY_TYPE
220                 ONAP_VERSION=$ONAP_VERSION
221                 ONAP_FLAVOR=core
222                 TEST_TYPE=onap-healthcheck
223                 ENGINE_VERSION=$ENGINE_VERSION
224                 ENGINE_REFSPEC=$ENGINE_REFSPEC
225                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
226                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
227                 XTESTING_REPO_URL=$XTESTING_REPO_URL
228                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
229                 CLEANUP=$CLEANUP
230               node-parameters: true
231               kill-phase-on: NEVER
232               abort-all-job: false
233             - name: 'onap-healthcheck-small-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
234               current-parameters: false
235               predefined-parameters: |
236                 SLAVE_LABEL=$SLAVE_LABEL
237                 DISTRO=$DISTRO
238                 PROVISIONER_TYPE=$PROVISIONER_TYPE
239                 INSTALLER_TYPE=$INSTALLER_TYPE
240                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
241                 DEPLOY_TYPE=$DEPLOY_TYPE
242                 ONAP_VERSION=$ONAP_VERSION
243                 ONAP_FLAVOR=small
244                 TEST_TYPE=onap-healthcheck
245                 ENGINE_VERSION=$ENGINE_VERSION
246                 ENGINE_REFSPEC=$ENGINE_REFSPEC
247                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
248                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
249                 XTESTING_REPO_URL=$XTESTING_REPO_URL
250                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
251                 CLEANUP=$CLEANUP
252               node-parameters: true
253               kill-phase-on: NEVER
254               abort-all-job: false
255             - name: 'onap-healthcheck-medium-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
256               current-parameters: false
257               predefined-parameters: |
258                 SLAVE_LABEL=$SLAVE_LABEL
259                 DISTRO=$DISTRO
260                 PROVISIONER_TYPE=$PROVISIONER_TYPE
261                 INSTALLER_TYPE=$INSTALLER_TYPE
262                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
263                 DEPLOY_TYPE=$DEPLOY_TYPE
264                 ONAP_VERSION=$ONAP_VERSION
265                 ONAP_FLAVOR=medium
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                 XTESTING_REPO_URL=$XTESTING_REPO_URL
272                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
273                 CLEANUP=$CLEANUP
274               node-parameters: true
275               kill-phase-on: NEVER
276               abort-all-job: false
277             - name: 'onap-healthcheck-full-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
278               current-parameters: false
279               predefined-parameters: |
280                 SLAVE_LABEL=$SLAVE_LABEL
281                 DISTRO=$DISTRO
282                 PROVISIONER_TYPE=$PROVISIONER_TYPE
283                 INSTALLER_TYPE=$INSTALLER_TYPE
284                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
285                 DEPLOY_TYPE=$DEPLOY_TYPE
286                 ONAP_VERSION=$ONAP_VERSION
287                 ONAP_FLAVOR=full
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                 XTESTING_REPO_URL=$XTESTING_REPO_URL
294                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
295                 CLEANUP=$CLEANUP
296               node-parameters: true
297               kill-phase-on: NEVER
298               abort-all-job: false
299       - multijob:
300           name: Promote ONAP (not activated)
301           condition: ALWAYS
302           projects:
303             - name: 'promote-onap-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
304               current-parameters: false
305               predefined-parameters: |
306                 DISTRO=$DISTRO
307                 DEPLOY_TYPE=$DEPLOY_TYPE
308                 INSTALLER_TYPE=$INSTALLER_TYPE
309                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
310                 ONAP_VERSION=$ONAP_VERSION
311                 ONAP_FLAVOR=$ONAP_FLAVOR
312                 ENGINE_VERSION=$ENGINE_VERSION
313                 ENGINE_REFSPEC=$ENGINE_REFSPEC
314                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
315                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
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
323     publishers:
324       - postbuildscript:
325           builders:
326             - role: SLAVE
327               build-on:
328                 - SUCCESS
329                 - FAILURE
330                 - ABORTED
331                 - NOT_BUILT
332                 - UNSTABLE
333               build-steps:
334                 - shell:
335                     !include-raw: ./delete-heat-stack.sh
336
337 - job-template:
338     name: '{onap-other-phases}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
339
340     disabled: false
341
342     concurrent: true
343
344     properties:
345       - logrotate
346
347     parameters:
348       - project-parameters:
349           project: '{project}'
350           branch: '{nordix-branch}'
351       - nordix-gerrit-parameters
352       - onap-parameter-macro
353       - string:
354           name: ONAP_VERSION
355           default: '{onap-version}'
356           description: 'ONAP version to deploy'
357
358     wrappers:
359       - credentials-binding:
360           - file:
361               credential-id: nordix-jenkins-openrcfile-city-frankfurt-defaultproject
362               variable: OPENRC_FILE
363       - mask-passwords
364       - build-timeout:
365           timeout: '{build-timeout}'
366       - fix-workspace-permissions
367
368     scm:
369       - git-scm:
370           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
371           branch: '{nordix-branch}'
372           refspec: ''
373           wipe_workspace: true
374           clean_before: false
375
376     builders:
377       - description-setter:
378           description: $INSTALLER_TYPE $DEPLOY_SCENARIO
379       - '{onap-other-phases}-macro'
380
381 - job-template:
382     name: '{onap-healthcheck-phases}-periodic-{distro}-{installer-type}-{type}-{onap-branch}'
383
384     disabled: false
385
386     concurrent: true
387
388     properties:
389       - logrotate
390
391     parameters:
392       - project-parameters:
393           project: '{project}'
394           branch: '{nordix-branch}'
395       - nordix-gerrit-parameters
396       - onap-parameter-macro
397       - string:
398           name: ONAP_VERSION
399           default: '{onap-version}'
400           description: 'ONAP version to deploy'
401       - string:
402           name: ENGINE_VERSION
403           default: '{engine-version}'
404           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Could be sha, branch'
405       - string:
406           name: ENGINE_REFSPEC
407           default: '{engine-refspec}'
408           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Must be refspec.'
409       - string:
410           name: DEPLOY_SCENARIO_VERSION
411           default: '{deploy-scenario-version}'
412           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
413       - string:
414           name: DEPLOY_SCENARIO_REFSPEC
415           default: '{deploy-scenario-refspec}'
416           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
417
418     wrappers:
419       - credentials-binding:
420           - file:
421               credential-id: nordix-jenkins-openrcfile-city-frankfurt-defaultproject
422               variable: OPENRC_FILE
423       - mask-passwords
424       - build-timeout:
425           timeout: '{build-timeout}'
426       - fix-workspace-permissions
427
428     scm:
429       - git-scm:
430           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
431           branch: '{nordix-branch}'
432           refspec: ''
433           wipe_workspace: true
434           clean_before: false
435
436     builders:
437       - description-setter:
438           description: $INSTALLER_TYPE $DEPLOY_SCENARIO
439       - 'onap-healthcheck-macro'
440
441 # vim: set ts=2 sw=2 expandtab: