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'
28 deploy-scenario: 'k8-multus-plugins'
33 execution-mode: online-deployment
40 execution-mode: offline-deployment
52 provisioner-type: 'bifrost'
54 gated-projects: 'infra/engine|infra/provisioner/bifrost'
55 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
56 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
58 provisioner-type: 'heat'
59 slave-type: 'jumphost'
60 gated-projects: 'infra/engine|infra/provisioner/heat'
61 pdf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-environment-ci-city-ubuntu1804.yaml"
62 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
69 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
71 dependency-jobs: 'engine-verify-package-{distro}-{stream}'
72 dependency-job-var: 'TRIGGER_engine_verify_package_{distro}_{stream}_BUILD_RESULT'
75 - 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
76 - 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
79 name: 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
81 project-type: multijob
83 disabled: '{obj:disabled}'
90 default: '{deploy-scenario}'
91 description: 'Scenario to test change with.'
95 description: 'Distribution to use for configuring target nodes (networking etc.)'
98 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
99 description: 'Slave label to schedule this job on.'
103 description: 'Hardware type - could be virtual, cloud, or baremetal'
106 default: '{execution-mode}'
107 description: 'Execution mode to run in'
111 description: 'PDF file to use for deployment'
115 description: 'IDF file to use for deployment'
117 name: HEAT_STACK_NAME
118 default: "nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
119 description: 'Name of the created stack'
122 default: "keypair-nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
123 description: 'Name of the created keypair'
125 name: USE_PREBUILT_DEPLOYMENT_IMAGE
127 description: 'Use prebuilt deployment image while running as part of CI/CD'
130 default: 'https://gerrit.nordix.org/infra/test.git'
131 description: 'URL to clone the test repo from'
135 description: 'Test framework to use'
138 default: 'healthcheck'
139 description: 'Test suite to run'
141 name: YARDSTICK_DISPATCHER
143 description: 'Dispatcher to use for Yardstick reporting'
147 description: 'Delete the stack upon completion of the build'
151 description: 'Verbosity setting for the engine - true or false - default is false'
155 description: 'CI loop the job belongs to'
156 - project-parameters:
157 project: $GERRIT_PROJECT
159 description: 'The project and branch which the change is proposed for'
160 - nordix-gerrit-parameters
164 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
171 - engine-verify-deploy-test
175 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
176 branch: $GERRIT_BRANCH
177 refspec: $GERRIT_REFSPEC
183 server-name: 'Nordix Gerrit'
185 - patchset-created-event:
186 exclude-drafts: 'false'
187 exclude-trivial-rebase: 'false'
188 exclude-no-code-change: 'false'
189 - draft-published-event
190 - comment-added-contains-event:
191 comment-contains-value: 'recheck'
192 - comment-added-contains-event:
193 comment-contains-value: 'reverify'
195 - project-compare-type: 'REG_EXP'
196 project-pattern: '{gated-projects}'
198 - branch-compare-type: 'ANT'
199 branch-pattern: '**/{branch}'
200 disable-strict-forbidden-file-verification: 'true'
201 forbidden-file-paths:
203 pattern: 'docs/**|releasenotes/**'
205 successful: '{obj:successful}'
206 failed: '{obj:failed}'
207 unstable: '{obj:unstable}'
208 notbuilt: '{obj:notbuilt}'
209 custom-url: '* $JOB_NAME $BUILD_URL'
210 readable-message: 'true'
211 dependency-jobs: '{dependency-jobs}'
216 - credentials-binding:
218 credential-id: '{openrc-credentials-file}'
219 variable: OPENRC_FILE
220 - username-password-separated:
221 credential-id: 'nordix-cicd-arm-credentials'
222 username: NORDIX_ARM_USERNAME
223 password: NORDIX_ARM_TOKEN
232 def build = this.getProperty('binding').getVariable('build')
233 def listener = this.getProperty('binding').getVariable('listener')
234 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
235 println "WARN : Aborting build since dependent job did not succeed!"
236 throw new InterruptedException()
240 sudo chown -R $USER:$USER $WORKSPACE || exit 1
241 # offline nodes can not resolve Nordix Artifactory and Gerrit
242 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
243 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
244 sudo sed -i 's/^search/# search/' /etc/resolv.conf
245 sudo bash -c "cat << EOF >> /etc/hosts
247 91.106.198.25 artifactory.nordix.org
248 91.106.198.142 gerrit.nordix.org
249 86.107.242.50 fra1.citycloud.com
252 # we need to get rid of search domain as well
253 sudo sed -i 's/^search/# search/' /etc/resolv.conf
257 - 'generate-change-metadata-macro'
259 name: "{environment-type} deployment on {type} instances"
260 condition: SUCCESSFUL
261 execution-type: PARALLEL
263 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
264 current-parameters: true
266 node-parameters: true
267 kill-phase-on: FAILURE
269 property-file: $WORKSPACE/change.properties
271 name: "{environment-type} testing on {type} instances"
272 condition: SUCCESSFUL
273 execution-type: PARALLEL
275 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
276 current-parameters: true
278 node-parameters: true
279 kill-phase-on: FAILURE
281 property-file: $WORKSPACE/change.properties
294 - 'wait-pkg-mgr-macro'
295 - 'delete-stack-macro'
298 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
300 disabled: '{obj:disabled}'
313 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
314 branch: $GERRIT_BRANCH
315 refspec: $GERRIT_REFSPEC
322 - credentials-binding:
324 credential-id: '{openrc-credentials-file}'
325 variable: OPENRC_FILE
326 - username-password-separated:
327 credential-id: 'nordix-cicd-arm-credentials'
328 username: NORDIX_ARM_USERNAME
329 password: NORDIX_ARM_TOKEN
331 - fix-workspace-permissions
334 - 'generate-ssh-keypair-macro'
335 - 'wait-pkg-mgr-macro'
336 - 'download-artifact-macro'