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
157 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
164 - engine-verify-deploy-test
168 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
169 branch: $GERRIT_BRANCH
170 refspec: $GERRIT_REFSPEC
176 server-name: 'Nordix Gerrit'
178 - patchset-created-event:
179 exclude-drafts: 'false'
180 exclude-trivial-rebase: 'false'
181 exclude-no-code-change: 'false'
182 - draft-published-event
183 - comment-added-contains-event:
184 comment-contains-value: 'recheck'
185 - comment-added-contains-event:
186 comment-contains-value: 'reverify'
188 - project-compare-type: 'REG_EXP'
189 project-pattern: '{gated-projects}'
191 - branch-compare-type: 'ANT'
192 branch-pattern: '**/{branch}'
193 disable-strict-forbidden-file-verification: 'true'
194 forbidden-file-paths:
196 pattern: 'docs/**|releasenotes/**'
198 successful: '{obj:successful}'
199 failed: '{obj:failed}'
200 unstable: '{obj:unstable}'
201 notbuilt: '{obj:notbuilt}'
202 custom-url: '* $JOB_NAME $BUILD_URL'
203 readable-message: 'true'
204 dependency-jobs: '{dependency-jobs}'
209 - credentials-binding:
211 credential-id: '{openrc-credentials-file}'
212 variable: OPENRC_FILE
213 - username-password-separated:
214 credential-id: 'nordix-cicd-arm-credentials'
215 username: NORDIX_ARM_USERNAME
216 password: NORDIX_ARM_TOKEN
225 def build = this.getProperty('binding').getVariable('build')
226 def listener = this.getProperty('binding').getVariable('listener')
227 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
228 println "WARN : Aborting build since dependent job did not succeed!"
229 throw new InterruptedException()
233 sudo chown -R $USER:$USER $WORKSPACE || exit 1
234 # offline nodes can not resolve Nordix Artifactory and Gerrit
235 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
236 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
237 sudo sed -i 's/^search/# search/' /etc/resolv.conf
238 sudo bash -c "cat << EOF >> /etc/hosts
240 91.106.198.25 artifactory.nordix.org
241 91.106.198.142 gerrit.nordix.org
242 86.107.242.50 fra1.citycloud.com
245 # we need to get rid of search domain as well
246 sudo sed -i 's/^search/# search/' /etc/resolv.conf
250 - 'generate-change-metadata-macro'
252 name: "{environment-type} deployment on {type} instances"
253 condition: SUCCESSFUL
254 execution-type: PARALLEL
256 - name: 'onap-verify-{environment-type}-deploy-{distro}-city-{type}-master'
257 current-parameters: true
259 node-parameters: true
260 kill-phase-on: FAILURE
262 property-file: $WORKSPACE/change.properties
264 name: "{environment-type} testing on {type} instances"
265 condition: SUCCESSFUL
266 execution-type: PARALLEL
268 - name: 'onap-verify-{environment-type}-functest-{distro}-city-{type}-master'
269 current-parameters: true
271 node-parameters: true
272 kill-phase-on: FAILURE
274 property-file: $WORKSPACE/change.properties
287 - 'wait-pkg-mgr-macro'
288 - 'delete-stack-macro'
291 name: 'onap-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
293 disabled: '{obj:disabled}'
306 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
307 branch: $GERRIT_BRANCH
308 refspec: $GERRIT_REFSPEC
315 - credentials-binding:
317 credential-id: '{openrc-credentials-file}'
318 variable: OPENRC_FILE
319 - username-password-separated:
320 credential-id: 'nordix-cicd-arm-credentials'
321 username: NORDIX_ARM_USERNAME
322 password: NORDIX_ARM_TOKEN
324 - fix-workspace-permissions
327 - 'generate-ssh-keypair-macro'
328 - 'wait-pkg-mgr-macro'
329 - 'download-artifact-macro'