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: 'kubernetes-verify-deploy-test'
23 project: 'kubernetes-verify-deploy-test'
25 # NOTE (fdegir): dot is not an allowed character in groovy var names and also for
26 # naming openstack objects so stream is used for that purpose but branch points to
27 # actual branch name on gerrit
31 deploy-scenario: 'k8-multus-plugins'
34 deploy-scenario: 'k8-multus-plugins'
37 deploy-scenario: 'k8-calico-nofeature'
40 deploy-scenario: 'k8-calico-nofeature'
45 execution-mode: online-deployment
52 execution-mode: offline-deployment
64 provisioner-type: 'bifrost'
66 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
67 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
68 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
70 provisioner-type: 'heat'
71 slave-type: 'jumphost'
72 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
73 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"
74 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
81 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
83 dependency-jobs: 'kubernetes-verify-package-{distro}-{stream}'
84 dependency-job-var: 'TRIGGER_kubernetes_verify_package_{distro}_{stream}_BUILD_RESULT'
87 - 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
88 - 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
91 name: 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
93 project-type: multijob
95 disabled: '{obj:disabled}'
101 name: DEPLOY_SCENARIO
102 default: '{deploy-scenario}'
103 description: 'Scenario to test change with. This depends on the branch of the stack'
107 description: 'Distribution to use for configuring target nodes (networking etc.)'
110 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
111 description: 'Slave label to schedule this job on.'
115 description: 'Hardware type - could be virtual, cloud, or baremetal'
118 default: '{execution-mode}'
119 description: 'Execution mode to run in'
123 description: 'PDF file to use for deployment'
127 description: 'IDF file to use for deployment'
129 name: HEAT_ENVIRONMENT_FILENAME
130 default: 'heat-environment-{cloud}-{distro}.yaml'
131 description: 'Name of heat-environment file to use.'
133 name: HEAT_STACK_NAME
134 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
135 description: 'Name of the created stack'
138 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
139 description: 'Name of the created keypair'
141 name: USE_PREBUILT_DEPLOYMENT_IMAGE
143 description: 'Use prebuilt deployment image while running as part of CI/CD'
146 default: 'https://gerrit.nordix.org/infra/test.git'
147 description: 'URL to clone the test repo from'
151 description: 'Test framework to use'
154 default: 'healthcheck'
155 description: 'Test suite to run'
157 name: YARDSTICK_DISPATCHER
159 description: 'Dispatcher to use for Yardstick reporting'
163 description: 'Delete the stack upon completion of the build'
167 description: 'Verbosity setting for the engine - true or false - default is false'
171 description: 'CI loop the job belongs to'
172 - project-parameters:
173 project: $GERRIT_PROJECT
175 description: 'The project and branch which the change is proposed for'
176 - nordix-gerrit-parameters
180 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
187 - engine-verify-deploy-test
191 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
192 branch: $GERRIT_BRANCH
193 refspec: $GERRIT_REFSPEC
199 server-name: 'Nordix Gerrit'
201 - patchset-created-event:
202 exclude-drafts: 'false'
203 exclude-trivial-rebase: 'false'
204 exclude-no-code-change: 'false'
205 - draft-published-event
206 - comment-added-contains-event:
207 comment-contains-value: 'recheck'
208 - comment-added-contains-event:
209 comment-contains-value: 'reverify'
211 - project-compare-type: 'REG_EXP'
212 project-pattern: '{gated-projects}'
214 - branch-compare-type: 'ANT'
215 branch-pattern: '**/{branch}'
216 disable-strict-forbidden-file-verification: 'true'
217 forbidden-file-paths:
219 pattern: 'docs/**|releasenotes/**'
221 successful: '{obj:successful}'
222 failed: '{obj:failed}'
223 unstable: '{obj:unstable}'
224 notbuilt: '{obj:notbuilt}'
225 custom-url: '* $JOB_NAME $BUILD_URL'
226 readable-message: 'true'
227 dependency-jobs: '{dependency-jobs}'
232 - credentials-binding:
234 credential-id: '{openrc-credentials-file}'
235 variable: OPENRC_FILE
236 - username-password-separated:
237 credential-id: 'nordix-cicd-arm-credentials'
238 username: NORDIX_ARM_USERNAME
239 password: NORDIX_ARM_TOKEN
248 def build = this.getProperty('binding').getVariable('build')
249 def listener = this.getProperty('binding').getVariable('listener')
250 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
251 println "WARN : Aborting build since dependent job did not succeed!"
252 throw new InterruptedException()
256 sudo chown -R $USER:$USER $WORKSPACE || exit 1
257 # offline nodes can not resolve Nordix Artifactory and Gerrit
258 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
259 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
260 sudo sed -i 's/^search/# search/' /etc/resolv.conf
261 sudo bash -c "cat << EOF >> /etc/hosts
263 91.106.198.25 artifactory.nordix.org
264 91.106.198.142 gerrit.nordix.org
265 86.107.242.50 fra1.citycloud.com
268 # we need to get rid of search domain as well
269 sudo sed -i 's/^search/# search/' /etc/resolv.conf
273 - 'generate-change-metadata-macro'
275 name: "{environment-type} deployment on {type} instances"
276 condition: SUCCESSFUL
277 execution-type: PARALLEL
279 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
280 current-parameters: true
282 node-parameters: true
283 kill-phase-on: FAILURE
285 property-file: $WORKSPACE/change.properties
287 name: "{environment-type} testing on {type} instances"
288 condition: SUCCESSFUL
289 execution-type: PARALLEL
291 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
292 current-parameters: true
294 node-parameters: true
295 kill-phase-on: FAILURE
297 property-file: $WORKSPACE/change.properties
310 - 'wait-pkg-mgr-macro'
311 - 'delete-stack-macro'
314 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
316 disabled: '{obj:disabled}'
329 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
330 branch: $GERRIT_BRANCH
331 refspec: $GERRIT_REFSPEC
338 - credentials-binding:
340 credential-id: '{openrc-credentials-file}'
341 variable: OPENRC_FILE
342 - username-password-separated:
343 credential-id: 'nordix-cicd-arm-credentials'
344 username: NORDIX_ARM_USERNAME
345 password: NORDIX_ARM_TOKEN
347 - fix-workspace-permissions
350 - 'generate-ssh-keypair-macro'
351 - 'wait-pkg-mgr-macro'
352 - 'download-artifact-macro'