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