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'
36 execution-mode: online-deployment
43 execution-mode: offline-deployment
55 provisioner-type: 'heat'
56 slave-type: 'jumphost'
57 gated-projects: 'infra/stack/onap|infra/installer/oom'
58 pdf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-environment-city-ubuntu1804.yaml"
59 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
66 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
68 dependency-jobs: 'onap-verify-package-{distro}-{stream}'
69 dependency-job-var: 'TRIGGER_onap_verify_package_{distro}_{stream}_BUILD_RESULT'
72 - 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
73 - 'onap-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
76 name: 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
78 project-type: multijob
80 disabled: '{obj:disabled}'
87 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
88 description: 'Slave label to schedule this job on.'
92 description: 'Hardware type - could be virtual, cloud, or baremetal'
95 default: '{execution-mode}'
96 description: 'Execution mode to run in'
100 description: 'PDF file to use for deployment'
104 description: 'IDF file to use for deployment'
106 name: HEAT_ENVIRONMENT_FILENAME
107 default: 'heat-environment-{cloud}-{distro}.yaml'
108 description: 'Name of heat-environment file to use.'
110 name: HEAT_STACK_NAME
111 default: "nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
112 description: 'Name of the created stack'
115 default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
116 description: 'Name of the created keypair'
118 name: USE_PREBUILT_DEPLOYMENT_IMAGE
120 description: 'Use prebuilt deployment image while running as part of CI/CD'
123 default: 'https://gerrit.nordix.org/infra/test.git'
124 description: 'URL to clone the test repo from'
128 description: 'Test framework to use'
131 default: 'healthcheck'
132 description: 'Test suite to run'
134 name: YARDSTICK_DISPATCHER
136 description: 'Dispatcher to use for Yardstick reporting'
140 description: 'Delete the stack upon completion of the build'
144 description: 'Verbosity setting for the engine - true or false - default is false'
148 description: 'CI loop the job belongs to'
149 - project-parameters:
150 project: $GERRIT_PROJECT
152 description: 'The project and branch which the change is proposed for'
153 - nordix-gerrit-parameters
158 use-build-blocker: true
160 - 'engine-verify-online-deploy-test-.*'
161 - 'kubernetes-verify-offline-deploy-test-.*'
162 - 'onap-verify-offline-deploy-test-.*'
171 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
172 branch: $GERRIT_BRANCH
173 refspec: $GERRIT_REFSPEC
179 server-name: 'Nordix Gerrit'
181 - patchset-created-event:
182 exclude-drafts: 'false'
183 exclude-trivial-rebase: 'false'
184 exclude-no-code-change: 'false'
185 - draft-published-event
186 - comment-added-contains-event:
187 comment-contains-value: 'recheck'
188 - comment-added-contains-event:
189 comment-contains-value: 'reverify'
191 - project-compare-type: 'REG_EXP'
192 project-pattern: '{gated-projects}'
194 - branch-compare-type: 'ANT'
195 branch-pattern: '**/{branch}'
196 disable-strict-forbidden-file-verification: 'true'
197 forbidden-file-paths:
199 pattern: 'docs/**|releasenotes/**'
201 successful: '{obj:successful}'
202 failed: '{obj:failed}'
203 unstable: '{obj:unstable}'
204 notbuilt: '{obj:notbuilt}'
205 custom-url: '* $JOB_NAME $BUILD_URL'
206 readable-message: 'true'
207 dependency-jobs: '{dependency-jobs}'
212 - credentials-binding:
214 credential-id: '{openrc-credentials-file}'
215 variable: OPENRC_FILE
216 - username-password-separated:
217 credential-id: 'nordix-cicd-arm-credentials'
218 username: NORDIX_ARM_USERNAME
219 password: NORDIX_ARM_TOKEN
228 def build = this.getProperty('binding').getVariable('build')
229 def listener = this.getProperty('binding').getVariable('listener')
230 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
231 println "WARN : Aborting build since dependent job did not succeed!"
232 throw new InterruptedException()
236 sudo chown -R $USER:$USER $WORKSPACE || exit 1
237 # offline nodes can not resolve Nordix Artifactory and Gerrit
238 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
239 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
240 sudo sed -i 's/^search/# search/' /etc/resolv.conf
241 sudo bash -c "cat << EOF >> /etc/hosts
243 91.106.198.25 artifactory.nordix.org
244 91.106.198.142 gerrit.nordix.org
245 86.107.242.50 fra1.citycloud.com
248 # we need to get rid of search domain as well
249 sudo sed -i 's/^search/# search/' /etc/resolv.conf
253 - 'generate-change-metadata-macro'
255 name: "{environment-type} deployment on {type} instances"
256 condition: SUCCESSFUL
257 execution-type: PARALLEL
259 - name: 'onap-verify-{environment-type}-deploy-{distro}-city-{type}-master'
260 current-parameters: true
262 node-parameters: true
263 kill-phase-on: FAILURE
265 property-file: $WORKSPACE/change.properties
267 name: "{environment-type} testing on {type} instances"
268 condition: SUCCESSFUL
269 execution-type: PARALLEL
271 - name: 'onap-verify-{environment-type}-functest-{distro}-city-{type}-master'
272 current-parameters: true
274 node-parameters: true
275 kill-phase-on: FAILURE
277 property-file: $WORKSPACE/change.properties
290 - 'wait-pkg-mgr-macro'
291 - 'delete-stack-macro'
294 name: 'onap-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
296 disabled: '{obj:disabled}'
309 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
310 branch: $GERRIT_BRANCH
311 refspec: $GERRIT_REFSPEC
318 - credentials-binding:
320 credential-id: '{openrc-credentials-file}'
321 variable: OPENRC_FILE
322 - username-password-separated:
323 credential-id: 'nordix-cicd-arm-credentials'
324 username: NORDIX_ARM_USERNAME
325 password: NORDIX_ARM_TOKEN
327 - fix-workspace-permissions
330 - 'generate-ssh-keypair-macro'
331 - 'wait-pkg-mgr-macro'
332 - 'download-artifact-macro'