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/kubespray'
68 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
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}-fra'
90 description: 'Slave label to schedule this job on.'
93 default: 'https://gerrit.nordix.org/infra/engine.git'
94 description: 'URL to Nordix Cloud Infra engine repository'
97 default: '{execution-mode}'
98 description: 'Execution mode to run in'
100 name: PROVISIONER_TYPE
101 default: '{provisioner-type}'
102 description: 'Provisioner type to use'
106 description: 'Installer type to use'
108 name: DEPLOY_SCENARIO
109 default: 'k8-calico-nofeature'
110 description: 'Scenario to deploy'
114 description: 'PDF file to use for deployment'
118 description: 'IDF file to use for deployment'
120 name: HEAT_ENVIRONMENT_FILENAME
121 default: 'heat-environment-{cloud}-{distro}.yaml'
122 description: 'Name of heat-environment file to use.'
125 default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
126 description: 'Name of the created stack'
129 default: "keypair-nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
130 description: 'Name of the created keypair'
132 name: USE_PREBUILT_DEPLOYMENT_IMAGE
134 description: 'Use prebuilt deployment image while running as part of CI/CD'
137 default: 'https://gerrit.nordix.org/infra/test.git'
138 description: 'URL to clone the test repo from'
142 description: 'Test framework to use'
145 default: 'healthcheck'
146 description: 'Test suite to run'
148 name: YARDSTICK_DISPATCHER
150 description: 'Dispatcher to use for Yardstick reporting'
154 description: 'Delete the stack upon completion of the build'
158 description: 'Verbosity setting for the engine - true or false - default is false'
160 name: NORDIX_GERRIT_PUBLIC_IP
161 default: '91.106.198.142'
162 description: 'Public IP of Nordix Gerrit. Offline deployments can not resolve domain name'
164 name: NORDIX_ARM_PUBLIC_IP
165 default: '91.106.198.25'
166 description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
168 name: NORDIX_ARM_HTTPS_URL
169 default: 'https://artifactory.nordix.org/artifactory'
170 description: 'URL to Nordix Artifactory'
172 name: NORDIX_ARM_REPO
173 default: 'nordix-kubernetes'
174 description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
176 name: ARTIFACT_TO_DOWNLOAD
177 default: "k8s-installer-ubuntu1804.bsx"
178 description: 'Artifact to download'
180 name: NORDIX_ARTIFACT_URL
181 default: "$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/gerrit/$GERRIT_CHANGE_NUMBER"
182 description: 'Artifact to download'
186 description: 'CI loop the job belongs to'
187 - project-parameters:
188 project: $GERRIT_PROJECT
190 description: 'The project and branch which the change is proposed for'
191 - nordix-gerrit-parameters
196 use-build-blocker: true
198 - 'engine-verify-online-deploy-test-.*'
199 - 'engine-verify-offline-deploy-test-.*'
208 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
209 branch: refs/heads/$GERRIT_BRANCH
210 refspec: $GERRIT_REFSPEC
216 server-name: 'Nordix Gerrit'
218 - patchset-created-event:
219 exclude-drafts: 'false'
220 exclude-trivial-rebase: 'false'
221 exclude-no-code-change: 'false'
222 - draft-published-event
223 - comment-added-contains-event:
224 comment-contains-value: 'recheck'
225 - comment-added-contains-event:
226 comment-contains-value: 'reverify'
228 - project-compare-type: 'REG_EXP'
229 project-pattern: '{gated-projects}'
231 - branch-compare-type: 'ANT'
232 branch-pattern: '**/{branch}'
233 disable-strict-forbidden-file-verification: 'true'
234 forbidden-file-paths:
236 pattern: 'docs/**|releasenotes/**'
238 successful: '{obj:successful}'
239 failed: '{obj:failed}'
240 unstable: '{obj:unstable}'
241 notbuilt: '{obj:notbuilt}'
242 custom-url: '* $JOB_NAME $BUILD_URL'
243 readable-message: 'true'
244 dependency-jobs: '{dependency-jobs}'
249 - credentials-binding:
251 credential-id: '{openrc-credentials-file}'
252 variable: OPENRC_FILE
253 - username-password-separated:
254 credential-id: 'nordix-cicd-arm-credentials'
255 username: NORDIX_ARM_USERNAME
256 password: NORDIX_ARM_TOKEN
265 def build = this.getProperty('binding').getVariable('build')
266 def listener = this.getProperty('binding').getVariable('listener')
267 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
268 println "WARN : Aborting build since dependent job did not succeed!"
269 throw new InterruptedException()
273 sudo chown -R $USER:$USER $WORKSPACE || exit 1
274 # offline nodes can not resolve Nordix Gerrit
275 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
276 echo "Info : Offline deployment. Adding Nordix Gerrit Public IP to /etc/hosts"
277 sudo sed -i 's/^search/# search/' /etc/resolv.conf
278 sudo bash -c "cat << EOF >> /etc/hosts
280 $NORDIX_GERRIT_PUBLIC_IP gerrit.nordix.org
287 name: "{environment-type} deployment on {type} instances"
288 condition: SUCCESSFUL
289 execution-type: PARALLEL
291 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
292 current-parameters: true
294 node-parameters: true
295 kill-phase-on: FAILURE
298 name: "{environment-type} testing on {type} instances"
299 condition: SUCCESSFUL
300 execution-type: PARALLEL
302 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
303 current-parameters: true
305 node-parameters: true
306 kill-phase-on: FAILURE
320 - 'wait-pkg-mgr-macro'
321 - 'delete-stack-macro'
324 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
326 disabled: '{obj:disabled}'
339 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
340 branch: refs/heads/$GERRIT_BRANCH
341 refspec: $GERRIT_REFSPEC
348 - credentials-binding:
350 credential-id: '{openrc-credentials-file}'
351 variable: OPENRC_FILE
352 - username-password-separated:
353 credential-id: 'nordix-cicd-arm-credentials'
354 username: NORDIX_ARM_USERNAME
355 password: NORDIX_ARM_TOKEN
357 - fix-workspace-permissions
362 if [[ "$EXECUTION_MODE" == "offline-deployment" && "$PROVISIONER_TYPE" == "heat" ]]; then
363 echo "Info : Offline deployment and testing on cloud instances is not currently supported!"
366 - 'generate-sdf-for-change-macro'
367 - 'generate-ssh-keypair-macro'
368 - 'wait-pkg-mgr-macro'
369 - 'download-artifact-macro'