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