engine: Update package macro and gerrit parameters
[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
181     wrappers:
182       - build-timeout:
183           timeout: 180
184       - credentials-binding:
185           - file:
186               credential-id: '{openrc-credentials-file}'
187               variable: OPENRC_FILE
188           - username-password-separated:
189               credential-id: 'nordix-cicd-arm-credentials'
190               username: NORDIX_ARM_USERNAME
191               password: NORDIX_ARM_TOKEN
192       - mask-passwords
193       - fix-workspace-permissions
194       - openstack:
195           single-use: True
196
197     scm:
198       - git-scm-gerrit:
199           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
200           branch: '{branch}'
201           refspec: $GERRIT_REFSPEC
202           wipe_workspace: true
203           clean_before: false
204
205     triggers:
206       - gerrit:
207           server-name: 'Nordix Gerrit'
208           trigger-on:
209             - patchset-created-event:
210                 exclude-drafts: 'false'
211                 exclude-trivial-rebase: 'false'
212                 exclude-no-code-change: 'false'
213             - draft-published-event
214             - comment-added-contains-event:
215                 comment-contains-value: 'recheck'
216             - comment-added-contains-event:
217                 comment-contains-value: 'reverify'
218           projects:
219             - project-compare-type: 'REG_EXP'
220               project-pattern: '{gated-projects}'
221               branches:
222                 - branch-compare-type: 'ANT'
223                   branch-pattern: '**/{branch}'
224               disable-strict-forbidden-file-verification: 'true'
225               forbidden-file-paths:
226                 - compare-type: ANT
227                   pattern: 'docs/**|releasenotes/**'
228           skip-vote:
229             successful: '{obj:successful}'
230             failed: '{obj:failed}'
231             unstable: '{obj:unstable}'
232             notbuilt: '{obj:notbuilt}'
233           custom-url: '* $JOB_NAME $BUILD_URL'
234           readable-message: 'true'
235           dependency-jobs: 'engine-verify-tox-{stream},engine-verify-package-{distro}-{stream}'
236
237     builders:
238       - multijob:
239           name: "{environment-type} deployment on {type} instances"
240           condition: SUCCESSFUL
241           execution-type: PARALLEL
242           projects:
243             - name: 'engine-verify-{environment-type}-deploy-{distro}-city-{type}-master'
244               current-parameters: true
245               git-revision: true
246               node-parameters: true
247               kill-phase-on: FAILURE
248               abort-all-job: false
249       - multijob:
250           name: "{environment-type} testing on {type} instances"
251           condition: SUCCESSFUL
252           execution-type: PARALLEL
253           projects:
254             - name: 'engine-verify-{environment-type}-functest-{distro}-city-{type}-master'
255               current-parameters: true
256               git-revision: false
257               node-parameters: true
258               kill-phase-on: FAILURE
259               abort-all-job: false
260
261     publishers:
262       - postbuildscript:
263           builders:
264             - role: SLAVE
265               build-on:
266                 - SUCCESS
267                 - FAILURE
268                 - ABORTED
269                 - NOT_BUILT
270                 - UNSTABLE
271               build-steps:
272                 - 'wait-pkg-mgr-macro'
273                 - 'delete-stack-macro'
274
275 - job-template:
276     name: 'engine-verify-{environment-type}-{phase}-{distro}-{cloud}-{type}-{stream}'
277
278     disabled: '{obj:disabled}'
279
280     concurrent: true
281
282     properties:
283       - logrotate
284       - throttle:
285           max-per-node: 1
286           max-total: 3
287           option: project
288
289     wrappers:
290       - build-timeout:
291           timeout: 180
292       - credentials-binding:
293           - file:
294               credential-id: '{openrc-credentials-file}'
295               variable: OPENRC_FILE
296           - username-password-separated:
297               credential-id: 'nordix-cicd-arm-credentials'
298               username: NORDIX_ARM_USERNAME
299               password: NORDIX_ARM_TOKEN
300       - mask-passwords
301       - fix-workspace-permissions
302
303     scm:
304       - git-scm-gerrit:
305           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
306           branch: '{branch}'
307           refspec: $GERRIT_REFSPEC
308           wipe_workspace: true
309           clean_before: false
310
311     builders:
312       - 'generate-ssh-keypair-macro'
313       - 'wait-pkg-mgr-macro'
314       - 'download-artifact-macro'
315       - '{phase}-macro'