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