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: 'engine-verify-deploy-test'
23 project: 'engine-verify-deploy-test'
32 execution-mode: online-deployment
39 execution-mode: offline-deployment
51 provisioner-type: 'bifrost'
53 gated-projects: 'infra/engine|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'
57 provisioner-type: 'heat'
58 slave-type: 'jumphost'
59 gated-projects: 'infra/engine|infra/provisioner/heat'
60 pdf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-environment-city-ubuntu1804.yaml"
61 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
68 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
70 dependency-jobs: 'engine-verify-package-{distro}-{stream}'
71 dependency-job-var: 'TRIGGER_engine_verify_package_{distro}_{stream}_BUILD_RESULT'
74 - 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
75 - 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
78 name: 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
80 project-type: multijob
82 disabled: '{obj:disabled}'
89 default: 'engine-{slave-type}-{environment-type}-{distro}-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_ENVIRONMENT_FILENAME
109 default: 'heat-environment-{cloud}-{distro}.yaml'
110 description: 'Name of heat-environment file to use.'
112 name: HEAT_STACK_NAME
113 default: "nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
114 description: 'Name of the created stack'
117 default: "keypair-nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
118 description: 'Name of the created keypair'
120 name: USE_PREBUILT_DEPLOYMENT_IMAGE
122 description: 'Use prebuilt deployment image while running as part of CI/CD'
125 default: 'https://gerrit.nordix.org/infra/test.git'
126 description: 'URL to clone the test repo from'
130 description: 'Test framework to use'
133 default: 'healthcheck'
134 description: 'Test suite to run'
136 name: YARDSTICK_DISPATCHER
138 description: 'Dispatcher to use for Yardstick reporting'
142 description: 'Delete the stack upon completion of the build'
146 description: 'Verbosity setting for the engine - true or false - default is false'
150 description: 'CI loop the job belongs to'
151 - project-parameters:
152 project: $GERRIT_PROJECT
154 description: 'The project and branch which the change is proposed for'
155 - nordix-gerrit-parameters
159 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
166 - engine-verify-deploy-test
170 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
171 branch: $GERRIT_BRANCH
172 refspec: $GERRIT_REFSPEC
178 server-name: 'Nordix Gerrit'
180 - patchset-created-event:
181 exclude-drafts: 'false'
182 exclude-trivial-rebase: 'false'
183 exclude-no-code-change: 'false'
184 - draft-published-event
185 - comment-added-contains-event:
186 comment-contains-value: 'recheck'
187 - comment-added-contains-event:
188 comment-contains-value: 'reverify'
190 - project-compare-type: 'REG_EXP'
191 project-pattern: '{gated-projects}'
193 - branch-compare-type: 'ANT'
194 branch-pattern: '**/{branch}'
195 disable-strict-forbidden-file-verification: 'true'
196 forbidden-file-paths:
198 pattern: 'docs/**|releasenotes/**'
200 successful: '{obj:successful}'
201 failed: '{obj:failed}'
202 unstable: '{obj:unstable}'
203 notbuilt: '{obj:notbuilt}'
204 custom-url: '* $JOB_NAME $BUILD_URL'
205 readable-message: 'true'
206 dependency-jobs: '{dependency-jobs}'
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 name: "{environment-type} deployment on {type} instances"
255 condition: SUCCESSFUL
256 execution-type: PARALLEL
258 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
259 current-parameters: true
261 node-parameters: true
262 kill-phase-on: FAILURE
264 property-file: $WORKSPACE/change.properties
266 name: "{environment-type} testing on {type} instances"
267 condition: SUCCESSFUL
268 execution-type: PARALLEL
270 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
271 current-parameters: true
273 node-parameters: true
274 kill-phase-on: FAILURE
276 property-file: $WORKSPACE/change.properties
289 - 'wait-pkg-mgr-macro'
290 - 'delete-stack-macro'
293 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
295 disabled: '{obj:disabled}'
308 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
309 branch: $GERRIT_BRANCH
310 refspec: $GERRIT_REFSPEC
317 - credentials-binding:
319 credential-id: '{openrc-credentials-file}'
320 variable: OPENRC_FILE
321 - username-password-separated:
322 credential-id: 'nordix-cicd-arm-credentials'
323 username: NORDIX_ARM_USERNAME
324 password: NORDIX_ARM_TOKEN
326 - fix-workspace-permissions
329 - 'generate-ssh-keypair-macro'
330 - 'wait-pkg-mgr-macro'
331 - 'download-artifact-macro'