add ccsdk-sli-northbound
[infra/cicd.git] / jjb / cloud-infra / onap-jobs / onap-release-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-release-deploy-test'
22
23     project: 'onap-release-deploy-test'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28           k8s-version: '1.15'
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       - offline:
45           disabled: false
46           execution-mode: offline-deployment
47
48     phase:
49       - deploy
50       - test
51
52
53     type:
54       - cloud:
55           provisioner-type: 'heat'
56           slave-type: 'jumphost'
57           gated-projects: 'infra/stack/onap|infra/installer/oom'
58           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"
59           idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
60
61     distro:
62       - ubuntu1804
63
64     cloud:
65       - city:
66           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
67     jobs:
68       - 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
69       - 'onap-release-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
70       - 'onap-release-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
71       - 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
72       - 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
73
74 - job-template:
75     name: 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
76
77     project-type: multijob
78
79     disabled: '{obj:disabled}'
80
81     concurrent: true
82
83     parameters:
84       - string:
85           name: DEPLOY_SCENARIO
86           default: '{deploy-scenario}'
87           description: 'Scenario to test change with.'
88       - string:
89           name: K8S_VERSION
90           default: '{k8s-version}'
91           description: 'K8S version to use for this deployment'
92       - string:
93           name: INVENTORY_INI
94           default: /tmp/inventory.ini
95           description: 'Location of the inventory file. Copied from k8s install'
96       - string:
97           name: DISTRO
98           default: '{distro}'
99           description: 'Distribution to use for configuring target nodes (networking etc.)'
100       - label:
101           name: SLAVE_LABEL
102           default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
103           description: 'Slave label to schedule this job on.'
104       - string:
105           name: HW_TYPE
106           default: '{type}'
107           description: 'Hardware type - could be virtual, cloud, or baremetal'
108       - string:
109           name: EXECUTION_MODE
110           default: '{execution-mode}'
111           description: 'Execution mode to run in'
112       - string:
113           name: PDF
114           default: '{pdf}'
115           description: 'PDF file to use for deployment'
116       - string:
117           name: IDF
118           default: '{idf}'
119           description: 'IDF file to use for deployment'
120       - string:
121           name: HEAT_STACK_NAME
122           default: "nordix-cicd-verify-onap-{environment-type}-{distro}-{stream}"
123           description: 'Name of the created stack'
124       - string:
125           name: KEYPAIR_NAME
126           default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-{stream}"
127           description: 'Name of the created keypair'
128       - string:
129           name: USE_PREBUILT_DEPLOYMENT_IMAGE
130           default: 'true'
131           description: 'Use prebuilt deployment image while running as part of CI/CD'
132       - string:
133           name: DELETE_STACK
134           default: 'false'
135           description: 'Delete the stack upon completion of the build'
136       - string:
137           name: VERBOSITY
138           default: 'true'
139           description: 'Verbosity setting for the engine - true or false - default is false'
140       - string:
141           name: CI_LOOP
142           default: "verify"
143           description: 'CI loop the job belongs to'
144       - project-parameters:
145           project: $GERRIT_PROJECT
146           branch: '{branch}'
147           description: 'The project and branch which the change is proposed for'
148       - nordix-gerrit-parameters
149
150     properties:
151       - logrotate
152       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
153       - throttle:
154           enabled: true
155           max-per-node: 1
156           max-total: 8
157           option: category
158           categories:
159             - engine-verify-deploy-test
160
161     scm:
162       - git:
163           url: https://gerrit.nordix.org/infra/engine.git
164           branches:
165             - master
166           timeout: 15
167           wipe-workspace: true
168     wrappers:
169       - build-timeout:
170           timeout: 600
171       - credentials-binding:
172           - file:
173               credential-id: '{openrc-credentials-file}'
174               variable: OPENRC_FILE
175           - username-password-separated:
176               credential-id: 'nordix-cicd-arm-credentials'
177               username: NORDIX_ARM_USERNAME
178               password: NORDIX_ARM_TOKEN
179       - mask-passwords
180       - openstack:
181           single-use: True
182       - pre-scm-buildstep:
183           failOnError: true
184           buildsteps:
185             - shell: |
186                 #!/bin/bash
187                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
188                 # offline nodes can not resolve Nordix Artifactory and Gerrit
189                 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
190                   echo "Info  : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
191                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
192                   sudo bash -c "cat << EOF >> /etc/hosts
193                 # managed by engine
194                 91.106.198.25 artifactory.nordix.org
195                 91.106.198.142 gerrit.nordix.org
196                 86.107.242.50 fra1.citycloud.com
197                 # managed by engine
198                 EOF"
199                   # we need to get rid of search domain as well
200                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
201                 fi
202
203     builders:
204       - 'generate-k8sdeployment-environment-macro'
205       - multijob:
206           name: "{environment-type} deployment on {type} instances"
207           condition: SUCCESSFUL
208           execution-type: SEQUENTIALLY
209           projects:
210             - name: 'onap-release-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
211               current-parameters: true
212               git-revision: true
213               node-parameters: true
214               kill-phase-on: FAILURE
215               abort-all-job: false
216               property-file: $WORKSPACE/k8s.properties
217             - name: 'onap-release-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
218               current-parameters: true
219               git-revision: true
220               node-parameters: true
221               kill-phase-on: FAILURE
222               abort-all-job: false
223       - multijob:
224           name: xTesting for infra-healthcheck and healthcheck
225           condition: ALWAYS
226           execution-type: SEQUENTIALLY
227           projects:
228             - name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
229               current-parameters: true
230               git-revision: true
231               node-parameters: true
232               kill-phase-on: FAILURE
233               abort-all-job: false
234             - name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
235               current-parameters: true
236               git-revision: true
237               node-parameters: true
238               kill-phase-on: FAILURE
239               abort-all-job: false
240     publishers:
241       - postbuildscript:
242           builders:
243             - role: SLAVE
244               build-on:
245                 - SUCCESS
246                 - FAILURE
247                 - ABORTED
248                 - NOT_BUILT
249                 - UNSTABLE
250               build-steps:
251                 - 'wait-pkg-mgr-macro'
252                 - 'delete-stack-macro'
253
254 - job-template:
255     name: 'onap-release-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
256
257     disabled: '{obj:disabled}'
258
259     concurrent: true
260
261     properties:
262       - logrotate
263       - throttle:
264           max-per-node: 1
265           max-total: 3
266           option: project
267
268     wrappers:
269       - build-timeout:
270           timeout: 600
271       - credentials-binding:
272           - file:
273               credential-id: '{openrc-credentials-file}'
274               variable: OPENRC_FILE
275           - username-password-separated:
276               credential-id: 'nordix-cicd-arm-credentials'
277               username: NORDIX_ARM_USERNAME
278               password: NORDIX_ARM_TOKEN
279       - mask-passwords
280       - fix-workspace-permissions
281
282     builders:
283       - 'generate-ssh-keypair-macro'
284       - 'wait-pkg-mgr-macro'
285       - 'download-deploy-artifact-macro'
286       - 'deploy-macro'
287
288 - job-template:
289     name: 'onap-release-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
290
291     disabled: '{obj:disabled}'
292
293     concurrent: true
294
295     properties:
296       - logrotate
297       - throttle:
298           max-per-node: 1
299           max-total: 3
300           option: project
301     wrappers:
302       - build-timeout:
303           timeout: 600
304       - credentials-binding:
305           - file:
306               credential-id: '{openrc-credentials-file}'
307               variable: OPENRC_FILE
308           - username-password-separated:
309               credential-id: 'nordix-cicd-arm-credentials'
310               username: NORDIX_ARM_USERNAME
311               password: NORDIX_ARM_TOKEN
312       - mask-passwords
313       - fix-workspace-permissions
314
315     builders:
316       - 'generate-ssh-keypair-macro'
317       - 'wait-pkg-mgr-macro'
318       - 'download-deploy-artifact-macro'
319       - 'deploy-macro'
320
321 - job-template:
322     name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
323
324     disabled: '{obj:disabled}'
325
326     parameters:
327       - string:
328           name: EXECUTION_MODE
329           default: '{execution-mode}'
330           description: 'Execution mode'
331       - string:
332           name: TEST_REPO_URL
333           default: 'https://gerrit.nordix.org/infra/test.git'
334           description: 'URL to clone the test repo from'
335       - string:
336           name: TEST_FW
337           default: 'xtesting'
338           description: 'Test framework to use'
339       - string:
340           name: TEST_SUITE
341           default: 'infra-healthcheck'
342           description: 'Test suite to run'
343
344
345     properties:
346       - logrotate
347       - throttle:
348           max-per-node: 1
349           max-total: 3
350           option: project
351     wrappers:
352       - build-timeout:
353           timeout: 600
354       - mask-passwords
355       - fix-workspace-permissions
356
357     builders:
358       - 'generate-ssh-keypair-macro'
359       - 'wait-pkg-mgr-macro'
360       - 'download-xtesting-artifact-macro'
361       - 'xtesting-infra-healthcheck-macro'
362
363 - job-template:
364     name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
365
366     disabled: '{obj:disabled}'
367
368     parameters:
369       - string:
370           name: EXECUTION_MODE
371           default: '{execution-mode}'
372           description: 'Execution mode'
373       - string:
374           name: TEST_REPO_URL
375           default: 'https://gerrit.nordix.org/infra/test.git'
376           description: 'URL to clone the test repo from'
377       - string:
378           name: TEST_FW
379           default: 'xtesting'
380           description: 'Test framework to use'
381       - string:
382           name: TEST_SUITE
383           default: 'healthcheck'
384           description: 'Test suite to run'
385
386     properties:
387       - logrotate
388       - throttle:
389           max-per-node: 1
390           max-total: 3
391           option: project
392     wrappers:
393       - build-timeout:
394           timeout: 600
395       - mask-passwords
396       - fix-workspace-permissions
397
398     builders:
399       - 'xtesting-healthcheck-macro'