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-tox-{stream}'
81 dependency-job-var: 'TRIGGER_onap_verify_tox_{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 - ssh-agent-credentials:
227 - 'nordixinfra-nordix-gerrit-ssh'
228 - credentials-binding:
230 credential-id: '{openrc-credentials-file}'
231 variable: OPENRC_FILE
232 - username-password-separated:
233 credential-id: 'nordix-cicd-arm-credentials'
234 username: NORDIX_ARM_USERNAME
235 password: NORDIX_ARM_TOKEN
244 def build = this.getProperty('binding').getVariable('build')
245 def listener = this.getProperty('binding').getVariable('listener')
246 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
247 println "WARN : Aborting build since dependent job did not succeed!"
248 throw new InterruptedException()
252 sudo chown -R $USER:$USER $WORKSPACE || exit 1
253 # offline nodes can not resolve Nordix Artifactory and Gerrit
254 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
255 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
256 sudo sed -i 's/^search/# search/' /etc/resolv.conf
257 sudo bash -c "cat << EOF >> /etc/hosts
259 91.106.198.25 artifactory.nordix.org
260 91.106.198.142 gerrit.nordix.org
261 86.107.242.50 fra1.citycloud.com
264 # we need to get rid of search domain as well
265 sudo sed -i 's/^search/# search/' /etc/resolv.conf
269 - 'generate-change-metadata-macro'
270 - 'generate-k8sdeployment-environment-macro'
272 name: "{environment-type} deployment on {type} instances"
273 condition: SUCCESSFUL
274 execution-type: SEQUENTIALLY
276 - name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
277 current-parameters: true
279 node-parameters: true
280 kill-phase-on: FAILURE
282 property-file: $WORKSPACE/k8s.properties
283 - name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
284 current-parameters: true
286 node-parameters: true
287 kill-phase-on: FAILURE
289 property-file: $WORKSPACE/change.properties
291 name: xTesting for infra-healthcheck and healthcheck
294 - name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
295 current-parameters: true
297 node-parameters: true
298 kill-phase-on: FAILURE
300 property-file: $WORKSPACE/change.properties
301 - name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
302 current-parameters: true
304 node-parameters: true
305 kill-phase-on: FAILURE
318 - 'wait-pkg-mgr-macro'
319 - 'delete-stack-macro'
322 name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
324 disabled: '{obj:disabled}'
337 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
338 branch: $GERRIT_BRANCH
339 refspec: $GERRIT_REFSPEC
346 - credentials-binding:
348 credential-id: '{openrc-credentials-file}'
349 variable: OPENRC_FILE
350 - username-password-separated:
351 credential-id: 'nordix-cicd-arm-credentials'
352 username: NORDIX_ARM_USERNAME
353 password: NORDIX_ARM_TOKEN
355 - fix-workspace-permissions
358 - 'generate-ssh-keypair-macro'
359 - 'wait-pkg-mgr-macro'
360 - 'download-deploy-artifact-macro'
364 name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
366 disabled: '{obj:disabled}'
379 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
380 branch: $GERRIT_BRANCH
381 refspec: $GERRIT_REFSPEC
388 - credentials-binding:
390 credential-id: '{openrc-credentials-file}'
391 variable: OPENRC_FILE
392 - username-password-separated:
393 credential-id: 'nordix-cicd-arm-credentials'
394 username: NORDIX_ARM_USERNAME
395 password: NORDIX_ARM_TOKEN
397 - fix-workspace-permissions
400 - 'generate-ssh-keypair-macro'
401 - 'wait-pkg-mgr-macro'
402 - 'download-deploy-artifact-macro'
405 name: 'onap-verify-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
407 disabled: '{obj:disabled}'
412 default: '{execution-mode}'
413 description: 'Execution mode'
416 default: 'https://gerrit.nordix.org/infra/test.git'
417 description: 'URL to clone the test repo from'
421 description: 'Test framework to use'
424 default: 'infra-healthcheck'
425 description: 'Test suite to run'
437 - fix-workspace-permissions
440 - 'download-xtesting-artifact-macro'
441 - 'xtesting-infra-healthcheck-macro'
444 name: 'onap-verify-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
446 disabled: '{obj:disabled}'
451 default: '{execution-mode}'
452 description: 'Execution mode'
455 default: 'https://gerrit.nordix.org/infra/test.git'
456 description: 'URL to clone the test repo from'
460 description: 'Test framework to use'
463 default: 'healthcheck'
464 description: 'Test suite to run'
476 - fix-workspace-permissions
479 - 'wait-pkg-mgr-macro'
480 - 'xtesting-healthcheck-macro'