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