Merge "Airship remove tests for nordix repos and change defaults"
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-engine-verify-deploy.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying patches
23 # that are sent to the repositories below
24 #   - cloud-infra/engine
25 #
26 # These jobs verify changes that
27 #   - implement new features or fix bugs for the deployment framework, engine, itself
28 #   - implement new features or fix bugs to the playbooks and roles used for utilizing
29 #     open source components such as bifrost, kubespray, and kolla-ansible
30 #   - bump versions of open source components or the scenarios
31 #
32 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
33 # The slaves have
34 #   - Ubuntu1604 as the base distro
35 #   - nested virtualization
36 #   - internet access
37 #   - passwordless sudo
38 #   - 16 CPUs/32GB RAM/200 GB Disk
39 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
40 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
41 #
42 # The slaves should not have a cloud infra scenario deployed on them.
43 #--------------------------------------------------------------------------------------
44
45 - project:
46     name: 'cloud-infra-verify-engine'
47
48     project: 'infra/engine'
49
50     stream:
51       - 'master':
52           branch: '{stream}'
53
54     distro:
55       - ubuntu1804:
56           disabled: false
57       - centos7:
58           disabled: true
59     cloud:
60       - city:
61           openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
62
63     type:
64       - virtual:
65           provisioner-type: 'bifrost'
66           slave-type: 'vpod'
67           successful: false
68           failed: false
69           unstable: false
70           notbuilt: false
71       - cloud:
72           provisioner-type: 'heat'
73           slave-type: 'jumphost'
74           successful: false
75           failed: false
76           unstable: false
77           notbuilt: false
78
79     phase:
80       - deploy:
81           build-timeout: 90
82       - functest:
83           build-timeout: 60
84
85     jobs:
86       - 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
87       - 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
88
89 - job-template:
90     name: 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
91
92     project-type: multijob
93
94     disabled: '{obj:disabled}'
95
96     concurrent: true
97
98     parameters:
99       - project-parameters:
100           project: '{project}'
101           branch: '{branch}'
102       - nordix-gerrit-parameters
103       - label:
104           name: SLAVE_LABEL
105           default: '{cloud}-{slave-type}-{distro}'
106           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
107       - string:
108           name: DISTRO
109           default: '{distro}'
110           description: 'Distribution to use for configuring target nodes (networking etc.)'
111       - string:
112           name: PROVISIONER_TYPE
113           default: '{provisioner-type}'
114           description: 'Provisioner type to use'
115       - string:
116           name: DEPLOY_TYPE
117           default: '{type}'
118           description: 'Type of the deployment'
119       - string:
120           name: HEAT_ENVIRONMENT_FILENAME
121           default: 'heat-environment-{cloud}-{distro}.yaml'
122           description: 'Name of heat-environment file to use.'
123       - string:
124           name: STACK_NAME
125           default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
126           description: 'Name of the created stack'
127       - string:
128           name: KEYPAIR_NAME
129           default: "keypair-nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
130           description: 'Name of the created keypair'
131       - string:
132           name: USE_PREBUILT_DEPLOYMENT_IMAGE
133           default: 'true'
134           description: 'Use prebuilt deployment image while running as part of CI/CD'
135       - string:
136           name: TEST_SUITE
137           default: 'healthcheck'
138           description: 'Test suite to run'
139       - string:
140           name: YARDSTICK_DISPATCHER
141           default: 'file'
142           description: 'Dispatcher to use for Yardstick reporting'
143       - string:
144           name: DELETE_STACK
145           default: 'yes'
146           description: 'Delete the stack upon completion of the build'
147       - string:
148           name: CLEANUP
149           default: 'true'
150           description: 'Cleanup leftovers of the previous run'
151
152     properties:
153       - logrotate
154       - build-blocker:
155           use-build-blocker: true
156           blocking-jobs:
157             - 'cloud-infra-verify-engine-.*'
158             - 'cloud-infra-verify-scenario-.*'
159             - 'cloud-infra-periodic-engine-.*'
160             - 'onap-.*'
161             - 'k8-.*'
162             - 'os-.*'
163             - 'nolabs-.*'
164           block-level: 'NODE'
165       - throttle:
166           max-per-node: 1
167           max-total: 3
168           option: project
169
170     wrappers:
171       - credentials-binding:
172           - file:
173               credential-id: '{openrc-credentials-file}'
174               variable: OPENRC_FILE
175       - mask-passwords
176       - build-timeout:
177           timeout: 150
178       - fix-workspace-permissions
179       - openstack:
180           single-use: True
181
182     scm:
183       - git-scm-gerrit:
184           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
185           branch: '{branch}'
186           refspec: $GERRIT_REFSPEC
187           wipe_workspace: true
188           clean_before: false
189
190     triggers:
191       - gerrit:
192           server-name: 'Nordix Gerrit'
193           trigger-on:
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'
203           projects:
204             - project-compare-type: 'REG_EXP'
205               project-pattern: 'infra\/engine'
206               branches:
207                 - branch-compare-type: 'ANT'
208                   branch-pattern: '**/{branch}'
209               disable-strict-forbidden-file-verification: 'true'
210               forbidden-file-paths:
211                 - compare-type: ANT
212                   pattern: 'docs/**'
213           skip-vote:
214             successful: '{obj:successful}'
215             failed: '{obj:failed}'
216             unstable: '{obj:unstable}'
217             notbuilt: '{obj:notbuilt}'
218           custom-url: '* $JOB_NAME $BUILD_URL'
219
220     builders:
221       - shell: |
222           #!/bin/bash
223           cp $OPENRC_FILE /tmp/openrc
224       - 'cloud-infra-determine-scenario-macro'
225       - multijob:
226           name: deploy
227           condition: SUCCESSFUL
228           projects:
229             - name: 'cloud-infra-verify-engine-{distro}-deploy-{type}-{stream}'
230               current-parameters: true
231               predefined-parameters: |
232                 DISTRO=$DISTRO
233                 DEPLOY_TYPE=$DEPLOY_TYPE
234                 PROVISIONER_TYPE=$PROVISIONER_TYPE
235                 STACK_NAME=$STACK_NAME
236                 KEYPAIR_NAME=$KEYPAIR_NAME
237                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
238                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
239                 CLEANUP=$CLEANUP
240                 GERRIT_PROJECT=$GERRIT_PROJECT
241                 GERRIT_BRANCH=$GERRIT_BRANCH
242                 GERRIT_REFSPEC=$GERRIT_REFSPEC
243                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
244                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
245               node-parameters: true
246               kill-phase-on: FAILURE
247               abort-all-job: true
248       - multijob:
249           name: functest
250           condition: SUCCESSFUL
251           projects:
252             - name: 'cloud-infra-verify-engine-{distro}-functest-{type}-{stream}'
253               current-parameters: true
254               predefined-parameters: |
255                 DISTRO=$DISTRO
256                 DEPLOY_TYPE=$DEPLOY_TYPE
257                 PROVISIONER_TYPE=$PROVISIONER_TYPE
258                 STACK_NAME=$STACK_NAME
259                 KEYPAIR_NAME=$KEYPAIR_NAME
260                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
261                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
262                 TEST_SUITE=$TEST_SUITE
263                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
264                 CLEANUP=$CLEANUP
265                 GERRIT_PROJECT=$GERRIT_PROJECT
266                 GERRIT_BRANCH=$GERRIT_BRANCH
267                 GERRIT_REFSPEC=$GERRIT_REFSPEC
268                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
269                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
270               node-parameters: true
271               kill-phase-on: FAILURE
272               abort-all-job: true
273
274     publishers:
275       - postbuildscript:
276           builders:
277             - role: SLAVE
278               build-on:
279                 - SUCCESS
280                 - FAILURE
281                 - ABORTED
282                 - NOT_BUILT
283                 - UNSTABLE
284               build-steps:
285                 - shell:
286                     !include-raw-escape: ./wait-for-pkg-manager.sh
287                 - shell:
288                     !include-raw: ./delete-heat-stack.sh
289
290 - job-template:
291     name: 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
292
293     disabled: false
294
295     concurrent: true
296
297     properties:
298       - logrotate
299
300     parameters:
301       - string:
302           name: PROJECT
303           default: $GERRIT_PROJECT
304       - string:
305           name: DISTRO
306           default: 'ubuntu1804'
307           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
308       - string:
309           name: DEPLOY_TYPE
310           default: 'virtual'
311           description: 'Type of the deployment. Overriden by upstream job.'
312       - string:
313           name: PROVISIONER_TYPE
314           default: 'bifrost'
315           description: 'Provisioner type to use. Overriden by upstream job.'
316       - string:
317           name: HEAT_ENVIRONMENT_FILENAME
318           default: "heat-environment-city-ubuntu1804.yaml"
319           description: 'Name of heat-environment file to use.'
320       - string:
321           name: HEAT_ENVIRONMENT_FILE
322           default: "file://$WORKSPACE/engine/provisioner/heat/playbooks/roles/bootstrap-hwconfig/files/$HEAT_ENVIRONMENT_FILENAME"
323           description: 'Location of heat-environment file to use.'
324       - string:
325           name: STACK_NAME
326           default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
327           description: 'Name of the created stack'
328       - string:
329           name: USE_PREBUILT_DEPLOYMENT_IMAGE
330           default: 'false'
331           description: 'Use prebuilt deployment image while running as part of CI/CD'
332       - string:
333           name: TEST_FW
334           default: '{phase}'
335           description: 'Test framework to use'
336       - string:
337           name: TEST_SUITE
338           default: 'healthcheck'
339           description: 'Test suite to run'
340       - string:
341           name: TEST_REPO_URL
342           default: 'https://gerrit.nordix.org/infra/test.git'
343           description: 'URL to Nordix Cloud Infra test repository'
344       - string:
345           name: YARDSTICK_DISPATCHER
346           default: 'file'
347           description: 'Dispatcher to use for Yardstick reporting'
348       - string:
349           name: CLEANUP
350           default: 'false'
351
352     wrappers:
353       - mask-passwords
354       - build-timeout:
355           timeout: '{build-timeout}'
356       - fix-workspace-permissions
357
358     scm:
359       - git-scm-gerrit:
360           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
361           branch: '{branch}'
362           refspec: $GERRIT_REFSPEC
363           wipe_workspace: true
364           clean_before: false
365
366     builders:
367       - 'cloud-infra-determine-scenario-macro'
368       - 'cloud-infra-{phase}-macro'
369
370 # vim: set ts=2 sw=2 expandtab: