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'
36 execution-mode: online-deployment
43 execution-mode: offline-deployment
55 provisioner-type: 'bifrost'
57 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
58 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
59 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
61 provisioner-type: 'heat'
62 slave-type: 'jumphost'
63 gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
64 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"
65 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
72 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
74 dependency-jobs: 'kubernetes-verify-package-{distro}-{stream}'
75 dependency-job-var: 'TRIGGER_kubernetes_verify_package_{distro}_{stream}_BUILD_RESULT'
78 - 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
79 - 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
82 name: 'kubernetes-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
84 project-type: multijob
86 disabled: '{obj:disabled}'
93 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
94 description: 'Slave label to schedule this job on.'
98 description: 'Hardware type - could be virtual, cloud, or baremetal'
101 default: '{execution-mode}'
102 description: 'Execution mode to run in'
106 description: 'PDF file to use for deployment'
110 description: 'IDF file to use for deployment'
112 name: HEAT_ENVIRONMENT_FILENAME
113 default: 'heat-environment-{cloud}-{distro}.yaml'
114 description: 'Name of heat-environment file to use.'
116 name: HEAT_STACK_NAME
117 default: "nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
118 description: 'Name of the created stack'
121 default: "keypair-nordix-cicd-verify-kubernetes-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
122 description: 'Name of the created keypair'
124 name: USE_PREBUILT_DEPLOYMENT_IMAGE
126 description: 'Use prebuilt deployment image while running as part of CI/CD'
129 default: 'https://gerrit.nordix.org/infra/test.git'
130 description: 'URL to clone the test repo from'
134 description: 'Test framework to use'
137 default: 'healthcheck'
138 description: 'Test suite to run'
140 name: YARDSTICK_DISPATCHER
142 description: 'Dispatcher to use for Yardstick reporting'
146 description: 'Delete the stack upon completion of the build'
150 description: 'Verbosity setting for the engine - true or false - default is false'
154 description: 'CI loop the job belongs to'
155 - project-parameters:
156 project: $GERRIT_PROJECT
158 description: 'The project and branch which the change is proposed for'
159 - nordix-gerrit-parameters
164 use-build-blocker: true
166 - 'engine-verify-online-deploy-test-.*'
167 - 'kubernetes-verify-offline-deploy-test-.*'
168 - 'onap-verify-offline-deploy-test-.*'
169 - 'openstack-verify-deploy-test-.*'
178 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
179 branch: $GERRIT_BRANCH
180 refspec: $GERRIT_REFSPEC
186 server-name: 'Nordix Gerrit'
188 - patchset-created-event:
189 exclude-drafts: 'false'
190 exclude-trivial-rebase: 'false'
191 exclude-no-code-change: 'false'
192 - draft-published-event
193 - comment-added-contains-event:
194 comment-contains-value: 'recheck'
195 - comment-added-contains-event:
196 comment-contains-value: 'reverify'
198 - project-compare-type: 'REG_EXP'
199 project-pattern: '{gated-projects}'
201 - branch-compare-type: 'ANT'
202 branch-pattern: '**/{branch}'
203 disable-strict-forbidden-file-verification: 'true'
204 forbidden-file-paths:
206 pattern: 'docs/**|releasenotes/**'
208 successful: '{obj:successful}'
209 failed: '{obj:failed}'
210 unstable: '{obj:unstable}'
211 notbuilt: '{obj:notbuilt}'
212 custom-url: '* $JOB_NAME $BUILD_URL'
213 readable-message: 'true'
214 dependency-jobs: '{dependency-jobs}'
219 - credentials-binding:
221 credential-id: '{openrc-credentials-file}'
222 variable: OPENRC_FILE
223 - username-password-separated:
224 credential-id: 'nordix-cicd-arm-credentials'
225 username: NORDIX_ARM_USERNAME
226 password: NORDIX_ARM_TOKEN
235 def build = this.getProperty('binding').getVariable('build')
236 def listener = this.getProperty('binding').getVariable('listener')
237 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
238 println "WARN : Aborting build since dependent job did not succeed!"
239 throw new InterruptedException()
243 sudo chown -R $USER:$USER $WORKSPACE || exit 1
244 # offline nodes can not resolve Nordix Artifactory and Gerrit
245 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
246 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
247 sudo sed -i 's/^search/# search/' /etc/resolv.conf
248 sudo bash -c "cat << EOF >> /etc/hosts
250 91.106.198.25 artifactory.nordix.org
251 91.106.198.142 gerrit.nordix.org
252 86.107.242.50 fra1.citycloud.com
255 # we need to get rid of search domain as well
256 sudo sed -i 's/^search/# search/' /etc/resolv.conf
260 - 'generate-change-metadata-macro'
262 name: "{environment-type} deployment on {type} instances"
263 condition: SUCCESSFUL
264 execution-type: PARALLEL
266 - name: 'kubernetes-verify-{environment-type}-deploy-{distro}-city-{type}-master'
267 current-parameters: true
269 node-parameters: true
270 kill-phase-on: FAILURE
272 property-file: $WORKSPACE/change.properties
274 name: "{environment-type} testing on {type} instances"
275 condition: SUCCESSFUL
276 execution-type: PARALLEL
278 - name: 'kubernetes-verify-{environment-type}-functest-{distro}-city-{type}-master'
279 current-parameters: true
281 node-parameters: true
282 kill-phase-on: FAILURE
284 property-file: $WORKSPACE/change.properties
297 - 'wait-pkg-mgr-macro'
298 - 'delete-stack-macro'
301 name: 'kubernetes-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
303 disabled: '{obj:disabled}'
316 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
317 branch: $GERRIT_BRANCH
318 refspec: $GERRIT_REFSPEC
325 - credentials-binding:
327 credential-id: '{openrc-credentials-file}'
328 variable: OPENRC_FILE
329 - username-password-separated:
330 credential-id: 'nordix-cicd-arm-credentials'
331 username: NORDIX_ARM_USERNAME
332 password: NORDIX_ARM_TOKEN
334 - fix-workspace-permissions
337 - 'generate-ssh-keypair-macro'
338 - 'wait-pkg-mgr-macro'
339 - 'download-artifact-macro'