Airship: finalize update for CAPM3 v1a4 release
[infra/cicd.git] / jjb / cloud-infra / kubernetes-jobs / kubernetes-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: 'kubernetes-deploy-test'
22
23     project: 'kubernetes-deploy-test'
24
25     stream:
26       - 'master':
27           branch: 'master'
28           deploy-scenario: 'k8-multus-plugins'
29       - '1_18':
30           branch: '1.18'
31           deploy-scenario: 'k8-multus-plugins'
32       - '1_17':
33           branch: '1.17'
34           deploy-scenario: 'k8-multus-plugins'
35       - '1_16':
36           branch: '1.16'
37           deploy-scenario: 'k8-calico-nofeature'
38       - '1_15':
39           branch: '1.15'
40           deploy-scenario: 'k8-calico-nofeature'
41
42     distro:
43       - ubuntu1804
44
45     environment-type:
46       - offline:
47           disabled: false
48           execution-mode: offline-deployment
49           pdf: 'file:///opt/engine/offline/git/hwconfig/pods'
50           idf: 'file:///opt/engine/offline/git/hwconfig/pods'
51           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
52
53     phase:
54       - deploy:
55           build-timeout: 60
56           execution-mode: offline-deployment
57       - functest:
58           build-timeout: 210
59           execution-mode: online-test
60       - yardstick:
61           build-timeout: 30
62           execution-mode: online-test
63
64     jobs:
65       - 'kubernetes-release-{environment-type}-deploy-test-{distro}-baremetal-{stream}'
66       - 'kubernetes-release-{environment-type}-{phase}-{distro}-baremetal-{stream}'
67
68 - job-template:
69     name: 'kubernetes-release-{environment-type}-deploy-test-{distro}-baremetal-{stream}'
70
71     project-type: multijob
72
73     disabled: '{obj:disabled}'
74
75     node: baremetal-deploy
76
77     concurrent: false
78
79     parameters:
80       - string:
81           name: EXECUTION_MODE
82           default: 'offline-deployment'
83           description: 'Engine execution mode'
84       - string:
85           name: PDF
86           default: '{pdf}/${{NODE_NAME}}-pdf.yml'
87           description: 'PDF file to use for deployment. DO NOT MODIFY!'
88       - string:
89           name: IDF
90           default: '{idf}/${{NODE_NAME}}-idf.yml'
91           description: 'IDF file to use for deployment. DO NOT MODIFY!'
92       - string:
93           name: SLAVE_LABEL
94           default: 'baremetal-deploy'
95           description: 'Type of the slave'
96
97     properties:
98       - logrotate
99       - throttle:
100           max-per-node: 1
101           max-total: 1
102           option: project
103
104     wrappers:
105       - build-timeout:
106           timeout: 300
107       - mask-passwords
108       - pre-scm-buildstep:
109           failOnError: true
110           buildsteps:
111             - shell: |
112                 #!/bin/bash
113                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
114                 # offline nodes can not resolve Nordix Artifactory and Gerrit
115                 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
116                   echo "Info  : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
117                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
118                   sudo bash -c "cat << EOF >> /etc/hosts
119                 # managed by engine
120                 91.106.198.25 artifactory.nordix.org
121                 91.106.198.142 gerrit.nordix.org
122                 86.107.242.50 fra1.citycloud.com
123                 # managed by engine
124                 EOF"
125                   # we need to get rid of search domain as well
126                   sudo sed -i 's/^search/# search/' /etc/resolv.conf
127                 fi
128
129     scm:
130       - git:
131           url: https://gerrit.nordix.org/infra/engine.git
132           branches:
133             - master
134           timeout: 15
135           wipe-workspace: true
136
137     builders:
138       - description-setter:
139           description: $DEPLOY_SCENARIO
140       - 'download-artifact-macro'
141       - multijob:
142           name: "Offline Deployment on Baremetal using {deploy-scenario}"
143           condition: SUCCESSFUL
144           execution-type: PARALLEL
145           projects:
146             - name: 'kubernetes-release-{environment-type}-deploy-{distro}-baremetal-{stream}'
147               current-parameters: true
148               git-revision: true
149               node-parameters: true
150               kill-phase-on: FAILURE
151               abort-all-job: true
152       - multijob:
153           name: Functional Testing
154           condition: ALWAYS
155           projects:
156             - name: 'kubernetes-release-{environment-type}-functest-{distro}-baremetal-{stream}'
157               current-parameters: true
158               git-revision: false
159               node-parameters: true
160               kill-phase-on: FAILURE
161               abort-all-job: true
162       - multijob:
163           name: Platform Benchmarking
164           condition: ALWAYS
165           projects:
166             - name: 'kubernetes-release-{environment-type}-yardstick-{distro}-baremetal-{stream}'
167               current-parameters: true
168               git-revision: false
169               node-parameters: true
170               kill-phase-on: FAILURE
171               abort-all-job: true
172
173 - job-template:
174     name: 'kubernetes-release-{environment-type}-{phase}-{distro}-baremetal-{stream}'
175
176     disabled: '{obj:disabled}'
177
178     parameters:
179       - string:
180           name: EXECUTION_MODE
181           default: '{execution-mode}'
182           description: 'Execution mode'
183       - string:
184           name: TEST_REPO_URL
185           default: 'https://gerrit.nordix.org/infra/test.git'
186           description: 'URL to clone the test repo from'
187       - string:
188           name: TEST_FW
189           default: '{phase}'
190           description: 'Test framework to use'
191       - string:
192           name: TEST_SUITE
193           default: 'smoke'
194           description: 'Test suite to run'
195       - string:
196           name: YARDSTICK_DISPATCHER
197           default: 'file'
198           description: 'Dispatcher to use for Yardstick reporting'
199
200     properties:
201       - logrotate
202       - throttle:
203           max-per-node: 1
204           max-total: 1
205           option: project
206
207     wrappers:
208       - build-timeout:
209           timeout: '{build-timeout}'
210       - mask-passwords
211       - fix-workspace-permissions
212       - credentials-binding:
213           - file:
214               credential-id: '{openrc-credentials-file}'
215               variable: OPENRC_FILE
216
217     builders:
218       - description-setter:
219           description: $DEPLOY_SCENARIO
220       - '{phase}-macro'