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: 'engine-verify-deploy-test'
23 project: 'engine-verify-deploy-test'
32 execution-mode: online-deployment
33 pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
34 idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
41 execution-mode: offline-deployment
42 pdf: 'file:///opt/engine/offline/git/hwconfig/pods/nordix-vpod1-pdf.yml'
43 idf: 'file:///opt/engine/offline/git/hwconfig/pods/nordix-vpod1-idf.yml'
55 provisioner-type: 'bifrost'
57 gated-projects: 'infra\/engine|infra\/provisioner\/bifrost\/|infra\/installer\/kolla\/|infra\/installer\/kubespray\/'
59 provisioner-type: 'heat'
60 slave-type: 'jumphost'
61 gated-projects: 'infra\/engine|infra\/provisioner\/heat\/|infra\/installer\/kolla\/|infra\/installer\/kubespray\/'
68 openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
70 dependency-jobs: 'engine-verify-package-{distro}-{stream}'
71 dependency-job-var: 'TRIGGER_engine_verify_package_{distro}_{stream}_BUILD_RESULT'
74 - 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
75 - 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
78 name: 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
80 project-type: multijob
82 disabled: '{obj:disabled}'
89 default: 'engine-{slave-type}-{environment-type}-{distro}'
90 description: 'Slave label to schedule this job on.'
93 default: '{execution-mode}'
94 description: 'Execution mode to run in'
96 name: PROVISIONER_TYPE
97 default: '{provisioner-type}'
98 description: 'Provisioner type to use'
102 description: 'Installer type to use'
104 name: DEPLOY_SCENARIO
105 default: 'k8-calico-nofeature'
106 description: 'Scenario to deploy'
110 description: 'PDF file to use for deployment'
114 description: 'IDF file to use for deployment'
116 name: HEAT_ENVIRONMENT_FILENAME
117 default: 'heat-environment-{cloud}-{distro}.yaml'
118 description: 'Name of heat-environment file to use.'
121 default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
122 description: 'Name of the created stack'
125 default: "keypair-nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
126 description: 'Name of the created keypair'
128 name: USE_PREBUILT_DEPLOYMENT_IMAGE
130 description: 'Use prebuilt deployment image while running as part of CI/CD'
133 default: 'https://gerrit.nordix.org/infra/test.git'
134 description: 'URL to clone the test repo from'
138 description: 'Test framework to use'
141 default: 'healthcheck'
142 description: 'Test suite to run'
144 name: YARDSTICK_DISPATCHER
146 description: 'Dispatcher to use for Yardstick reporting'
150 description: 'Delete the stack upon completion of the build'
154 description: 'Verbosity setting for the engine - true or false - default is false'
156 name: NORDIX_GERRIT_PUBLIC_IP
157 default: '91.106.198.142'
158 description: 'Public IP of Nordix Gerrit. Offline deployments can not resolve domain name'
160 name: NORDIX_ARM_PUBLIC_IP
161 default: '91.106.198.25'
162 description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
164 name: NORDIX_ARM_HTTPS_URL
165 default: 'https://artifactory.nordix.org/artifactory'
166 description: 'URL to Nordix Artifactory'
168 name: NORDIX_ARM_REPO
169 default: 'nordix-kubernetes'
170 description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
172 name: ARTIFACT_TO_DOWNLOAD
173 default: "k8s-installer-ubuntu1804.bsx"
174 description: 'Artifact to download'
176 name: NORDIX_ARTIFACT_URL
177 default: "$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/gerrit/$GERRIT_CHANGE_NUMBER"
178 description: 'Artifact to download'
179 - project-parameters:
180 project: $GERRIT_PROJECT
182 description: 'The project and branch which the change is proposed for'
183 - nordix-gerrit-parameters
192 use-build-blocker: true
194 - 'engine-verify-online-deploy-test-.*'
195 - 'engine-verify-offline-deploy-test-.*'
200 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
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 Gerrit
267 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
268 echo "Info : Offline deployment. Adding Nordix 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 $NORDIX_GERRIT_PUBLIC_IP gerrit.nordix.org
279 name: "{environment-type} deployment on {type} instances"
280 condition: SUCCESSFUL
281 execution-type: PARALLEL
283 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
284 current-parameters: true
286 node-parameters: true
287 kill-phase-on: FAILURE
290 name: "{environment-type} testing on {type} instances"
291 condition: SUCCESSFUL
292 execution-type: PARALLEL
294 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
295 current-parameters: true
297 node-parameters: true
298 kill-phase-on: FAILURE
312 - 'wait-pkg-mgr-macro'
313 - 'delete-stack-macro'
316 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
318 disabled: '{obj:disabled}'
331 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
333 refspec: $GERRIT_REFSPEC
340 - credentials-binding:
342 credential-id: '{openrc-credentials-file}'
343 variable: OPENRC_FILE
344 - username-password-separated:
345 credential-id: 'nordix-cicd-arm-credentials'
346 username: NORDIX_ARM_USERNAME
347 password: NORDIX_ARM_TOKEN
349 - fix-workspace-permissions
354 if [[ "$EXECUTION_MODE" == "offline-deployment" && "$PROVISIONER_TYPE" == "heat" ]]; then
355 echo "Info : Offline deployment and testing on cloud instances is not currently supported!"
358 - 'generate-ssh-keypair-macro'
359 - 'wait-pkg-mgr-macro'
360 - 'download-artifact-macro'