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-karlskrona-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}'
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'
183 - project-parameters:
184 project: $GERRIT_PROJECT
186 description: 'The project and branch which the change is proposed for'
187 - nordix-gerrit-parameters
192 use-build-blocker: true
194 - 'engine-verify-online-deploy-test-.*'
195 - 'engine-verify-offline-deploy-test-.*'
204 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
205 branch: refs/heads/$GERRIT_BRANCH
206 refspec: $GERRIT_REFSPEC
212 server-name: 'Nordix Gerrit'
214 - patchset-created-event:
215 exclude-drafts: 'false'
216 exclude-trivial-rebase: 'false'
217 exclude-no-code-change: 'false'
218 - draft-published-event
219 - comment-added-contains-event:
220 comment-contains-value: 'recheck'
221 - comment-added-contains-event:
222 comment-contains-value: 'reverify'
224 - project-compare-type: 'REG_EXP'
225 project-pattern: '{gated-projects}'
227 - branch-compare-type: 'ANT'
228 branch-pattern: '**/{branch}'
229 disable-strict-forbidden-file-verification: 'true'
230 forbidden-file-paths:
232 pattern: 'docs/**|releasenotes/**'
234 successful: '{obj:successful}'
235 failed: '{obj:failed}'
236 unstable: '{obj:unstable}'
237 notbuilt: '{obj:notbuilt}'
238 custom-url: '* $JOB_NAME $BUILD_URL'
239 readable-message: 'true'
240 dependency-jobs: '{dependency-jobs}'
245 - credentials-binding:
247 credential-id: '{openrc-credentials-file}'
248 variable: OPENRC_FILE
249 - username-password-separated:
250 credential-id: 'nordix-cicd-arm-credentials'
251 username: NORDIX_ARM_USERNAME
252 password: NORDIX_ARM_TOKEN
261 def build = this.getProperty('binding').getVariable('build')
262 def listener = this.getProperty('binding').getVariable('listener')
263 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
264 println "WARN : Aborting build since dependent job did not succeed!"
265 throw new InterruptedException()
269 sudo chown -R $USER:$USER $WORKSPACE || exit 1
270 # offline nodes can not resolve Nordix Gerrit
271 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
272 echo "Info : Offline deployment. Adding Nordix Gerrit Public IP to /etc/hosts"
273 sudo sed -i 's/^search/# search/' /etc/resolv.conf
274 sudo bash -c "cat << EOF >> /etc/hosts
276 $NORDIX_GERRIT_PUBLIC_IP gerrit.nordix.org
283 name: "{environment-type} deployment on {type} instances"
284 condition: SUCCESSFUL
285 execution-type: PARALLEL
287 - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
288 current-parameters: true
290 node-parameters: true
291 kill-phase-on: FAILURE
294 name: "{environment-type} testing on {type} instances"
295 condition: SUCCESSFUL
296 execution-type: PARALLEL
298 - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
299 current-parameters: true
301 node-parameters: true
302 kill-phase-on: FAILURE
316 - 'wait-pkg-mgr-macro'
317 - 'delete-stack-macro'
320 name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
322 disabled: '{obj:disabled}'
335 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
336 branch: refs/heads/$GERRIT_BRANCH
337 refspec: $GERRIT_REFSPEC
344 - credentials-binding:
346 credential-id: '{openrc-credentials-file}'
347 variable: OPENRC_FILE
348 - username-password-separated:
349 credential-id: 'nordix-cicd-arm-credentials'
350 username: NORDIX_ARM_USERNAME
351 password: NORDIX_ARM_TOKEN
353 - fix-workspace-permissions
358 if [[ "$EXECUTION_MODE" == "offline-deployment" && "$PROVISIONER_TYPE" == "heat" ]]; then
359 echo "Info : Offline deployment and testing on cloud instances is not currently supported!"
362 - 'generate-sdf-for-change-macro'
363 - 'generate-ssh-keypair-macro'
364 - 'wait-pkg-mgr-macro'
365 - 'download-artifact-macro'