Update onap verify and onap oom helm build
[infra/cicd.git] / jjb / cloud-infra / onap-jobs / onap-verify-deploy-test.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 - project:
21     name: 'onap-verify-deploy-test'
22
23     project: 'onap-verify-deploy-test'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28           k8s-version: '1.19'
29           deploy-scenario: 'onap-full-nofeature'
30       - 'guilin':
31           branch: '{stream}'
32           k8s-version: '1.15'
33           deploy-scenario: 'onap-full-nofeature'
34       - 'frankfurt':
35           branch: '{stream}'
36           k8s-version: '1.15'
37           deploy-scenario: 'onap-sdc-nofeature'
38       - 'elalto':
39           branch: '{stream}'
40           k8s-version: '1.15'
41           deploy-scenario: 'onap-sdc-nofeature'
42
43     environment-type:
44       - online:
45           disabled: false
46           execution-mode: online-deployment
47           successful: false
48           failed: false
49           unstable: false
50           notbuilt: false
51       - offline:
52           disabled: true
53           execution-mode: offline-deployment
54           successful: false
55           failed: false
56           unstable: false
57           notbuilt: false
58
59     phase:
60       - deploy
61       - test
62
63
64     type:
65       - cloud:
66           provisioner-type: 'heat'
67           slave-type: 'jumphost'
68           gated-projects: 'infra/stack/onap|infra/installer/oom'
69           pdf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-environment-ci-city-ubuntu1804-onap.yaml"
70           idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
71
72     distro:
73       - ubuntu1804
74
75     cloud:
76       - city:
77           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
78
79     # This should be
80     dependency-jobs: 'onap-verify-tox-{stream}'
81     dependency-job-var: 'TRIGGER_onap_verify_tox_{stream}_BUILD_RESULT'
82
83     jobs:
84       - 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
85       - 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
86       - 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
87       - 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
88       - 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
89
90
91 - job-template:
92     name: 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
93
94     project-type: multijob
95
96     disabled: '{obj:disabled}'
97
98     concurrent: true
99
100     parameters:
101       - string:
102           name: DEPLOY_SCENARIO
103           default: '{deploy-scenario}'
104           description: 'Scenario to test change with.'
105       - string:
106           name: K8S_VERSION
107           default: '{k8s-version}'
108           description: 'K8S version to use for this deployment'
109       - string:
110           name: INVENTORY_INI
111           default: /tmp/inventory.ini
112           description: 'Location of the inventory file. Copied from k8s install'
113       - string:
114           name: DISTRO
115           default: '{distro}'
116           description: 'Distribution to use for configuring target nodes (networking etc.)'
117       - label:
118           name: SLAVE_LABEL
119           default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
120           description: 'Slave label to schedule this job on.'
121       - string:
122           name: HW_TYPE
123           default: '{type}'
124           description: 'Hardware type - could be virtual, cloud, or baremetal'
125       - string:
126           name: EXECUTION_MODE
127           default: '{execution-mode}'
128           description: 'Execution mode to run in'
129       - string:
130           name: STACK_TYPE
131           default: 'onap'
132           description: 'Stack to package, deploy, test, release'
133       - string:
134           name: PDF
135           default: '{pdf}'
136           description: 'PDF file to use for deployment'
137       - string:
138           name: IDF
139           default: '{idf}'
140           description: 'IDF file to use for deployment'
141       - string:
142           name: HEAT_STACK_NAME
143           default: "nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
144           description: 'Name of the created stack'
145       - string:
146           name: KEYPAIR_NAME
147           default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
148           description: 'Name of the created keypair'
149       - string:
150           name: USE_PREBUILT_DEPLOYMENT_IMAGE
151           default: 'true'
152           description: 'Use prebuilt deployment image while running as part of CI/CD'
153       - string:
154           name: DELETE_STACK
155           default: 'false'
156           description: 'Delete the stack upon completion of the build'
157       - string:
158           name: VERBOSITY
159           default: 'true'
160           description: 'Verbosity setting for the engine - true or false - default is false'
161       - string:
162           name: CI_LOOP
163           default: "verify"
164           description: 'CI loop the job belongs to'
165       - project-parameters:
166           project: $GERRIT_PROJECT
167           branch: '{branch}'
168           description: 'The project and branch which the change is proposed for'
169       - nordix-gerrit-parameters
170
171     properties:
172       - logrotate
173       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
174       - throttle:
175           enabled: true
176           max-per-node: 1
177           max-total: 8
178           option: category
179           categories:
180             - engine-verify-deploy-test
181
182     scm:
183       - git-scm-gerrit:
184           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
185           branch: $GERRIT_BRANCH
186           refspec: $GERRIT_REFSPEC
187           wipe_workspace: true
188           clean_before: false
189
190     triggers:
191       - gerrit:
192           server-name: 'Nordix Gerrit'
193           trigger-on:
194             - patchset-created-event:
195                 exclude-drafts: 'false'
196                 exclude-trivial-rebase: 'false'
197                 exclude-no-code-change: 'false'
198             - draft-published-event
199             - comment-added-contains-event:
200                 comment-contains-value: 'recheck'
201             - comment-added-contains-event:
202                 comment-contains-value: 'reverify'
203           projects:
204             - project-compare-type: 'REG_EXP'
205               project-pattern: '{gated-projects}'
206               branches:
207                 - branch-compare-type: 'ANT'
208                   branch-pattern: '**/{branch}'
209               disable-strict-forbidden-file-verification: 'true'
210               forbidden-file-paths:
211                 - compare-type: ANT
212                   pattern: 'docs/**|releasenotes/**'
213           skip-vote:
214             successful: '{obj:successful}'
215             failed: '{obj:failed}'
216             unstable: '{obj:unstable}'
217             notbuilt: '{obj:notbuilt}'
218           custom-url: '* $JOB_NAME $BUILD_URL'
219           readable-message: 'true'
220           dependency-jobs: '{dependency-jobs}'
221
222     wrappers:
223       - build-timeout:
224           timeout: 600
225       - credentials-binding:
226           - file:
227               credential-id: '{openrc-credentials-file}'
228               variable: OPENRC_FILE
229           - username-password-separated:
230               credential-id: 'nordix-cicd-arm-credentials'
231               username: NORDIX_ARM_USERNAME
232               password: NORDIX_ARM_TOKEN
233       - mask-passwords
234       - openstack:
235           single-use: True
236       - pre-scm-buildstep:
237           failOnError: true
238           buildsteps:
239             - system-groovy:
240                 command: |
241                   def build = this.getProperty('binding').getVariable('build')
242                   def listener = this.getProperty('binding').getVariable('listener')
243                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
244                     println "WARN  : Aborting build since dependent job did not succeed!"
245                     throw new InterruptedException()
246                   }}
247             - shell: |
248                 #!/bin/bash
249                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
250                 # offline nodes can not resolve Nordix Artifactory and Gerrit
251                 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
252                   echo "Info  : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
253                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
254                   sudo bash -c "cat << EOF >> /etc/hosts
255                 # managed by engine
256                 91.106.198.25 artifactory.nordix.org
257                 91.106.198.142 gerrit.nordix.org
258                 86.107.242.50 fra1.citycloud.com
259                 # managed by engine
260                 EOF"
261                   # we need to get rid of search domain as well
262                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
263                 fi
264
265     builders:
266       - 'generate-change-metadata-macro'
267       - 'generate-k8sdeployment-environment-macro'
268       - multijob:
269           name: "{environment-type} deployment on {type} instances"
270           condition: SUCCESSFUL
271           execution-type: SEQUENTIALLY
272           projects:
273             - name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
274               current-parameters: true
275               git-revision: true
276               node-parameters: true
277               kill-phase-on: FAILURE
278               abort-all-job: false
279               property-file: $WORKSPACE/k8s.properties
280             - name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
281               current-parameters: true
282               git-revision: true
283               node-parameters: true
284               kill-phase-on: FAILURE
285               abort-all-job: false
286               property-file: $WORKSPACE/change.properties
287       - multijob:
288           name: xTesting for infra-healthcheck and healthcheck
289           condition: ALWAYS
290           projects:
291             - name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
292               current-parameters: true
293               git-revision: true
294               node-parameters: true
295               kill-phase-on: FAILURE
296               abort-all-job: false
297               property-file: $WORKSPACE/change.properties
298             - name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
299               current-parameters: true
300               git-revision: true
301               node-parameters: true
302               kill-phase-on: FAILURE
303               abort-all-job: false
304     publishers:
305       - postbuildscript:
306           builders:
307             - role: SLAVE
308               build-on:
309                 - SUCCESS
310                 - FAILURE
311                 - ABORTED
312                 - NOT_BUILT
313                 - UNSTABLE
314               build-steps:
315                 - 'wait-pkg-mgr-macro'
316                 - 'delete-stack-macro'
317
318 - job-template:
319     name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
320
321     disabled: '{obj:disabled}'
322
323     concurrent: true
324
325     properties:
326       - logrotate
327       - throttle:
328           max-per-node: 1
329           max-total: 3
330           option: project
331
332     scm:
333       - git-scm-gerrit:
334           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
335           branch: $GERRIT_BRANCH
336           refspec: $GERRIT_REFSPEC
337           wipe_workspace: true
338           clean_before: false
339
340     wrappers:
341       - build-timeout:
342           timeout: 600
343       - credentials-binding:
344           - file:
345               credential-id: '{openrc-credentials-file}'
346               variable: OPENRC_FILE
347           - username-password-separated:
348               credential-id: 'nordix-cicd-arm-credentials'
349               username: NORDIX_ARM_USERNAME
350               password: NORDIX_ARM_TOKEN
351       - mask-passwords
352       - fix-workspace-permissions
353
354     builders:
355       - 'generate-ssh-keypair-macro'
356       - 'wait-pkg-mgr-macro'
357       - 'download-deploy-artifact-macro'
358       - 'deploy-macro'
359
360 - job-template:
361     name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
362
363     disabled: '{obj:disabled}'
364
365     concurrent: true
366
367     properties:
368       - logrotate
369       - throttle:
370           max-per-node: 1
371           max-total: 3
372           option: project
373
374     scm:
375       - git-scm-gerrit:
376           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
377           branch: $GERRIT_BRANCH
378           refspec: $GERRIT_REFSPEC
379           wipe_workspace: true
380           clean_before: false
381
382     wrappers:
383       - build-timeout:
384           timeout: 600
385       - credentials-binding:
386           - file:
387               credential-id: '{openrc-credentials-file}'
388               variable: OPENRC_FILE
389           - username-password-separated:
390               credential-id: 'nordix-cicd-arm-credentials'
391               username: NORDIX_ARM_USERNAME
392               password: NORDIX_ARM_TOKEN
393       - mask-passwords
394       - fix-workspace-permissions
395
396     builders:
397       - 'generate-ssh-keypair-macro'
398       - 'wait-pkg-mgr-macro'
399       - 'download-deploy-artifact-macro'
400       - 'deploy-macro'
401 - job-template:
402     name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
403
404     disabled: '{obj:disabled}'
405
406     parameters:
407       - string:
408           name: EXECUTION_MODE
409           default: '{execution-mode}'
410           description: 'Execution mode'
411       - string:
412           name: TEST_REPO_URL
413           default: 'https://gerrit.nordix.org/infra/test.git'
414           description: 'URL to clone the test repo from'
415       - string:
416           name: TEST_FW
417           default: 'xtesting'
418           description: 'Test framework to use'
419       - string:
420           name: TEST_SUITE
421           default: 'infra-healthcheck'
422           description: 'Test suite to run'
423
424     properties:
425       - logrotate
426       - throttle:
427           max-per-node: 1
428           max-total: 3
429           option: project
430     wrappers:
431       - build-timeout:
432           timeout: 600
433       - mask-passwords
434       - fix-workspace-permissions
435
436     builders:
437       - 'download-xtesting-artifact-macro'
438       - 'xtesting-infra-healthcheck-macro'
439
440 - job-template:
441     name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
442
443     disabled: '{obj:disabled}'
444
445     parameters:
446       - string:
447           name: EXECUTION_MODE
448           default: '{execution-mode}'
449           description: 'Execution mode'
450       - string:
451           name: TEST_REPO_URL
452           default: 'https://gerrit.nordix.org/infra/test.git'
453           description: 'URL to clone the test repo from'
454       - string:
455           name: TEST_FW
456           default: 'xtesting'
457           description: 'Test framework to use'
458       - string:
459           name: TEST_SUITE
460           default: 'healthcheck'
461           description: 'Test suite to run'
462
463     properties:
464       - logrotate
465       - throttle:
466           max-per-node: 1
467           max-total: 3
468           option: project
469     wrappers:
470       - build-timeout:
471           timeout: 600
472       - mask-passwords
473       - fix-workspace-permissions
474
475     builders:
476       - 'wait-pkg-mgr-macro'
477       - 'xtesting-healthcheck-macro'
478