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