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
58 # just deploy phase for now and ONAP testing isn't defined yet
65 provisioner-type: 'heat'
66 slave-type: 'jumphost'
67 gated-projects: 'infra/stack/onap|infra/installer/oom'
68 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"
69 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
76 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
79 dependency-jobs: 'onap-verify-package-{distro}-{stream}'
80 dependency-job-var: 'TRIGGER_onap_verify_package_{distro}_{stream}_BUILD_RESULT'
83 - 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
84 - 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
85 - 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
88 name: 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
90 project-type: multijob
92 disabled: '{obj:disabled}'
99 default: '{deploy-scenario}'
100 description: 'Scenario to test change with.'
103 default: '{k8s-version}'
104 description: 'K8S version to use for this deployment'
107 default: /tmp/inventory.ini
108 description: 'Location of the inventory file. Copied from k8s install'
112 description: 'Distribution to use for configuring target nodes (networking etc.)'
115 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
116 description: 'Slave label to schedule this job on.'
120 description: 'Hardware type - could be virtual, cloud, or baremetal'
123 default: '{execution-mode}'
124 description: 'Execution mode to run in'
128 description: 'PDF file to use for deployment'
132 description: 'IDF file to use for deployment'
134 name: HEAT_STACK_NAME
135 default: "nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
136 description: 'Name of the created stack'
139 default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
140 description: 'Name of the created keypair'
142 name: USE_PREBUILT_DEPLOYMENT_IMAGE
144 description: 'Use prebuilt deployment image while running as part of CI/CD'
147 default: 'https://gerrit.nordix.org/infra/test.git'
148 description: 'URL to clone the test repo from'
152 description: 'Test framework to use'
155 default: 'healthcheck'
156 description: 'Test suite to run'
158 name: YARDSTICK_DISPATCHER
160 description: 'Dispatcher to use for Yardstick reporting'
164 description: 'Delete the stack upon completion of the build'
168 description: 'Verbosity setting for the engine - true or false - default is false'
172 description: 'CI loop the job belongs to'
173 - project-parameters:
174 project: $GERRIT_PROJECT
176 description: 'The project and branch which the change is proposed for'
177 - nordix-gerrit-parameters
181 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
188 - engine-verify-deploy-test
192 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
193 branch: $GERRIT_BRANCH
194 refspec: $GERRIT_REFSPEC
200 server-name: 'Nordix Gerrit'
202 - patchset-created-event:
203 exclude-drafts: 'false'
204 exclude-trivial-rebase: 'false'
205 exclude-no-code-change: 'false'
206 - draft-published-event
207 - comment-added-contains-event:
208 comment-contains-value: 'recheck'
209 - comment-added-contains-event:
210 comment-contains-value: 'reverify'
212 - project-compare-type: 'REG_EXP'
213 project-pattern: '{gated-projects}'
215 - branch-compare-type: 'ANT'
216 branch-pattern: '**/{branch}'
217 disable-strict-forbidden-file-verification: 'true'
218 forbidden-file-paths:
220 pattern: 'docs/**|releasenotes/**'
222 successful: '{obj:successful}'
223 failed: '{obj:failed}'
224 unstable: '{obj:unstable}'
225 notbuilt: '{obj:notbuilt}'
226 custom-url: '* $JOB_NAME $BUILD_URL'
227 readable-message: 'true'
228 dependency-jobs: '{dependency-jobs}'
233 - credentials-binding:
235 credential-id: '{openrc-credentials-file}'
236 variable: OPENRC_FILE
237 - username-password-separated:
238 credential-id: 'nordix-cicd-arm-credentials'
239 username: NORDIX_ARM_USERNAME
240 password: NORDIX_ARM_TOKEN
249 def build = this.getProperty('binding').getVariable('build')
250 def listener = this.getProperty('binding').getVariable('listener')
251 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
252 println "WARN : Aborting build since dependent job did not succeed!"
253 throw new InterruptedException()
257 sudo chown -R $USER:$USER $WORKSPACE || exit 1
258 # offline nodes can not resolve Nordix Artifactory and Gerrit
259 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
260 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
261 sudo sed -i 's/^search/# search/' /etc/resolv.conf
262 sudo bash -c "cat << EOF >> /etc/hosts
264 91.106.198.25 artifactory.nordix.org
265 91.106.198.142 gerrit.nordix.org
266 86.107.242.50 fra1.citycloud.com
269 # we need to get rid of search domain as well
270 sudo sed -i 's/^search/# search/' /etc/resolv.conf
274 - 'generate-change-metadata-macro'
275 - 'generate-k8sdeployment-environment-macro'
277 name: "{environment-type} deployment on {type} instances"
278 condition: SUCCESSFUL
279 execution-type: SEQUENTIALLY
281 - name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
282 current-parameters: true
284 node-parameters: true
285 kill-phase-on: FAILURE
287 property-file: $WORKSPACE/k8s.properties
288 - name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
289 current-parameters: true
291 node-parameters: true
292 kill-phase-on: FAILURE
294 property-file: $WORKSPACE/change.properties
306 - 'wait-pkg-mgr-macro'
307 - 'delete-stack-macro'
310 name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
312 disabled: '{obj:disabled}'
325 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
326 branch: $GERRIT_BRANCH
327 refspec: $GERRIT_REFSPEC
334 - credentials-binding:
336 credential-id: '{openrc-credentials-file}'
337 variable: OPENRC_FILE
338 - username-password-separated:
339 credential-id: 'nordix-cicd-arm-credentials'
340 username: NORDIX_ARM_USERNAME
341 password: NORDIX_ARM_TOKEN
343 - fix-workspace-permissions
346 - 'generate-ssh-keypair-macro'
347 - 'wait-pkg-mgr-macro'
348 - 'download-deploy-artifact-macro'
352 name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
354 disabled: '{obj:disabled}'
367 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
368 branch: $GERRIT_BRANCH
369 refspec: $GERRIT_REFSPEC
376 - credentials-binding:
378 credential-id: '{openrc-credentials-file}'
379 variable: OPENRC_FILE
380 - username-password-separated:
381 credential-id: 'nordix-cicd-arm-credentials'
382 username: NORDIX_ARM_USERNAME
383 password: NORDIX_ARM_TOKEN
385 - fix-workspace-permissions
388 - 'generate-ssh-keypair-macro'
389 - 'wait-pkg-mgr-macro'
390 - 'download-deploy-artifact-macro'