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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
21 name: 'openstack-verify-deploy-test'
23 project: 'openstack-verify-deploy-test'
28 deploy-scenario: 'os-nosdn-nofeature'
31 deploy-scenario: 'os-nosdn-nofeature'
36 execution-mode: online-deployment
43 execution-mode: offline-deployment
55 provisioner-type: 'bifrost'
57 gated-projects: 'infra/stack/openstack|infra/installer/kolla'
58 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
59 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
66 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
68 dependency-jobs: 'openstack-verify-package-{distro}-{stream}'
69 dependency-job-var: 'TRIGGER_openstack_verify_package_{distro}_{stream}_BUILD_RESULT'
72 - 'openstack-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
73 - 'openstack-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
76 name: 'openstack-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
78 project-type: multijob
80 disabled: '{obj:disabled}'
87 default: '{deploy-scenario}'
88 description: 'Scenario to test change with.'
92 description: 'Distribution to use for configuring target nodes (networking etc.)'
95 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
96 description: 'Slave label to schedule this job on.'
100 description: 'Hardware type - could be virtual, cloud, or baremetal'
103 default: '{execution-mode}'
104 description: 'Execution mode to run in'
108 description: 'PDF file to use for deployment'
112 description: 'IDF file to use for deployment'
114 name: HEAT_STACK_NAME
115 default: "nordix-cicd-verify-openstack-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
116 description: 'Name of the created stack'
119 default: "keypair-nordix-cicd-verify-openstack-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
120 description: 'Name of the created keypair'
122 name: USE_PREBUILT_DEPLOYMENT_IMAGE
124 description: 'Use prebuilt deployment image while running as part of CI/CD'
127 default: 'https://gerrit.nordix.org/infra/test.git'
128 description: 'URL to clone the test repo from'
132 description: 'Test framework to use'
135 default: 'healthcheck'
136 description: 'Test suite to run'
138 name: YARDSTICK_DISPATCHER
140 description: 'Dispatcher to use for Yardstick reporting'
144 description: 'Delete the stack upon completion of the build'
148 description: 'Verbosity setting for the engine - true or false - default is false'
152 description: 'CI loop the job belongs to'
153 - project-parameters:
154 project: $GERRIT_PROJECT
156 description: 'The project and branch which the change is proposed for'
157 - nordix-gerrit-parameters
161 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
168 - engine-verify-deploy-test
172 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
173 branch: $GERRIT_BRANCH
174 refspec: $GERRIT_REFSPEC
180 server-name: 'Nordix Gerrit'
182 - patchset-created-event:
183 exclude-drafts: 'false'
184 exclude-trivial-rebase: 'false'
185 exclude-no-code-change: 'false'
186 - draft-published-event
187 - comment-added-contains-event:
188 comment-contains-value: 'recheck'
189 - comment-added-contains-event:
190 comment-contains-value: 'reverify'
192 - project-compare-type: 'REG_EXP'
193 project-pattern: '{gated-projects}'
195 - branch-compare-type: 'ANT'
196 branch-pattern: '**/{branch}'
197 disable-strict-forbidden-file-verification: 'true'
198 forbidden-file-paths:
200 pattern: 'docs/**|releasenotes/**'
202 successful: '{obj:successful}'
203 failed: '{obj:failed}'
204 unstable: '{obj:unstable}'
205 notbuilt: '{obj:notbuilt}'
206 custom-url: '* $JOB_NAME $BUILD_URL'
207 readable-message: 'true'
208 dependency-jobs: '{dependency-jobs}'
213 - credentials-binding:
215 credential-id: '{openrc-credentials-file}'
216 variable: OPENRC_FILE
217 - username-password-separated:
218 credential-id: 'nordix-cicd-arm-credentials'
219 username: NORDIX_ARM_USERNAME
220 password: NORDIX_ARM_TOKEN
229 def build = this.getProperty('binding').getVariable('build')
230 def listener = this.getProperty('binding').getVariable('listener')
231 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
232 println "WARN : Aborting build since dependent job did not succeed!"
233 throw new InterruptedException()
237 sudo chown -R $USER:$USER $WORKSPACE || exit 1
238 # offline nodes can not resolve Nordix Artifactory and Gerrit
239 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
240 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
241 sudo sed -i 's/^search/# search/' /etc/resolv.conf
242 sudo bash -c "cat << EOF >> /etc/hosts
244 91.106.198.25 artifactory.nordix.org
245 91.106.198.142 gerrit.nordix.org
246 86.107.242.50 fra1.citycloud.com
249 # we need to get rid of search domain as well
250 sudo sed -i 's/^search/# search/' /etc/resolv.conf
254 - 'generate-change-metadata-macro'
256 name: "{environment-type} deployment on {type} instances"
257 condition: SUCCESSFUL
258 execution-type: PARALLEL
260 - name: 'openstack-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
261 current-parameters: true
263 node-parameters: true
264 kill-phase-on: FAILURE
266 property-file: $WORKSPACE/change.properties
268 name: "{environment-type} testing on {type} instances"
269 condition: SUCCESSFUL
270 execution-type: PARALLEL
272 - name: 'openstack-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
273 current-parameters: true
275 node-parameters: true
276 kill-phase-on: FAILURE
278 property-file: $WORKSPACE/change.properties
291 - 'wait-pkg-mgr-macro'
292 - 'delete-stack-macro'
295 name: 'openstack-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
297 disabled: '{obj:disabled}'
310 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
311 branch: $GERRIT_BRANCH
312 refspec: $GERRIT_REFSPEC
319 - credentials-binding:
321 credential-id: '{openrc-credentials-file}'
322 variable: OPENRC_FILE
323 - username-password-separated:
324 credential-id: 'nordix-cicd-arm-credentials'
325 username: NORDIX_ARM_USERNAME
326 password: NORDIX_ARM_TOKEN
328 - fix-workspace-permissions
331 - 'generate-ssh-keypair-macro'
332 - 'wait-pkg-mgr-macro'
333 - 'download-artifact-macro'