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-multus-plugins'
43 deploy-scenario: 'k8-multus-plugins'
46 deploy-scenario: 'k8-calico-nofeature'
49 deploy-scenario: 'k8-calico-nofeature'
54 execution-mode: online-deployment
61 execution-mode: offline-deployment
73 provisioner-type: 'bifrost'
75 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
76 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
77 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
79 provisioner-type: 'heat'
80 slave-type: 'jumphost'
81 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
82 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"
83 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
90 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
92 dependency-jobs: 'kubernetes-verify-package-{distro}-{stream}'
93 dependency-job-var: 'TRIGGER_kubernetes_verify_package_{distro}_{stream}_BUILD_RESULT'
96 - 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
97 - 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
100 name: 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
102 project-type: multijob
104 disabled: '{obj:disabled}'
110 name: DEPLOY_SCENARIO
111 default: '{deploy-scenario}'
112 description: 'Scenario to test change with. This depends on the branch of the stack'
116 description: 'Distribution to use for configuring target nodes (networking etc.)'
119 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
120 description: 'Slave label to schedule this job on.'
124 description: 'Hardware type - could be virtual, cloud, or baremetal'
127 default: '{execution-mode}'
128 description: 'Execution mode to run in'
132 description: 'PDF file to use for deployment'
136 description: 'IDF file to use for deployment'
138 name: HEAT_STACK_NAME
139 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
140 description: 'Name of the created stack'
143 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
144 description: 'Name of the created keypair'
146 name: USE_PREBUILT_DEPLOYMENT_IMAGE
148 description: 'Use prebuilt deployment image while running as part of CI/CD'
151 default: 'https://gerrit.nordix.org/infra/test.git'
152 description: 'URL to clone the test repo from'
156 description: 'Test framework to use'
159 default: 'healthcheck'
160 description: 'Test suite to run'
162 name: YARDSTICK_DISPATCHER
164 description: 'Dispatcher to use for Yardstick reporting'
168 description: 'Delete the stack upon completion of the build'
172 description: 'Verbosity setting for the engine - true or false - default is false'
176 description: 'CI loop the job belongs to'
180 description: 'Whether to deploy csi-cephfs storageclass.'
181 - project-parameters:
182 project: $GERRIT_PROJECT
184 description: 'The project and branch which the change is proposed for'
185 - nordix-gerrit-parameters
189 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
196 - engine-verify-deploy-test
200 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
201 branch: $GERRIT_BRANCH
202 refspec: $GERRIT_REFSPEC
208 server-name: 'Nordix Gerrit'
210 - patchset-created-event:
211 exclude-drafts: 'false'
212 exclude-trivial-rebase: 'false'
213 exclude-no-code-change: 'false'
214 - draft-published-event
215 - comment-added-contains-event:
216 comment-contains-value: 'recheck'
217 - comment-added-contains-event:
218 comment-contains-value: 'reverify'
220 - project-compare-type: 'REG_EXP'
221 project-pattern: '{gated-projects}'
223 - branch-compare-type: 'ANT'
224 branch-pattern: '**/{branch}'
225 disable-strict-forbidden-file-verification: 'true'
226 forbidden-file-paths:
228 pattern: 'docs/**|releasenotes/**'
230 successful: '{obj:successful}'
231 failed: '{obj:failed}'
232 unstable: '{obj:unstable}'
233 notbuilt: '{obj:notbuilt}'
234 custom-url: '* $JOB_NAME $BUILD_URL'
235 readable-message: 'true'
236 dependency-jobs: '{dependency-jobs}'
241 - credentials-binding:
243 credential-id: '{openrc-credentials-file}'
244 variable: OPENRC_FILE
245 - username-password-separated:
246 credential-id: 'nordix-cicd-arm-credentials'
247 username: NORDIX_ARM_USERNAME
248 password: NORDIX_ARM_TOKEN
257 def build = this.getProperty('binding').getVariable('build')
258 def listener = this.getProperty('binding').getVariable('listener')
259 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
260 println "WARN : Aborting build since dependent job did not succeed!"
261 throw new InterruptedException()
265 sudo chown -R $USER:$USER $WORKSPACE || exit 1
266 # offline nodes can not resolve Nordix Artifactory and Gerrit
267 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
268 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
269 sudo sed -i 's/^search/# search/' /etc/resolv.conf
270 sudo bash -c "cat << EOF >> /etc/hosts
272 91.106.198.25 artifactory.nordix.org
273 91.106.198.142 gerrit.nordix.org
274 86.107.242.50 fra1.citycloud.com
277 # we need to get rid of search domain as well
278 sudo sed -i 's/^search/# search/' /etc/resolv.conf
280 - ssh-agent-credentials:
282 - 'nordixinfra-nordix-gerrit-ssh'
285 - 'generate-change-metadata-macro'
287 name: "{environment-type} deployment on {type} instances"
288 condition: SUCCESSFUL
289 execution-type: PARALLEL
291 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-{stream}'
292 current-parameters: true
294 node-parameters: true
295 kill-phase-on: FAILURE
297 property-file: $WORKSPACE/change.properties
299 name: "{environment-type} testing on {type} instances"
300 condition: SUCCESSFUL
301 execution-type: PARALLEL
303 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-{stream}'
304 current-parameters: true
306 node-parameters: true
307 kill-phase-on: FAILURE
309 property-file: $WORKSPACE/change.properties
322 - 'wait-pkg-mgr-macro'
323 - 'delete-stack-macro'
326 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
328 disabled: '{obj:disabled}'
341 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
342 branch: $GERRIT_BRANCH
343 refspec: $GERRIT_REFSPEC
350 - credentials-binding:
352 credential-id: '{openrc-credentials-file}'
353 variable: OPENRC_FILE
354 - username-password-separated:
355 credential-id: 'nordix-cicd-arm-credentials'
356 username: NORDIX_ARM_USERNAME
357 password: NORDIX_ARM_TOKEN
359 - fix-workspace-permissions
362 - 'generate-ssh-keypair-macro'
363 - 'wait-pkg-mgr-macro'
364 - 'download-{phase}-artifact-macro'