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-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_ENVIRONMENT_FILENAME
118 default: 'heat-environment-{cloud}-{distro}.yaml'
119 description: 'Name of heat-environment file to use.'
121 name: HEAT_STACK_NAME
122 default: "nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
123 description: 'Name of the created stack'
126 default: "keypair-nordix-cicd-verify-engine-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
127 description: 'Name of the created keypair'
129 name: USE_PREBUILT_DEPLOYMENT_IMAGE
131 description: 'Use prebuilt deployment image while running as part of CI/CD'
134 default: 'https://gerrit.nordix.org/infra/test.git'
135 description: 'URL to clone the test repo from'
139 description: 'Test framework to use'
142 default: 'healthcheck'
143 description: 'Test suite to run'
145 name: YARDSTICK_DISPATCHER
147 description: 'Dispatcher to use for Yardstick reporting'
151 description: 'Delete the stack upon completion of the build'
155 description: 'Verbosity setting for the engine - true or false - default is false'
159 description: 'CI loop the job belongs to'
160 - project-parameters:
161 project: $GERRIT_PROJECT
163 description: 'The project and branch which the change is proposed for'
164 - nordix-gerrit-parameters
168 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
175 - engine-verify-deploy-test
179 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
180 branch: $GERRIT_BRANCH
181 refspec: $GERRIT_REFSPEC
187 server-name: 'Nordix Gerrit'
189 - patchset-created-event:
190 exclude-drafts: 'false'
191 exclude-trivial-rebase: 'false'
192 exclude-no-code-change: 'false'
193 - draft-published-event
194 - comment-added-contains-event:
195 comment-contains-value: 'recheck'
196 - comment-added-contains-event:
197 comment-contains-value: 'reverify'
199 - project-compare-type: 'REG_EXP'
200 project-pattern: '{gated-projects}'
202 - branch-compare-type: 'ANT'
203 branch-pattern: '**/{branch}'
204 disable-strict-forbidden-file-verification: 'true'
205 forbidden-file-paths:
207 pattern: 'docs/**|releasenotes/**'
209 successful: '{obj:successful}'
210 failed: '{obj:failed}'
211 unstable: '{obj:unstable}'
212 notbuilt: '{obj:notbuilt}'
213 custom-url: '* $JOB_NAME $BUILD_URL'
214 readable-message: 'true'
215 dependency-jobs: '{dependency-jobs}'
220 - credentials-binding:
222 credential-id: '{openrc-credentials-file}'
223 variable: OPENRC_FILE
224 - username-password-separated:
225 credential-id: 'nordix-cicd-arm-credentials'
226 username: NORDIX_ARM_USERNAME
227 password: NORDIX_ARM_TOKEN
236 def build = this.getProperty('binding').getVariable('build')
237 def listener = this.getProperty('binding').getVariable('listener')
238 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
239 println "WARN : Aborting build since dependent job did not succeed!"
240 throw new InterruptedException()
244 sudo chown -R $USER:$USER $WORKSPACE || exit 1
245 # offline nodes can not resolve Nordix Artifactory and Gerrit
246 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
247 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
248 sudo sed -i 's/^search/# search/' /etc/resolv.conf
249 sudo bash -c "cat << EOF >> /etc/hosts
251 91.106.198.25 artifactory.nordix.org
252 91.106.198.142 gerrit.nordix.org
253 86.107.242.50 fra1.citycloud.com
256 # we need to get rid of search domain as well
257 sudo sed -i 's/^search/# search/' /etc/resolv.conf
261 - 'generate-change-metadata-macro'
263 name: "{environment-type} deployment on {type} instances"
264 condition: SUCCESSFUL
265 execution-type: PARALLEL
267 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
268 current-parameters: true
270 node-parameters: true
271 kill-phase-on: FAILURE
273 property-file: $WORKSPACE/change.properties
275 name: "{environment-type} testing on {type} instances"
276 condition: SUCCESSFUL
277 execution-type: PARALLEL
279 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
280 current-parameters: true
282 node-parameters: true
283 kill-phase-on: FAILURE
285 property-file: $WORKSPACE/change.properties
298 - 'wait-pkg-mgr-macro'
299 - 'delete-stack-macro'
302 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
304 disabled: '{obj:disabled}'
317 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
318 branch: $GERRIT_BRANCH
319 refspec: $GERRIT_REFSPEC
326 - credentials-binding:
328 credential-id: '{openrc-credentials-file}'
329 variable: OPENRC_FILE
330 - username-password-separated:
331 credential-id: 'nordix-cicd-arm-credentials'
332 username: NORDIX_ARM_USERNAME
333 password: NORDIX_ARM_TOKEN
335 - fix-workspace-permissions
338 - 'generate-ssh-keypair-macro'
339 - 'wait-pkg-mgr-macro'
340 - 'download-artifact-macro'