Run onap pipelines automatically at midnight
[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       - choice:
144           name: DELETE_STACK
145           choices:
146             - 'yes'
147             - 'no'
148           default: '{delete-stack}'
149           description: 'Development purposes only! Whether delete the stack or not. Default is yes. Setting this to no will increase the cost!'
150
151     properties:
152       - logrotate
153       - build-blocker:
154           use-build-blocker: true
155           blocking-jobs:
156             - 'cloud-infra-periodic-engine-.*'
157             - 'onap-.*'
158             - 'k8-.*'
159           block-level: 'NODE'
160       - throttle:
161           max-per-node: 1
162           max-total: 3
163           option: project
164
165     wrappers:
166       - credentials-binding:
167           - file:
168               credential-id: est-jenkins-openrcfile-city-karlskrona-onap
169               variable: OPENRC_FILE
170       - mask-passwords
171       - build-timeout:
172           timeout: 300
173       - fix-workspace-permissions
174       - openstack:
175           single-use: True
176
177     triggers:
178       - timed: '@midnight'
179
180     scm:
181       - git-scm:
182           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
183           branch: '{nordix-branch}'
184           refspec: ''
185           wipe_workspace: true
186           clean_before: false
187
188     builders:
189       - description-setter:
190           description: $DEPLOY_SCENARIO | $ONAP_FLAVOR
191       - shell: |
192           #!/bin/bash
193           cp $OPENRC_FILE /tmp/openrc
194       - multijob:
195           name: Deploy ONAP using OOM
196           condition: ALWAYS
197           projects:
198             - name: 'onap-deploy-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
199               current-parameters: false
200               predefined-parameters: |
201                 DISTRO=$DISTRO
202                 DEPLOY_TYPE=$DEPLOY_TYPE
203                 PROVISIONER_TYPE=$PROVISIONER_TYPE
204                 INSTALLER_TYPE=$INSTALLER_TYPE
205                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
206                 ONAP_VERSION=$ONAP_VERSION
207                 ONAP_FLAVOR=$ONAP_FLAVOR
208                 POD_NAME=$POD_NAME
209                 STACK_NAME=$STACK_NAME
210                 ENGINE_VERSION=$ENGINE_VERSION
211                 ENGINE_REFSPEC=$ENGINE_REFSPEC
212                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
213                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
214                 XTESTING_REPO_URL=$XTESTING_REPO_URL
215                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
216                 CLEANUP=$CLEANUP
217               git-revision: true
218               node-parameters: true
219               kill-phase-on: NEVER
220               abort-all-job: false
221       - multijob:
222           name: K8S and OOM Healthcheck using xtesting
223           condition: ALWAYS
224           projects:
225             - name: 'oom-healthcheck-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
226               current-parameters: false
227               predefined-parameters: |
228                 DISTRO=$DISTRO
229                 DEPLOY_TYPE=$DEPLOY_TYPE
230                 PROVISIONER_TYPE=$PROVISIONER_TYPE
231                 INSTALLER_TYPE=$INSTALLER_TYPE
232                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
233                 ONAP_VERSION=$ONAP_VERSION
234                 ONAP_FLAVOR=full
235                 TEST_TYPE=oom-healthcheck
236                 POD_NAME=$POD_NAME
237                 STACK_NAME=$STACK_NAME
238                 ENGINE_VERSION=$ENGINE_VERSION
239                 ENGINE_REFSPEC=$ENGINE_REFSPEC
240                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
241                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
242                 XTESTING_REPO_URL=$XTESTING_REPO_URL
243                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
244                 CLEANUP=$CLEANUP
245               node-parameters: true
246               kill-phase-on: NEVER
247               abort-all-job: false
248       - multijob:
249           name: ONAP Healthcheck using xtesting
250           condition: ALWAYS
251           projects:
252             - name: 'onap-healthcheck-core-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
253               current-parameters: false
254               predefined-parameters: |
255                 SLAVE_LABEL=$SLAVE_LABEL
256                 DISTRO=$DISTRO
257                 PROVISIONER_TYPE=$PROVISIONER_TYPE
258                 INSTALLER_TYPE=$INSTALLER_TYPE
259                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
260                 DEPLOY_TYPE=$DEPLOY_TYPE
261                 ONAP_VERSION=$ONAP_VERSION
262                 ONAP_FLAVOR=core
263                 TEST_TYPE=onap-healthcheck
264                 POD_NAME=$POD_NAME
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-small-{distro}-{installer-type}-{type}-{ci-loop}-{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=small
287                 TEST_TYPE=onap-healthcheck
288                 POD_NAME=$POD_NAME
289                 STACK_NAME=$STACK_NAME
290                 ENGINE_VERSION=$ENGINE_VERSION
291                 ENGINE_REFSPEC=$ENGINE_REFSPEC
292                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
293                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
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-medium-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
301               current-parameters: false
302               predefined-parameters: |
303                 SLAVE_LABEL=$SLAVE_LABEL
304                 DISTRO=$DISTRO
305                 PROVISIONER_TYPE=$PROVISIONER_TYPE
306                 INSTALLER_TYPE=$INSTALLER_TYPE
307                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
308                 DEPLOY_TYPE=$DEPLOY_TYPE
309                 ONAP_VERSION=$ONAP_VERSION
310                 ONAP_FLAVOR=medium
311                 TEST_TYPE=onap-healthcheck
312                 POD_NAME=$POD_NAME
313                 STACK_NAME=$STACK_NAME
314                 ENGINE_VERSION=$ENGINE_VERSION
315                 ENGINE_REFSPEC=$ENGINE_REFSPEC
316                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
317                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
318                 XTESTING_REPO_URL=$XTESTING_REPO_URL
319                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
320                 CLEANUP=$CLEANUP
321               node-parameters: true
322               kill-phase-on: NEVER
323               abort-all-job: false
324             - name: 'onap-healthcheck-full-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
325               current-parameters: false
326               predefined-parameters: |
327                 SLAVE_LABEL=$SLAVE_LABEL
328                 DISTRO=$DISTRO
329                 PROVISIONER_TYPE=$PROVISIONER_TYPE
330                 INSTALLER_TYPE=$INSTALLER_TYPE
331                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
332                 DEPLOY_TYPE=$DEPLOY_TYPE
333                 ONAP_VERSION=$ONAP_VERSION
334                 ONAP_FLAVOR=full
335                 TEST_TYPE=onap-healthcheck
336                 POD_NAME=$POD_NAME
337                 STACK_NAME=$STACK_NAME
338                 ENGINE_VERSION=$ENGINE_VERSION
339                 ENGINE_REFSPEC=$ENGINE_REFSPEC
340                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
341                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
342                 XTESTING_REPO_URL=$XTESTING_REPO_URL
343                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
344                 CLEANUP=$CLEANUP
345               node-parameters: true
346               kill-phase-on: NEVER
347               abort-all-job: false
348       - multijob:
349           name: Promote ONAP (not activated)
350           condition: ALWAYS
351           projects:
352             - name: 'promote-onap-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
353               current-parameters: false
354               predefined-parameters: |
355                 DISTRO=$DISTRO
356                 DEPLOY_TYPE=$DEPLOY_TYPE
357                 INSTALLER_TYPE=$INSTALLER_TYPE
358                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
359                 ONAP_VERSION=$ONAP_VERSION
360                 ONAP_FLAVOR=$ONAP_FLAVOR
361                 ENGINE_VERSION=$ENGINE_VERSION
362                 ENGINE_REFSPEC=$ENGINE_REFSPEC
363                 POD_NAME=$POD_NAME
364                 STACK_NAME=$STACK_NAME
365                 DEPLOY_SCENARIO_VERSION=$DEPLOY_SCENARIO_VERSION
366                 DEPLOY_SCENARIO_REFSPEC=$DEPLOY_SCENARIO_REFSPEC
367                 XTESTING_REPO_URL=$XTESTING_REPO_URL
368                 ENGINE_ANSIBLE_PARAMS=$ENGINE_ANSIBLE_PARAMS
369                 CLEANUP=$CLEANUP
370               node-parameters: true
371               kill-phase-on: NEVER
372               abort-all-job: false
373
374     publishers:
375       - postbuildscript:
376           builders:
377             - role: SLAVE
378               build-on:
379                 - SUCCESS
380                 - FAILURE
381                 - ABORTED
382                 - NOT_BUILT
383                 - UNSTABLE
384               build-steps:
385                 - shell:
386                     !include-raw-escape: ./wait-for-pkg-manager.sh
387                 - shell:
388                     !include-raw: ./delete-heat-stack.sh
389
390 - job-template:
391     name: '{onap-other-phases}-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
392
393     disabled: false
394
395     concurrent: true
396
397     properties:
398       - logrotate
399
400     parameters:
401       - project-parameters:
402           project: '{project}'
403           branch: '{nordix-branch}'
404       - nordix-gerrit-parameters
405       - onap-parameter-macro
406       - string:
407           name: ONAP_FLAVOR
408           default: '{onap-flavor}'
409           description: 'ONAP flavor to deploy - could be core, small, medium, full. Also used for xtesting as run_type.'
410       - string:
411           name: ONAP_VERSION
412           default: '{onap-version}'
413           description: 'ONAP version to deploy'
414
415     wrappers:
416       - credentials-binding:
417           - file:
418               credential-id: est-jenkins-openrcfile-city-karlskrona-onap
419               variable: OPENRC_FILE
420       - mask-passwords
421       - build-timeout:
422           timeout: '{build-timeout}'
423       - fix-workspace-permissions
424
425     scm:
426       - git-scm:
427           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
428           branch: '{nordix-branch}'
429           refspec: ''
430           wipe_workspace: true
431           clean_before: false
432
433     builders:
434       - description-setter:
435           description: $DEPLOY_SCENARIO | $ONAP_FLAVOR
436       - '{onap-other-phases}-macro'
437
438 - job-template:
439     name: '{onap-healthcheck-phases}-{distro}-{installer-type}-{type}-{ci-loop}-{onap-branch}'
440
441     disabled: false
442
443     concurrent: true
444
445     properties:
446       - logrotate
447
448     parameters:
449       - project-parameters:
450           project: '{project}'
451           branch: '{nordix-branch}'
452       - nordix-gerrit-parameters
453       - onap-parameter-macro
454       - string:
455           name: ONAP_VERSION
456           default: '{onap-version}'
457           description: 'ONAP version to deploy'
458       - string:
459           name: ENGINE_VERSION
460           default: '{engine-version}'
461           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Could be sha, branch'
462       - string:
463           name: ENGINE_REFSPEC
464           default: '{engine-refspec}'
465           description: 'Development purposes only! Nordix Cloud Infra Engine version to use for deploying ONAP. Must be refspec.'
466       - string:
467           name: DEPLOY_SCENARIO_VERSION
468           default: '{deploy-scenario-version}'
469           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_REFSPEC and could be sha, branch.'
470       - string:
471           name: DEPLOY_SCENARIO_REFSPEC
472           default: '{deploy-scenario-refspec}'
473           description: 'Development purposes only! Nordix Cloud Infra Scenario version to use for deploying ONAP. Depends on DEPLOY_SCENARIO_VERSION and must be refspec.'
474       - string:
475           name: POD_NAME
476           default: '{pod-name}'
477           description: 'Development purposes only! Set to none for disabling test results DB reporting.'
478
479     wrappers:
480       - credentials-binding:
481           - file:
482               credential-id: est-jenkins-openrcfile-city-karlskrona-onap
483               variable: OPENRC_FILE
484       - mask-passwords
485       - build-timeout:
486           timeout: '{build-timeout}'
487       - fix-workspace-permissions
488
489     scm:
490       - git-scm:
491           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
492           branch: '{nordix-branch}'
493           refspec: ''
494           wipe_workspace: true
495           clean_before: false
496
497     builders:
498       - description-setter:
499           description: $DEPLOY_SCENARIO | $ONAP_FLAVOR
500       - 'onap-healthcheck-macro'
501
502 # vim: set ts=2 sw=2 expandtab: