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