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'
174 description: 'Whether to deploy csi-cephfs storageclass.'
175 - project-parameters:
176 project: $GERRIT_PROJECT
178 description: 'The project and branch which the change is proposed for'
179 - nordix-gerrit-parameters
183 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
190 - engine-verify-deploy-test
194 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
195 branch: $GERRIT_BRANCH
196 refspec: $GERRIT_REFSPEC
202 server-name: 'Nordix Gerrit'
204 - patchset-created-event:
205 exclude-drafts: 'false'
206 exclude-trivial-rebase: 'false'
207 exclude-no-code-change: 'false'
208 - draft-published-event
209 - comment-added-contains-event:
210 comment-contains-value: 'recheck'
211 - comment-added-contains-event:
212 comment-contains-value: 'reverify'
214 - project-compare-type: 'REG_EXP'
215 project-pattern: '{gated-projects}'
217 - branch-compare-type: 'ANT'
218 branch-pattern: '**/{branch}'
219 disable-strict-forbidden-file-verification: 'true'
220 forbidden-file-paths:
222 pattern: 'docs/**|releasenotes/**'
224 successful: '{obj:successful}'
225 failed: '{obj:failed}'
226 unstable: '{obj:unstable}'
227 notbuilt: '{obj:notbuilt}'
228 custom-url: '* $JOB_NAME $BUILD_URL'
229 readable-message: 'true'
230 dependency-jobs: '{dependency-jobs}'
235 - credentials-binding:
237 credential-id: '{openrc-credentials-file}'
238 variable: OPENRC_FILE
239 - username-password-separated:
240 credential-id: 'nordix-cicd-arm-credentials'
241 username: NORDIX_ARM_USERNAME
242 password: NORDIX_ARM_TOKEN
251 def build = this.getProperty('binding').getVariable('build')
252 def listener = this.getProperty('binding').getVariable('listener')
253 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
254 println "WARN : Aborting build since dependent job did not succeed!"
255 throw new InterruptedException()
259 sudo chown -R $USER:$USER $WORKSPACE || exit 1
260 # offline nodes can not resolve Nordix Artifactory and Gerrit
261 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
262 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
263 sudo sed -i 's/^search/# search/' /etc/resolv.conf
264 sudo bash -c "cat << EOF >> /etc/hosts
266 91.106.198.25 artifactory.nordix.org
267 91.106.198.142 gerrit.nordix.org
268 86.107.242.50 fra1.citycloud.com
271 # we need to get rid of search domain as well
272 sudo sed -i 's/^search/# search/' /etc/resolv.conf
274 - ssh-agent-credentials:
276 - 'nordixinfra-nordix-gerrit-ssh'
279 - 'generate-change-metadata-macro'
281 name: "{environment-type} deployment on {type} instances"
282 condition: SUCCESSFUL
283 execution-type: PARALLEL
285 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
286 current-parameters: true
288 node-parameters: true
289 kill-phase-on: FAILURE
291 property-file: $WORKSPACE/change.properties
293 name: "{environment-type} testing on {type} instances"
294 condition: SUCCESSFUL
295 execution-type: PARALLEL
297 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
298 current-parameters: true
300 node-parameters: true
301 kill-phase-on: FAILURE
303 property-file: $WORKSPACE/change.properties
316 - 'wait-pkg-mgr-macro'
317 - 'delete-stack-macro'
320 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
322 disabled: '{obj:disabled}'
335 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
336 branch: $GERRIT_BRANCH
337 refspec: $GERRIT_REFSPEC
344 - credentials-binding:
346 credential-id: '{openrc-credentials-file}'
347 variable: OPENRC_FILE
348 - username-password-separated:
349 credential-id: 'nordix-cicd-arm-credentials'
350 username: NORDIX_ARM_USERNAME
351 password: NORDIX_ARM_TOKEN
353 - fix-workspace-permissions
356 - 'generate-ssh-keypair-macro'
357 - 'wait-pkg-mgr-macro'
358 - 'download-{phase}-artifact-macro'