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