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