engine: Split verification jobs
[infra/cicd.git] / jjb / engine / verify-jobs / engine-verify-deploy-test.yaml
1 ---
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
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
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.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 - project:
21     name: 'engine-verify-deploy-test'
22
23     project: 'engine-verify-deploy-test'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28
29     environment-type:
30       - online:
31           disabled: false
32           execution-mode: online-deployment
33           pdf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-pdf.yml'
34           idf: 'https://gerrit.nordix.org/gitweb?p=infra/hwconfig.git;a=blob_plain;f=pods/nordix-vpod1-idf.yml'
35           successful: false
36           failed: false
37           unstable: false
38           notbuilt: false
39       - offline:
40           disabled: false
41           execution-mode: offline-deployment
42           pdf: 'file:///opt/engine/offline/git/hwconfig/pods/nordix-vpod1-pdf.yml'
43           idf: 'file:///opt/engine/offline/git/hwconfig/pods/nordix-vpod1-idf.yml'
44           successful: false
45           failed: false
46           unstable: false
47           notbuilt: false
48
49     phase:
50       - deploy
51       - functest
52
53     type:
54       - virtual:
55           provisioner-type: 'bifrost'
56           slave-type: 'vpod'
57           gated-projects: 'infra\/engine|infra\/provisioner\/bifrost\/|infra\/installer\/kolla\/|infra\/installer\/kubespray\/'
58       - cloud:
59           provisioner-type: 'heat'
60           slave-type: 'jumphost'
61           gated-projects: 'infra\/engine|infra\/provisioner\/heat\/|infra\/installer\/kolla\/|infra\/installer\/kubespray\/'
62
63     distro:
64       - ubuntu1804
65
66     cloud:
67       - city:
68           openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
69
70     jobs:
71       - 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
72       - 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
73
74 - job-template:
75     name: 'engine-verify-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
76
77     project-type: multijob
78
79     disabled: '{obj:disabled}'
80
81     concurrent: true
82
83     parameters:
84       - project-parameters:
85           project: $GERRIT_PROJECT
86           branch: '{branch}'
87           description: 'The project and branch which the change is proposed for'
88       - label:
89           name: SLAVE_LABEL
90           default: 'engine-{slave-type}-online-{distro}'
91           description: 'Slave label to schedule this job on.'
92       - string:
93           name: EXECUTION_MODE
94           default: '{execution-mode}'
95           description: 'Execution mode to run in'
96       - string:
97           name: PROVISIONER_TYPE
98           default: '{provisioner-type}'
99           description: 'Provisioner type to use'
100       - string:
101           name: INSTALLER_TYPE
102           default: 'kubespray'
103           description: 'Installer type to use'
104       - string:
105           name: DEPLOY_SCENARIO
106           default: 'k8-calico-nofeature'
107           description: 'Scenario to deploy'
108       - string:
109           name: PDF
110           default: '{pdf}'
111           description: 'PDF file to use for deployment'
112       - string:
113           name: IDF
114           default: '{idf}'
115           description: 'IDF file to use for deployment'
116       - string:
117           name: HEAT_ENVIRONMENT_FILENAME
118           default: 'heat-environment-{cloud}-{distro}.yaml'
119           description: 'Name of heat-environment file to use.'
120       - string:
121           name: STACK_NAME
122           default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
123           description: 'Name of the created stack'
124       - string:
125           name: KEYPAIR_NAME
126           default: "keypair-nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
127           description: 'Name of the created keypair'
128       - string:
129           name: USE_PREBUILT_DEPLOYMENT_IMAGE
130           default: 'true'
131           description: 'Use prebuilt deployment image while running as part of CI/CD'
132       - string:
133           name: TEST_REPO_URL
134           default: 'https://gerrit.nordix.org/infra/test.git'
135           description: 'URL to clone the test repo from'
136       - string:
137           name: TEST_FW
138           default: 'functest'
139           description: 'Test framework to use'
140       - string:
141           name: TEST_SUITE
142           default: 'healthcheck'
143           description: 'Test suite to run'
144       - string:
145           name: YARDSTICK_DISPATCHER
146           default: 'file'
147           description: 'Dispatcher to use for Yardstick reporting'
148       - string:
149           name: DELETE_STACK
150           default: 'true'
151           description: 'Delete the stack upon completion of the build'
152       - string:
153           name: VERBOSITY
154           default: 'true'
155           description: 'Verbosity setting for the engine - true or false - default is false'
156       - string:
157           name: NORDIX_ARM_PUBLIC_IP
158           default: '91.106.198.25'
159           description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
160       - string:
161           name: NORDIX_ARM_HTTPS_URL
162           default: 'https://artifactory.nordix.org/artifactory'
163           description: 'URL to Nordix Artifactory'
164       - string:
165           name: NORDIX_ARM_REPO
166           default: 'nordix-kubernetes'
167           description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
168       - string:
169           name: ARTIFACT_TO_DOWNLOAD
170           default: "https://artifactory.nordix.org/artifactory/nordix-kubernetes/installer/oss/gerrit/$GERRIT_CHANGE_ID/k8s-installer-ubuntu1804.bsx"
171           description: 'Artifact to download'
172
173     properties:
174       - logrotate
175       - throttle:
176           max-per-node: 1
177           max-total: 3
178           option: project
179
180     wrappers:
181       - build-timeout:
182           timeout: 180
183       - credentials-binding:
184           - file:
185               credential-id: '{openrc-credentials-file}'
186               variable: OPENRC_FILE
187           - username-password-separated:
188               credential-id: 'nordix-cicd-arm-credentials'
189               username: NORDIX_ARM_USERNAME
190               password: NORDIX_ARM_TOKEN
191       - mask-passwords
192       - fix-workspace-permissions
193       - openstack:
194           single-use: True
195
196     scm:
197       - git-scm-gerrit:
198           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
199           branch: '{branch}'
200           refspec: $GERRIT_REFSPEC
201           wipe_workspace: true
202           clean_before: false
203
204     triggers:
205       - gerrit:
206           server-name: 'Nordix Gerrit'
207           trigger-on:
208             - patchset-created-event:
209                 exclude-drafts: 'false'
210                 exclude-trivial-rebase: 'false'
211                 exclude-no-code-change: 'false'
212             - draft-published-event
213             - comment-added-contains-event:
214                 comment-contains-value: 'recheck'
215             - comment-added-contains-event:
216                 comment-contains-value: 'reverify'
217           projects:
218             - project-compare-type: 'REG_EXP'
219               project-pattern: '{gated-projects}'
220               branches:
221                 - branch-compare-type: 'ANT'
222                   branch-pattern: '**/{branch}'
223               disable-strict-forbidden-file-verification: 'true'
224               forbidden-file-paths:
225                 - compare-type: ANT
226                   pattern: 'docs/**|releasenotes/**'
227           skip-vote:
228             successful: '{obj:successful}'
229             failed: '{obj:failed}'
230             unstable: '{obj:unstable}'
231             notbuilt: '{obj:notbuilt}'
232           custom-url: '* $JOB_NAME $BUILD_URL'
233           readable-message: 'true'
234           dependency-jobs: 'engine-verify-tox-{stream},engine-verify-package-{distro}-{stream}'
235
236     builders:
237       - multijob:
238           name: "{environment-type} deployment on {type} instances"
239           condition: SUCCESSFUL
240           execution-type: PARALLEL
241           projects:
242             - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
243               current-parameters: true
244               git-revision: true
245               node-parameters: true
246               kill-phase-on: FAILURE
247               abort-all-job: false
248       - multijob:
249           name: "{environment-type} testing on {type} instances"
250           condition: SUCCESSFUL
251           execution-type: PARALLEL
252           projects:
253             - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
254               current-parameters: true
255               git-revision: false
256               node-parameters: true
257               kill-phase-on: FAILURE
258               abort-all-job: false
259
260     publishers:
261       - postbuildscript:
262           builders:
263             - role: SLAVE
264               build-on:
265                 - SUCCESS
266                 - FAILURE
267                 - ABORTED
268                 - NOT_BUILT
269                 - UNSTABLE
270               build-steps:
271                 - 'wait-pkg-mgr-macro'
272                 - 'delete-stack-macro'
273
274 - job-template:
275     name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
276
277     disabled: '{obj:disabled}'
278
279     concurrent: true
280
281     properties:
282       - logrotate
283       - throttle:
284           max-per-node: 1
285           max-total: 3
286           option: project
287
288     wrappers:
289       - build-timeout:
290           timeout: 180
291       - credentials-binding:
292           - file:
293               credential-id: '{openrc-credentials-file}'
294               variable: OPENRC_FILE
295           - username-password-separated:
296               credential-id: 'nordix-cicd-arm-credentials'
297               username: NORDIX_ARM_USERNAME
298               password: NORDIX_ARM_TOKEN
299       - mask-passwords
300       - fix-workspace-permissions
301
302     scm:
303       - git-scm-gerrit:
304           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
305           branch: '{branch}'
306           refspec: $GERRIT_REFSPEC
307           wipe_workspace: true
308           clean_before: false
309
310     builders:
311       - 'generate-ssh-keypair-macro'
312       - 'wait-pkg-mgr-macro'
313       - 'download-artifact-macro'
314       - '{phase}-macro'