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: 'onap-verify-deploy-test'
23 project: 'onap-verify-deploy-test'
29 deploy-scenario: 'onap-full-nofeature'
33 deploy-scenario: 'onap-full-nofeature'
37 deploy-scenario: 'onap-sdc-nofeature'
41 deploy-scenario: 'onap-sdc-nofeature'
46 execution-mode: online-deployment
53 execution-mode: offline-deployment
66 provisioner-type: 'heat'
67 slave-type: 'jumphost'
68 gated-projects: 'infra/stack/onap|infra/installer/oom'
69 pdf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-environment-ci-city-ubuntu1804-onap.yaml"
70 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
77 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
80 dependency-jobs: 'onap-verify-package-{distro}-{stream}'
81 dependency-job-var: 'TRIGGER_onap_verify_package_{distro}_{stream}_BUILD_RESULT'
84 - 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
85 - 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
86 - 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
87 - 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
88 - 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
92 name: 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
94 project-type: multijob
96 disabled: '{obj:disabled}'
102 name: DEPLOY_SCENARIO
103 default: '{deploy-scenario}'
104 description: 'Scenario to test change with.'
107 default: '{k8s-version}'
108 description: 'K8S version to use for this deployment'
111 default: /tmp/inventory.ini
112 description: 'Location of the inventory file. Copied from k8s install'
116 description: 'Distribution to use for configuring target nodes (networking etc.)'
119 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
120 description: 'Slave label to schedule this job on.'
124 description: 'Hardware type - could be virtual, cloud, or baremetal'
127 default: '{execution-mode}'
128 description: 'Execution mode to run in'
132 description: 'Stack to package, deploy, test, release'
136 description: 'PDF file to use for deployment'
140 description: 'IDF file to use for deployment'
142 name: HEAT_STACK_NAME
143 default: "nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
144 description: 'Name of the created stack'
147 default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
148 description: 'Name of the created keypair'
150 name: USE_PREBUILT_DEPLOYMENT_IMAGE
152 description: 'Use prebuilt deployment image while running as part of CI/CD'
156 description: 'Delete the stack upon completion of the build'
160 description: 'Verbosity setting for the engine - true or false - default is false'
164 description: 'CI loop the job belongs to'
165 - project-parameters:
166 project: $GERRIT_PROJECT
168 description: 'The project and branch which the change is proposed for'
169 - nordix-gerrit-parameters
173 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
180 - engine-verify-deploy-test
184 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
185 branch: $GERRIT_BRANCH
186 refspec: $GERRIT_REFSPEC
192 server-name: 'Nordix Gerrit'
194 - patchset-created-event:
195 exclude-drafts: 'false'
196 exclude-trivial-rebase: 'false'
197 exclude-no-code-change: 'false'
198 - draft-published-event
199 - comment-added-contains-event:
200 comment-contains-value: 'recheck'
201 - comment-added-contains-event:
202 comment-contains-value: 'reverify'
204 - project-compare-type: 'REG_EXP'
205 project-pattern: '{gated-projects}'
207 - branch-compare-type: 'ANT'
208 branch-pattern: '**/{branch}'
209 disable-strict-forbidden-file-verification: 'true'
210 forbidden-file-paths:
212 pattern: 'docs/**|releasenotes/**'
214 successful: '{obj:successful}'
215 failed: '{obj:failed}'
216 unstable: '{obj:unstable}'
217 notbuilt: '{obj:notbuilt}'
218 custom-url: '* $JOB_NAME $BUILD_URL'
219 readable-message: 'true'
220 dependency-jobs: '{dependency-jobs}'
225 - credentials-binding:
227 credential-id: '{openrc-credentials-file}'
228 variable: OPENRC_FILE
229 - username-password-separated:
230 credential-id: 'nordix-cicd-arm-credentials'
231 username: NORDIX_ARM_USERNAME
232 password: NORDIX_ARM_TOKEN
241 def build = this.getProperty('binding').getVariable('build')
242 def listener = this.getProperty('binding').getVariable('listener')
243 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
244 println "WARN : Aborting build since dependent job did not succeed!"
245 throw new InterruptedException()
249 sudo chown -R $USER:$USER $WORKSPACE || exit 1
250 # offline nodes can not resolve Nordix Artifactory and Gerrit
251 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
252 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
253 sudo sed -i 's/^search/# search/' /etc/resolv.conf
254 sudo bash -c "cat << EOF >> /etc/hosts
256 91.106.198.25 artifactory.nordix.org
257 91.106.198.142 gerrit.nordix.org
258 86.107.242.50 fra1.citycloud.com
261 # we need to get rid of search domain as well
262 sudo sed -i 's/^search/# search/' /etc/resolv.conf
266 - 'generate-change-metadata-macro'
267 - 'generate-k8sdeployment-environment-macro'
269 name: "{environment-type} deployment on {type} instances"
270 condition: SUCCESSFUL
271 execution-type: SEQUENTIALLY
273 - name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
274 current-parameters: true
276 node-parameters: true
277 kill-phase-on: FAILURE
279 property-file: $WORKSPACE/k8s.properties
280 - name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
281 current-parameters: true
283 node-parameters: true
284 kill-phase-on: FAILURE
286 property-file: $WORKSPACE/change.properties
288 name: xTesting for infra-healthcheck and healthcheck
291 - name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
292 current-parameters: true
294 node-parameters: true
295 kill-phase-on: FAILURE
297 - name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
298 current-parameters: true
300 node-parameters: true
301 kill-phase-on: FAILURE
314 - 'wait-pkg-mgr-macro'
315 - 'delete-stack-macro'
318 name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
320 disabled: '{obj:disabled}'
333 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
334 branch: $GERRIT_BRANCH
335 refspec: $GERRIT_REFSPEC
342 - credentials-binding:
344 credential-id: '{openrc-credentials-file}'
345 variable: OPENRC_FILE
346 - username-password-separated:
347 credential-id: 'nordix-cicd-arm-credentials'
348 username: NORDIX_ARM_USERNAME
349 password: NORDIX_ARM_TOKEN
351 - fix-workspace-permissions
354 - 'generate-ssh-keypair-macro'
355 - 'wait-pkg-mgr-macro'
356 - 'download-deploy-artifact-macro'
360 name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
362 disabled: '{obj:disabled}'
375 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
376 branch: $GERRIT_BRANCH
377 refspec: $GERRIT_REFSPEC
384 - credentials-binding:
386 credential-id: '{openrc-credentials-file}'
387 variable: OPENRC_FILE
388 - username-password-separated:
389 credential-id: 'nordix-cicd-arm-credentials'
390 username: NORDIX_ARM_USERNAME
391 password: NORDIX_ARM_TOKEN
393 - fix-workspace-permissions
396 - 'generate-ssh-keypair-macro'
397 - 'wait-pkg-mgr-macro'
398 - 'download-deploy-artifact-macro'
401 name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
403 disabled: '{obj:disabled}'
408 default: '{execution-mode}'
409 description: 'Execution mode'
412 default: 'https://gerrit.nordix.org/infra/test.git'
413 description: 'URL to clone the test repo from'
417 description: 'Test framework to use'
420 default: 'infra-healthcheck'
421 description: 'Test suite to run'
433 - fix-workspace-permissions
436 - 'xtesting-infra-healthcheck-macro'
439 name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
441 disabled: '{obj:disabled}'
446 default: '{execution-mode}'
447 description: 'Execution mode'
450 default: 'https://gerrit.nordix.org/infra/test.git'
451 description: 'URL to clone the test repo from'
455 description: 'Test framework to use'
458 default: 'healthcheck'
459 description: 'Test suite to run'
471 - fix-workspace-permissions
474 - 'wait-pkg-mgr-macro'
475 - 'xtesting-healthcheck-macro'