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'
42 execution-mode: online-deployment
49 execution-mode: offline-deployment
61 provisioner-type: 'bifrost'
63 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
64 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
65 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
67 provisioner-type: 'heat'
68 slave-type: 'jumphost'
69 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
70 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"
71 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
78 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
80 dependency-jobs: 'kubernetes-verify-package-{distro}-{stream}'
81 dependency-job-var: 'TRIGGER_kubernetes_verify_package_{distro}_{stream}_BUILD_RESULT'
84 - 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
85 - 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
88 name: 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
90 project-type: multijob
92 disabled: '{obj:disabled}'
99 default: '{deploy-scenario}'
100 description: 'Scenario to test change with. This depends on the branch of the stack'
104 description: 'Distribution to use for configuring target nodes (networking etc.)'
107 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
108 description: 'Slave label to schedule this job on.'
112 description: 'Hardware type - could be virtual, cloud, or baremetal'
115 default: '{execution-mode}'
116 description: 'Execution mode to run in'
120 description: 'PDF file to use for deployment'
124 description: 'IDF file to use for deployment'
126 name: HEAT_ENVIRONMENT_FILENAME
127 default: 'heat-environment-{cloud}-{distro}.yaml'
128 description: 'Name of heat-environment file to use.'
130 name: HEAT_STACK_NAME
131 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
132 description: 'Name of the created stack'
135 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
136 description: 'Name of the created keypair'
138 name: USE_PREBUILT_DEPLOYMENT_IMAGE
140 description: 'Use prebuilt deployment image while running as part of CI/CD'
143 default: 'https://gerrit.nordix.org/infra/test.git'
144 description: 'URL to clone the test repo from'
148 description: 'Test framework to use'
151 default: 'healthcheck'
152 description: 'Test suite to run'
154 name: YARDSTICK_DISPATCHER
156 description: 'Dispatcher to use for Yardstick reporting'
160 description: 'Delete the stack upon completion of the build'
164 description: 'Verbosity setting for the engine - true or false - default is false'
168 description: 'CI loop the job belongs to'
169 - project-parameters:
170 project: $GERRIT_PROJECT
172 description: 'The project and branch which the change is proposed for'
173 - nordix-gerrit-parameters
177 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
184 - engine-verify-deploy-test
188 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
189 branch: $GERRIT_BRANCH
190 refspec: $GERRIT_REFSPEC
196 server-name: 'Nordix Gerrit'
198 - patchset-created-event:
199 exclude-drafts: 'false'
200 exclude-trivial-rebase: 'false'
201 exclude-no-code-change: 'false'
202 - draft-published-event
203 - comment-added-contains-event:
204 comment-contains-value: 'recheck'
205 - comment-added-contains-event:
206 comment-contains-value: 'reverify'
208 - project-compare-type: 'REG_EXP'
209 project-pattern: '{gated-projects}'
211 - branch-compare-type: 'ANT'
212 branch-pattern: '**/{branch}'
213 disable-strict-forbidden-file-verification: 'true'
214 forbidden-file-paths:
216 pattern: 'docs/**|releasenotes/**'
218 successful: '{obj:successful}'
219 failed: '{obj:failed}'
220 unstable: '{obj:unstable}'
221 notbuilt: '{obj:notbuilt}'
222 custom-url: '* $JOB_NAME $BUILD_URL'
223 readable-message: 'true'
224 dependency-jobs: '{dependency-jobs}'
229 - credentials-binding:
231 credential-id: '{openrc-credentials-file}'
232 variable: OPENRC_FILE
233 - username-password-separated:
234 credential-id: 'nordix-cicd-arm-credentials'
235 username: NORDIX_ARM_USERNAME
236 password: NORDIX_ARM_TOKEN
245 def build = this.getProperty('binding').getVariable('build')
246 def listener = this.getProperty('binding').getVariable('listener')
247 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
248 println "WARN : Aborting build since dependent job did not succeed!"
249 throw new InterruptedException()
253 sudo chown -R $USER:$USER $WORKSPACE || exit 1
254 # offline nodes can not resolve Nordix Artifactory and Gerrit
255 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
256 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
257 sudo sed -i 's/^search/# search/' /etc/resolv.conf
258 sudo bash -c "cat << EOF >> /etc/hosts
260 91.106.198.25 artifactory.nordix.org
261 91.106.198.142 gerrit.nordix.org
262 86.107.242.50 fra1.citycloud.com
265 # we need to get rid of search domain as well
266 sudo sed -i 's/^search/# search/' /etc/resolv.conf
270 - 'generate-change-metadata-macro'
272 name: "{environment-type} deployment on {type} instances"
273 condition: SUCCESSFUL
274 execution-type: PARALLEL
276 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-master'
277 current-parameters: true
279 node-parameters: true
280 kill-phase-on: FAILURE
282 property-file: $WORKSPACE/change.properties
284 name: "{environment-type} testing on {type} instances"
285 condition: SUCCESSFUL
286 execution-type: PARALLEL
288 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-master'
289 current-parameters: true
291 node-parameters: true
292 kill-phase-on: FAILURE
294 property-file: $WORKSPACE/change.properties
307 - 'wait-pkg-mgr-macro'
308 - 'delete-stack-macro'
311 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
313 disabled: '{obj:disabled}'
326 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
327 branch: $GERRIT_BRANCH
328 refspec: $GERRIT_REFSPEC
335 - credentials-binding:
337 credential-id: '{openrc-credentials-file}'
338 variable: OPENRC_FILE
339 - username-password-separated:
340 credential-id: 'nordix-cicd-arm-credentials'
341 username: NORDIX_ARM_USERNAME
342 password: NORDIX_ARM_TOKEN
344 - fix-workspace-permissions
347 - 'generate-ssh-keypair-macro'
348 - 'wait-pkg-mgr-macro'
349 - 'download-artifact-macro'