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: 'ironic-verify-provision'
23 project: 'ironic-verify-provision'
28 deploy-scenario: 'k8-multus-plugins'
33 execution-mode: online-deployment
40 execution-mode: offline-deployment
51 provisioner-type: 'bifrost'
53 gated-projects: 'infra/stack/ironic|infra/provisioner/bifrost'
54 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
55 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
63 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
65 dependency-jobs: 'ironic-verify-package-{distro}-{stream}'
66 dependency-job-var: 'TRIGGER_ironic_verify_package_{distro}_{stream}_BUILD_RESULT'
69 - 'ironic-verify-{environment-type}-provision-{distro}-{cloud}-{type}-{stream}'
72 name: 'ironic-verify-{environment-type}-provision-{distro}-{cloud}-{type}-{stream}'
74 disabled: '{obj:disabled}'
81 default: '{deploy-scenario}'
82 description: 'Scenario to test change with. This depends on the branch of the stack'
86 description: 'Distribution to use for configuring target nodes (networking etc.)'
89 default: 'engine-{slave-type}-{environment-type}-ubuntu1804-fra'
90 description: 'Slave label to schedule this job on.'
94 description: 'Hardware type - could be virtual, cloud, or baremetal'
97 default: '{execution-mode}'
98 description: 'Execution mode to run in'
102 description: 'PDF file to use for deployment'
106 description: 'IDF file to use for deployment'
108 name: HEAT_STACK_NAME
109 default: "nordix-cicd-verify-ironic-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
110 description: 'Name of the created stack'
113 default: "keypair-nordix-cicd-verify-ironic-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
114 description: 'Name of the created keypair'
116 name: USE_PREBUILT_DEPLOYMENT_IMAGE
118 description: 'Use prebuilt deployment image while running as part of CI/CD'
121 default: 'https://gerrit.nordix.org/infra/test.git'
122 description: 'URL to clone the test repo from'
126 description: 'Test framework to use'
129 default: 'healthcheck'
130 description: 'Test suite to run'
132 name: YARDSTICK_DISPATCHER
134 description: 'Dispatcher to use for Yardstick reporting'
138 description: 'Delete the stack upon completion of the build'
142 description: 'Verbosity setting for the engine - true or false - default is false'
146 description: 'CI loop the job belongs to'
147 - project-parameters:
148 project: $GERRIT_PROJECT
150 description: 'The project and branch which the change is proposed for'
151 - nordix-gerrit-parameters
155 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
162 - engine-verify-deploy-test
166 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
167 branch: $GERRIT_BRANCH
168 refspec: $GERRIT_REFSPEC
174 server-name: 'Nordix Gerrit'
176 - patchset-created-event:
177 exclude-drafts: 'false'
178 exclude-trivial-rebase: 'false'
179 exclude-no-code-change: 'false'
180 - draft-published-event
181 - comment-added-contains-event:
182 comment-contains-value: 'recheck'
183 - comment-added-contains-event:
184 comment-contains-value: 'reverify'
186 - project-compare-type: 'REG_EXP'
187 project-pattern: '{gated-projects}'
189 - branch-compare-type: 'ANT'
190 branch-pattern: '**/{branch}'
191 disable-strict-forbidden-file-verification: 'true'
192 forbidden-file-paths:
194 pattern: 'docs/**|releasenotes/**'
196 successful: '{obj:successful}'
197 failed: '{obj:failed}'
198 unstable: '{obj:unstable}'
199 notbuilt: '{obj:notbuilt}'
200 custom-url: '* $JOB_NAME $BUILD_URL'
201 readable-message: 'true'
202 dependency-jobs: '{dependency-jobs}'
205 - fix-workspace-permissions
208 - credentials-binding:
210 credential-id: '{openrc-credentials-file}'
211 variable: OPENRC_FILE
212 - username-password-separated:
213 credential-id: 'nordix-cicd-arm-credentials'
214 username: NORDIX_ARM_USERNAME
215 password: NORDIX_ARM_TOKEN
224 def build = this.getProperty('binding').getVariable('build')
225 def listener = this.getProperty('binding').getVariable('listener')
226 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
227 println "WARN : Aborting build since dependent job did not succeed!"
228 throw new InterruptedException()
232 sudo chown -R $USER:$USER $WORKSPACE || exit 1
233 # offline nodes can not resolve Nordix Artifactory and Gerrit
234 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
235 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
236 sudo sed -i 's/^search/# search/' /etc/resolv.conf
237 sudo bash -c "cat << EOF >> /etc/hosts
239 91.106.198.25 artifactory.nordix.org
240 91.106.198.142 gerrit.nordix.org
241 86.107.242.50 fra1.citycloud.com
244 # we need to get rid of search domain as well
245 sudo sed -i 's/^search/# search/' /etc/resolv.conf
249 - 'generate-change-metadata-macro'
251 properties-file: "$WORKSPACE/change.properties"
252 - 'generate-ssh-keypair-macro'
253 - 'download-deploy-artifact-macro'
254 - 'wait-pkg-mgr-macro'
268 - 'wait-pkg-mgr-macro'
269 - 'delete-stack-macro'