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-multus-plugins'
40 deploy-scenario: 'k8-calico-nofeature'
43 deploy-scenario: 'k8-calico-nofeature'
48 execution-mode: online-deployment
55 execution-mode: offline-deployment
67 provisioner-type: 'bifrost'
69 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
70 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
71 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
73 provisioner-type: 'heat'
74 slave-type: 'jumphost'
75 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
76 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"
77 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
84 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
86 dependency-jobs: 'kubernetes-verify-package-{distro}-{stream}'
87 dependency-job-var: 'TRIGGER_kubernetes_verify_package_{distro}_{stream}_BUILD_RESULT'
90 - 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
91 - 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
94 name: 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
96 project-type: multijob
98 disabled: '{obj:disabled}'
104 name: DEPLOY_SCENARIO
105 default: '{deploy-scenario}'
106 description: 'Scenario to test change with. This depends on the branch of the stack'
110 description: 'Distribution to use for configuring target nodes (networking etc.)'
113 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
114 description: 'Slave label to schedule this job on.'
118 description: 'Hardware type - could be virtual, cloud, or baremetal'
121 default: '{execution-mode}'
122 description: 'Execution mode to run in'
126 description: 'PDF file to use for deployment'
130 description: 'IDF file to use for deployment'
132 name: HEAT_STACK_NAME
133 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
134 description: 'Name of the created stack'
137 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
138 description: 'Name of the created keypair'
140 name: USE_PREBUILT_DEPLOYMENT_IMAGE
142 description: 'Use prebuilt deployment image while running as part of CI/CD'
145 default: 'https://gerrit.nordix.org/infra/test.git'
146 description: 'URL to clone the test repo from'
150 description: 'Test framework to use'
153 default: 'healthcheck'
154 description: 'Test suite to run'
156 name: YARDSTICK_DISPATCHER
158 description: 'Dispatcher to use for Yardstick reporting'
162 description: 'Delete the stack upon completion of the build'
166 description: 'Verbosity setting for the engine - true or false - default is false'
170 description: 'CI loop the job belongs to'
171 - project-parameters:
172 project: $GERRIT_PROJECT
174 description: 'The project and branch which the change is proposed for'
175 - nordix-gerrit-parameters
179 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
186 - engine-verify-deploy-test
190 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
191 branch: $GERRIT_BRANCH
192 refspec: $GERRIT_REFSPEC
198 server-name: 'Nordix Gerrit'
200 - patchset-created-event:
201 exclude-drafts: 'false'
202 exclude-trivial-rebase: 'false'
203 exclude-no-code-change: 'false'
204 - draft-published-event
205 - comment-added-contains-event:
206 comment-contains-value: 'recheck'
207 - comment-added-contains-event:
208 comment-contains-value: 'reverify'
210 - project-compare-type: 'REG_EXP'
211 project-pattern: '{gated-projects}'
213 - branch-compare-type: 'ANT'
214 branch-pattern: '**/{branch}'
215 disable-strict-forbidden-file-verification: 'true'
216 forbidden-file-paths:
218 pattern: 'docs/**|releasenotes/**'
220 successful: '{obj:successful}'
221 failed: '{obj:failed}'
222 unstable: '{obj:unstable}'
223 notbuilt: '{obj:notbuilt}'
224 custom-url: '* $JOB_NAME $BUILD_URL'
225 readable-message: 'true'
226 dependency-jobs: '{dependency-jobs}'
231 - credentials-binding:
233 credential-id: '{openrc-credentials-file}'
234 variable: OPENRC_FILE
235 - username-password-separated:
236 credential-id: 'nordix-cicd-arm-credentials'
237 username: NORDIX_ARM_USERNAME
238 password: NORDIX_ARM_TOKEN
247 def build = this.getProperty('binding').getVariable('build')
248 def listener = this.getProperty('binding').getVariable('listener')
249 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
250 println "WARN : Aborting build since dependent job did not succeed!"
251 throw new InterruptedException()
255 sudo chown -R $USER:$USER $WORKSPACE || exit 1
256 # offline nodes can not resolve Nordix Artifactory and Gerrit
257 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
258 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
259 sudo sed -i 's/^search/# search/' /etc/resolv.conf
260 sudo bash -c "cat << EOF >> /etc/hosts
262 91.106.198.25 artifactory.nordix.org
263 91.106.198.142 gerrit.nordix.org
264 86.107.242.50 fra1.citycloud.com
267 # we need to get rid of search domain as well
268 sudo sed -i 's/^search/# search/' /etc/resolv.conf
272 - 'generate-change-metadata-macro'
274 name: "{environment-type} deployment on {type} instances"
275 condition: SUCCESSFUL
276 execution-type: PARALLEL
278 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
279 current-parameters: true
281 node-parameters: true
282 kill-phase-on: FAILURE
284 property-file: $WORKSPACE/change.properties
286 name: "{environment-type} testing on {type} instances"
287 condition: SUCCESSFUL
288 execution-type: PARALLEL
290 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
291 current-parameters: true
293 node-parameters: true
294 kill-phase-on: FAILURE
296 property-file: $WORKSPACE/change.properties
309 - 'wait-pkg-mgr-macro'
310 - 'delete-stack-macro'
313 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
315 disabled: '{obj:disabled}'
328 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
329 branch: $GERRIT_BRANCH
330 refspec: $GERRIT_REFSPEC
337 - credentials-binding:
339 credential-id: '{openrc-credentials-file}'
340 variable: OPENRC_FILE
341 - username-password-separated:
342 credential-id: 'nordix-cicd-arm-credentials'
343 username: NORDIX_ARM_USERNAME
344 password: NORDIX_ARM_TOKEN
346 - fix-workspace-permissions
349 - 'generate-ssh-keypair-macro'
350 - 'wait-pkg-mgr-macro'
351 - 'download-artifact-macro'