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'
62 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
64 dependency-jobs: 'ironic-verify-package-{distro}-{stream}'
65 dependency-job-var: 'TRIGGER_ironic_verify_package_{distro}_{stream}_BUILD_RESULT'
68 - 'ironic-verify-{environment-type}-provision-{distro}-{cloud}-{type}-{stream}'
71 name: 'ironic-verify-{environment-type}-provision-{distro}-{cloud}-{type}-{stream}'
73 disabled: '{obj:disabled}'
80 default: '{deploy-scenario}'
81 description: 'Scenario to test change with. This depends on the branch of the stack'
85 description: 'Distribution to use for configuring target nodes (networking etc.)'
88 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
89 description: 'Slave label to schedule this job on.'
93 description: 'Hardware type - could be virtual, cloud, or baremetal'
96 default: '{execution-mode}'
97 description: 'Execution mode to run in'
101 description: 'PDF file to use for deployment'
105 description: 'IDF file to use for deployment'
107 name: HEAT_ENVIRONMENT_FILENAME
108 default: 'heat-environment-{cloud}-{distro}.yaml'
109 description: 'Name of heat-environment file to use.'
111 name: HEAT_STACK_NAME
112 default: "nordix-cicd-verify-ironic-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
113 description: 'Name of the created stack'
116 default: "keypair-nordix-cicd-verify-ironic-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
117 description: 'Name of the created keypair'
119 name: USE_PREBUILT_DEPLOYMENT_IMAGE
121 description: 'Use prebuilt deployment image while running as part of CI/CD'
124 default: 'https://gerrit.nordix.org/infra/test.git'
125 description: 'URL to clone the test repo from'
129 description: 'Test framework to use'
132 default: 'healthcheck'
133 description: 'Test suite to run'
135 name: YARDSTICK_DISPATCHER
137 description: 'Dispatcher to use for Yardstick reporting'
141 description: 'Delete the stack upon completion of the build'
145 description: 'Verbosity setting for the engine - true or false - default is false'
149 description: 'CI loop the job belongs to'
150 - project-parameters:
151 project: $GERRIT_PROJECT
153 description: 'The project and branch which the change is proposed for'
154 - nordix-gerrit-parameters
158 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
165 - engine-verify-deploy-test
169 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
170 branch: $GERRIT_BRANCH
171 refspec: $GERRIT_REFSPEC
177 server-name: 'Nordix Gerrit'
179 - patchset-created-event:
180 exclude-drafts: 'false'
181 exclude-trivial-rebase: 'false'
182 exclude-no-code-change: 'false'
183 - draft-published-event
184 - comment-added-contains-event:
185 comment-contains-value: 'recheck'
186 - comment-added-contains-event:
187 comment-contains-value: 'reverify'
189 - project-compare-type: 'REG_EXP'
190 project-pattern: '{gated-projects}'
192 - branch-compare-type: 'ANT'
193 branch-pattern: '**/{branch}'
194 disable-strict-forbidden-file-verification: 'true'
195 forbidden-file-paths:
197 pattern: 'docs/**|releasenotes/**'
199 successful: '{obj:successful}'
200 failed: '{obj:failed}'
201 unstable: '{obj:unstable}'
202 notbuilt: '{obj:notbuilt}'
203 custom-url: '* $JOB_NAME $BUILD_URL'
204 readable-message: 'true'
205 dependency-jobs: '{dependency-jobs}'
208 - fix-workspace-permissions
211 - credentials-binding:
213 credential-id: '{openrc-credentials-file}'
214 variable: OPENRC_FILE
215 - username-password-separated:
216 credential-id: 'nordix-cicd-arm-credentials'
217 username: NORDIX_ARM_USERNAME
218 password: NORDIX_ARM_TOKEN
227 def build = this.getProperty('binding').getVariable('build')
228 def listener = this.getProperty('binding').getVariable('listener')
229 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
230 println "WARN : Aborting build since dependent job did not succeed!"
231 throw new InterruptedException()
235 sudo chown -R $USER:$USER $WORKSPACE || exit 1
236 # offline nodes can not resolve Nordix Artifactory and Gerrit
237 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
238 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
239 sudo sed -i 's/^search/# search/' /etc/resolv.conf
240 sudo bash -c "cat << EOF >> /etc/hosts
242 91.106.198.25 artifactory.nordix.org
243 91.106.198.142 gerrit.nordix.org
244 86.107.242.50 fra1.citycloud.com
247 # we need to get rid of search domain as well
248 sudo sed -i 's/^search/# search/' /etc/resolv.conf
252 - 'generate-change-metadata-macro'
254 properties-file: "$WORKSPACE/change.properties"
255 - 'generate-ssh-keypair-macro'
256 - 'download-artifact-macro'
257 - 'wait-pkg-mgr-macro'
271 - 'wait-pkg-mgr-macro'
272 - 'delete-stack-macro'