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-ci-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_STACK_NAME
130 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
131 description: 'Name of the created stack'
134 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
135 description: 'Name of the created keypair'
137 name: USE_PREBUILT_DEPLOYMENT_IMAGE
139 description: 'Use prebuilt deployment image while running as part of CI/CD'
142 default: 'https://gerrit.nordix.org/infra/test.git'
143 description: 'URL to clone the test repo from'
147 description: 'Test framework to use'
150 default: 'healthcheck'
151 description: 'Test suite to run'
153 name: YARDSTICK_DISPATCHER
155 description: 'Dispatcher to use for Yardstick reporting'
159 description: 'Delete the stack upon completion of the build'
163 description: 'Verbosity setting for the engine - true or false - default is false'
167 description: 'CI loop the job belongs to'
168 - project-parameters:
169 project: $GERRIT_PROJECT
171 description: 'The project and branch which the change is proposed for'
172 - nordix-gerrit-parameters
176 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
183 - engine-verify-deploy-test
187 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
188 branch: $GERRIT_BRANCH
189 refspec: $GERRIT_REFSPEC
195 server-name: 'Nordix Gerrit'
197 - patchset-created-event:
198 exclude-drafts: 'false'
199 exclude-trivial-rebase: 'false'
200 exclude-no-code-change: 'false'
201 - draft-published-event
202 - comment-added-contains-event:
203 comment-contains-value: 'recheck'
204 - comment-added-contains-event:
205 comment-contains-value: 'reverify'
207 - project-compare-type: 'REG_EXP'
208 project-pattern: '{gated-projects}'
210 - branch-compare-type: 'ANT'
211 branch-pattern: '**/{branch}'
212 disable-strict-forbidden-file-verification: 'true'
213 forbidden-file-paths:
215 pattern: 'docs/**|releasenotes/**'
217 successful: '{obj:successful}'
218 failed: '{obj:failed}'
219 unstable: '{obj:unstable}'
220 notbuilt: '{obj:notbuilt}'
221 custom-url: '* $JOB_NAME $BUILD_URL'
222 readable-message: 'true'
223 dependency-jobs: '{dependency-jobs}'
228 - credentials-binding:
230 credential-id: '{openrc-credentials-file}'
231 variable: OPENRC_FILE
232 - username-password-separated:
233 credential-id: 'nordix-cicd-arm-credentials'
234 username: NORDIX_ARM_USERNAME
235 password: NORDIX_ARM_TOKEN
244 def build = this.getProperty('binding').getVariable('build')
245 def listener = this.getProperty('binding').getVariable('listener')
246 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
247 println "WARN : Aborting build since dependent job did not succeed!"
248 throw new InterruptedException()
252 sudo chown -R $USER:$USER $WORKSPACE || exit 1
253 # offline nodes can not resolve Nordix Artifactory and Gerrit
254 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
255 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
256 sudo sed -i 's/^search/# search/' /etc/resolv.conf
257 sudo bash -c "cat << EOF >> /etc/hosts
259 91.106.198.25 artifactory.nordix.org
260 91.106.198.142 gerrit.nordix.org
261 86.107.242.50 fra1.citycloud.com
264 # we need to get rid of search domain as well
265 sudo sed -i 's/^search/# search/' /etc/resolv.conf
269 - 'generate-change-metadata-macro'
271 name: "{environment-type} deployment on {type} instances"
272 condition: SUCCESSFUL
273 execution-type: PARALLEL
275 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
276 current-parameters: true
278 node-parameters: true
279 kill-phase-on: FAILURE
281 property-file: $WORKSPACE/change.properties
283 name: "{environment-type} testing on {type} instances"
284 condition: SUCCESSFUL
285 execution-type: PARALLEL
287 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
288 current-parameters: true
290 node-parameters: true
291 kill-phase-on: FAILURE
293 property-file: $WORKSPACE/change.properties
306 - 'wait-pkg-mgr-macro'
307 - 'delete-stack-macro'
310 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
312 disabled: '{obj:disabled}'
325 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
326 branch: $GERRIT_BRANCH
327 refspec: $GERRIT_REFSPEC
334 - credentials-binding:
336 credential-id: '{openrc-credentials-file}'
337 variable: OPENRC_FILE
338 - username-password-separated:
339 credential-id: 'nordix-cicd-arm-credentials'
340 username: NORDIX_ARM_USERNAME
341 password: NORDIX_ARM_TOKEN
343 - fix-workspace-permissions
346 - 'generate-ssh-keypair-macro'
347 - 'wait-pkg-mgr-macro'
348 - 'download-artifact-macro'