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_ENVIRONMENT_FILENAME
115 default: 'heat-environment-{cloud}-{distro}.yaml'
116 description: 'Name of heat-environment file to use.'
118 name: HEAT_STACK_NAME
119 default: "nordix-cicd-verify-openstack-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
120 description: 'Name of the created stack'
123 default: "keypair-nordix-cicd-verify-openstack-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
124 description: 'Name of the created keypair'
126 name: USE_PREBUILT_DEPLOYMENT_IMAGE
128 description: 'Use prebuilt deployment image while running as part of CI/CD'
131 default: 'https://gerrit.nordix.org/infra/test.git'
132 description: 'URL to clone the test repo from'
136 description: 'Test framework to use'
139 default: 'healthcheck'
140 description: 'Test suite to run'
142 name: YARDSTICK_DISPATCHER
144 description: 'Dispatcher to use for Yardstick reporting'
148 description: 'Delete the stack upon completion of the build'
152 description: 'Verbosity setting for the engine - true or false - default is false'
156 description: 'CI loop the job belongs to'
157 - project-parameters:
158 project: $GERRIT_PROJECT
160 description: 'The project and branch which the change is proposed for'
161 - nordix-gerrit-parameters
165 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
172 - engine-verify-deploy-test
176 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
177 branch: $GERRIT_BRANCH
178 refspec: $GERRIT_REFSPEC
184 server-name: 'Nordix Gerrit'
186 - patchset-created-event:
187 exclude-drafts: 'false'
188 exclude-trivial-rebase: 'false'
189 exclude-no-code-change: 'false'
190 - draft-published-event
191 - comment-added-contains-event:
192 comment-contains-value: 'recheck'
193 - comment-added-contains-event:
194 comment-contains-value: 'reverify'
196 - project-compare-type: 'REG_EXP'
197 project-pattern: '{gated-projects}'
199 - branch-compare-type: 'ANT'
200 branch-pattern: '**/{branch}'
201 disable-strict-forbidden-file-verification: 'true'
202 forbidden-file-paths:
204 pattern: 'docs/**|releasenotes/**'
206 successful: '{obj:successful}'
207 failed: '{obj:failed}'
208 unstable: '{obj:unstable}'
209 notbuilt: '{obj:notbuilt}'
210 custom-url: '* $JOB_NAME $BUILD_URL'
211 readable-message: 'true'
212 dependency-jobs: '{dependency-jobs}'
217 - credentials-binding:
219 credential-id: '{openrc-credentials-file}'
220 variable: OPENRC_FILE
221 - username-password-separated:
222 credential-id: 'nordix-cicd-arm-credentials'
223 username: NORDIX_ARM_USERNAME
224 password: NORDIX_ARM_TOKEN
233 def build = this.getProperty('binding').getVariable('build')
234 def listener = this.getProperty('binding').getVariable('listener')
235 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
236 println "WARN : Aborting build since dependent job did not succeed!"
237 throw new InterruptedException()
241 sudo chown -R $USER:$USER $WORKSPACE || exit 1
242 # offline nodes can not resolve Nordix Artifactory and Gerrit
243 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
244 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
245 sudo sed -i 's/^search/# search/' /etc/resolv.conf
246 sudo bash -c "cat << EOF >> /etc/hosts
248 91.106.198.25 artifactory.nordix.org
249 91.106.198.142 gerrit.nordix.org
250 86.107.242.50 fra1.citycloud.com
253 # we need to get rid of search domain as well
254 sudo sed -i 's/^search/# search/' /etc/resolv.conf
258 - 'generate-change-metadata-macro'
260 name: "{environment-type} deployment on {type} instances"
261 condition: SUCCESSFUL
262 execution-type: PARALLEL
264 - name: 'openstack-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
265 current-parameters: true
267 node-parameters: true
268 kill-phase-on: FAILURE
270 property-file: $WORKSPACE/change.properties
272 name: "{environment-type} testing on {type} instances"
273 condition: SUCCESSFUL
274 execution-type: PARALLEL
276 - name: 'openstack-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
277 current-parameters: true
279 node-parameters: true
280 kill-phase-on: FAILURE
282 property-file: $WORKSPACE/change.properties
295 - 'wait-pkg-mgr-macro'
296 - 'delete-stack-macro'
299 name: 'openstack-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
301 disabled: '{obj:disabled}'
314 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
315 branch: $GERRIT_BRANCH
316 refspec: $GERRIT_REFSPEC
323 - credentials-binding:
325 credential-id: '{openrc-credentials-file}'
326 variable: OPENRC_FILE
327 - username-password-separated:
328 credential-id: 'nordix-cicd-arm-credentials'
329 username: NORDIX_ARM_USERNAME
330 password: NORDIX_ARM_TOKEN
332 - fix-workspace-permissions
335 - 'generate-ssh-keypair-macro'
336 - 'wait-pkg-mgr-macro'
337 - 'download-artifact-macro'