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