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-sdc-nofeature'
33 deploy-scenario: 'onap-sdc-nofeature'
37 deploy-scenario: 'onap-sdc-nofeature'
42 execution-mode: online-deployment
49 execution-mode: offline-deployment
54 # just deploy phase for now and ONAP testing isn't defined yet
61 provisioner-type: 'heat'
62 slave-type: 'jumphost'
63 gated-projects: 'infra/stack/onap|infra/installer/oom'
64 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"
65 idf: "https://gerrit.nordix.org/gitweb?p=infra/provisioner/heat.git;a=blob_plain;f=playbooks/roles/create-stack/files/heat-idf.yaml"
72 openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
75 dependency-jobs: 'onap-verify-package-{distro}-{stream}'
76 dependency-job-var: 'TRIGGER_onap_verify_package_{distro}_{stream}_BUILD_RESULT'
79 - 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
80 - 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
81 - 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
84 name: 'onap-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
86 project-type: multijob
88 disabled: '{obj:disabled}'
95 default: '{deploy-scenario}'
96 description: 'Scenario to test change with.'
99 default: '{k8s-version}'
100 description: 'K8S version to use for this deployment'
103 default: /tmp/inventory.ini
104 description: 'Location of the inventory file. Copied from k8s install'
108 description: 'Distribution to use for configuring target nodes (networking etc.)'
111 default: 'engine-{slave-type}-{environment-type}-{distro}-fra'
112 description: 'Slave label to schedule this job on.'
116 description: 'Hardware type - could be virtual, cloud, or baremetal'
119 default: '{execution-mode}'
120 description: 'Execution mode to run in'
124 description: 'PDF file to use for deployment'
128 description: 'IDF file to use for deployment'
130 name: HEAT_STACK_NAME
131 default: "nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
132 description: 'Name of the created stack'
135 default: "keypair-nordix-cicd-verify-onap-{environment-type}-{distro}-$GERRIT_CHANGE_NUMBER"
136 description: 'Name of the created keypair'
138 name: USE_PREBUILT_DEPLOYMENT_IMAGE
140 description: 'Use prebuilt deployment image while running as part of CI/CD'
143 default: 'https://gerrit.nordix.org/infra/test.git'
144 description: 'URL to clone the test repo from'
148 description: 'Test framework to use'
151 default: 'healthcheck'
152 description: 'Test suite to run'
154 name: YARDSTICK_DISPATCHER
156 description: 'Dispatcher to use for Yardstick reporting'
160 description: 'Delete the stack upon completion of the build'
164 description: 'Verbosity setting for the engine - true or false - default is false'
168 description: 'CI loop the job belongs to'
169 - project-parameters:
170 project: $GERRIT_PROJECT
172 description: 'The project and branch which the change is proposed for'
173 - nordix-gerrit-parameters
177 # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
184 - engine-verify-deploy-test
188 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
189 branch: $GERRIT_BRANCH
190 refspec: $GERRIT_REFSPEC
196 server-name: 'Nordix Gerrit'
198 - patchset-created-event:
199 exclude-drafts: 'false'
200 exclude-trivial-rebase: 'false'
201 exclude-no-code-change: 'false'
202 - draft-published-event
203 - comment-added-contains-event:
204 comment-contains-value: 'recheck'
205 - comment-added-contains-event:
206 comment-contains-value: 'reverify'
208 - project-compare-type: 'REG_EXP'
209 project-pattern: '{gated-projects}'
211 - branch-compare-type: 'ANT'
212 branch-pattern: '**/{branch}'
213 disable-strict-forbidden-file-verification: 'true'
214 forbidden-file-paths:
216 pattern: 'docs/**|releasenotes/**'
218 successful: '{obj:successful}'
219 failed: '{obj:failed}'
220 unstable: '{obj:unstable}'
221 notbuilt: '{obj:notbuilt}'
222 custom-url: '* $JOB_NAME $BUILD_URL'
223 readable-message: 'true'
224 dependency-jobs: '{dependency-jobs}'
229 - credentials-binding:
231 credential-id: '{openrc-credentials-file}'
232 variable: OPENRC_FILE
233 - username-password-separated:
234 credential-id: 'nordix-cicd-arm-credentials'
235 username: NORDIX_ARM_USERNAME
236 password: NORDIX_ARM_TOKEN
245 def build = this.getProperty('binding').getVariable('build')
246 def listener = this.getProperty('binding').getVariable('listener')
247 if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
248 println "WARN : Aborting build since dependent job did not succeed!"
249 throw new InterruptedException()
253 sudo chown -R $USER:$USER $WORKSPACE || exit 1
254 # offline nodes can not resolve Nordix Artifactory and Gerrit
255 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
256 echo "Info : Offline deployment. Adding City OpenStack Endpoint, Nordix Artifactory and Gerrit Public IP to /etc/hosts"
257 sudo sed -i 's/^search/# search/' /etc/resolv.conf
258 sudo bash -c "cat << EOF >> /etc/hosts
260 91.106.198.25 artifactory.nordix.org
261 91.106.198.142 gerrit.nordix.org
262 86.107.242.50 fra1.citycloud.com
265 # we need to get rid of search domain as well
266 sudo sed -i 's/^search/# search/' /etc/resolv.conf
270 - 'generate-change-metadata-macro'
271 - 'generate-k8sdeployment-environment-macro'
273 name: "{environment-type} deployment on {type} instances"
274 condition: SUCCESSFUL
275 execution-type: SEQUENTIALLY
277 - name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
278 current-parameters: true
280 node-parameters: true
281 kill-phase-on: FAILURE
283 property-file: $WORKSPACE/k8s.properties
284 - name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
285 current-parameters: true
287 node-parameters: true
288 kill-phase-on: FAILURE
290 property-file: $WORKSPACE/change.properties
302 - 'wait-pkg-mgr-macro'
303 - 'delete-stack-macro'
306 name: 'onap-verify-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
308 disabled: '{obj:disabled}'
321 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
322 branch: $GERRIT_BRANCH
323 refspec: $GERRIT_REFSPEC
330 - credentials-binding:
332 credential-id: '{openrc-credentials-file}'
333 variable: OPENRC_FILE
334 - username-password-separated:
335 credential-id: 'nordix-cicd-arm-credentials'
336 username: NORDIX_ARM_USERNAME
337 password: NORDIX_ARM_TOKEN
339 - fix-workspace-permissions
342 - 'generate-ssh-keypair-macro'
343 - 'wait-pkg-mgr-macro'
344 - 'download-deploy-artifact-macro'
348 name: 'onap-verify-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
350 disabled: '{obj:disabled}'
363 ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
364 branch: $GERRIT_BRANCH
365 refspec: $GERRIT_REFSPEC
372 - credentials-binding:
374 credential-id: '{openrc-credentials-file}'
375 variable: OPENRC_FILE
376 - username-password-separated:
377 credential-id: 'nordix-cicd-arm-credentials'
378 username: NORDIX_ARM_USERNAME
379 password: NORDIX_ARM_TOKEN
381 - fix-workspace-permissions
384 - 'generate-ssh-keypair-macro'
385 - 'wait-pkg-mgr-macro'
386 - 'download-deploy-artifact-macro'