engine: Run tox job first before running anything else
[infra/cicd.git] / jjb / engine / verify-jobs / engine-verify-deployment-parent-jobs.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-deployment'
22
23     project: 'engine-deployment'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28           gated-projects: 'infra\/engine'
29
30     environment-type:
31       - online:
32           disabled: false
33           execution-mode: online-deployment
34           successful: false
35           failed: false
36           unstable: false
37           notbuilt: false
38       - offline:
39           disabled: false
40           execution-mode: offline-deployment
41           successful: false
42           failed: false
43           unstable: false
44           notbuilt: false
45
46     distro:
47       - ubuntu1804
48
49     cloud:
50       - city:
51           openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
52
53     jobs:
54       - 'engine-verify-{environment-type}-{distro}-{cloud}-{stream}'
55       - 'engine-verify-package-{distro}-{stream}'
56
57 - job-template:
58     name: 'engine-verify-{environment-type}-{distro}-{cloud}-{stream}'
59
60     project-type: multijob
61
62     disabled: '{obj:disabled}'
63
64     concurrent: true
65
66     parameters:
67       - string:
68           name: EXECUTION_MODE
69           default: '{execution-mode}'
70           description: 'Engine execution mode - online-deployment or offline-deployment - default is online-deployment'
71       - string:
72           name: DISTRO
73           default: '{distro}'
74           description: 'Distribution to use for configuring target nodes (networking etc.)'
75       - string:
76           name: INSTALLER_TYPE
77           default: 'kubespray'
78           description: 'Installer type to use'
79       - string:
80           name: DEPLOY_SCENARIO
81           default: 'k8-calico-nofeature'
82           description: 'Scenario to deploy and test'
83       - string:
84           name: VERBOSITY
85           default: 'true'
86           description: 'Verbosity setting for the engine - true or false - default is false'
87       - string:
88           name: ARTIFACTS_TO_UPLOAD
89           default: "k8s-installer-ubuntu1804.bsx"
90           description: 'Artifacts to upload'
91       - string:
92           name: ARTIFACT_TO_DOWNLOAD
93           default: "k8s-installer-ubuntu1804.bsx"
94           description: 'Artifact to download'
95       - string:
96           name: NORDIX_ARM_PUBLIC_IP
97           default: '91.106.198.25'
98           description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
99       - string:
100           name: NORDIX_ARM_HTTPS_URL
101           default: 'https://artifactory.nordix.org/artifactory'
102           description: 'URL to Nordix Artifactory'
103       - string:
104           name: NORDIX_ARM_REPO
105           default: 'nordix-kubernetes'
106           description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
107       - string:
108           name: CI_LOOP
109           default: 'verify'
110           description: 'CI loop type'
111       - label:
112           name: SLAVE_LABEL
113           default: 'engine-master-{environment-type}-{distro}'
114           description: 'Slave label to schedule this job on.'
115       - project-parameters:
116           project: $GERRIT_PROJECT
117           branch: '{branch}'
118           description: 'The project and branch which the change is proposed for'
119       - nordix-gerrit-parameters
120
121     properties:
122       - logrotate
123       - throttle:
124           max-per-node: 1
125           max-total: 3
126           option: project
127
128     wrappers:
129       - build-timeout:
130           timeout: 180
131       - mask-passwords
132       - fix-workspace-permissions
133       - openstack:
134           single-use: True
135
136     scm:
137       - git-scm-gerrit:
138           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
139           branch: '{branch}'
140           refspec: $GERRIT_REFSPEC
141           wipe_workspace: true
142           clean_before: false
143
144     triggers:
145       - gerrit:
146           server-name: 'Nordix Gerrit'
147           trigger-on:
148             - patchset-created-event:
149                 exclude-drafts: 'false'
150                 exclude-trivial-rebase: 'false'
151                 exclude-no-code-change: 'false'
152             - draft-published-event
153             - comment-added-contains-event:
154                 comment-contains-value: 'recheck'
155             - comment-added-contains-event:
156                 comment-contains-value: 'reverify'
157           projects:
158             - project-compare-type: 'REG_EXP'
159               project-pattern: '{gated-projects}'
160               branches:
161                 - branch-compare-type: 'ANT'
162                   branch-pattern: '**/{branch}'
163               disable-strict-forbidden-file-verification: 'true'
164               forbidden-file-paths:
165                 - compare-type: ANT
166                   pattern: 'docs/**|releasenotes/**'
167           skip-vote:
168             successful: '{obj:successful}'
169             failed: '{obj:failed}'
170             unstable: '{obj:unstable}'
171             notbuilt: '{obj:notbuilt}'
172           custom-url: '* $JOB_NAME $BUILD_URL'
173           readable-message: 'true'
174           dependency-jobs: 'engine-verify-tox-{stream}'
175
176     builders:
177       - 'generate-ssh-keypair-macro'
178       - 'generate-build-metadata-macro'
179       - 'wait-pkg-mgr-macro'
180       - multijob:
181           name: package
182           condition: SUCCESSFUL
183           execution-type: PARALLEL
184           projects:
185             - name: 'engine-verify-package-{distro}-{stream}'
186               current-parameters: true
187               node-parameters: true
188               property-file: "$WORKSPACE/build.properties"
189               kill-phase-on: FAILURE
190               abort-all-job: true
191       - multijob:
192           name: "{environment-type} deployment and testing"
193           condition: SUCCESSFUL
194           execution-type: PARALLEL
195           projects:
196             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-virtual-master'
197               current-parameters: false
198               node-parameters: false
199               predefined-parameters: |
200                 GIT_BASE_SSH=$GIT_BASE_SSH
201                 GERRIT_PROJECT=$GERRIT_PROJECT
202                 GERRIT_BRANCH=$GERRIT_BRANCH
203                 GERRIT_REFSPEC=$GERRIT_REFSPEC
204                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
205                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
206                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
207                 PROJECT=$GERRIT_PROJECT
208                 BRANCH=$BRANCH
209                 ARTIFACT_TO_DOWNLOAD=$ARTIFACT_TO_DOWNLOAD
210                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
211                 EXECUTION_MODE=$EXECUTION_MODE
212                 VERBOSITY=$VERBOSITY
213                 DISTRO=$DISTRO
214                 INSTALLER_TYPE=$INSTALLER_TYPE
215                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
216               property-file: "$WORKSPACE/build.properties"
217               kill-phase-on: FAILURE
218               abort-all-job: false
219             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-cloud-master'
220               current-parameters: false
221               node-parameters: false
222               predefined-parameters: |
223                 GIT_BASE_SSH=$GIT_BASE_SSH
224                 GERRIT_PROJECT=$GERRIT_PROJECT
225                 GERRIT_BRANCH=$GERRIT_BRANCH
226                 GERRIT_REFSPEC=$GERRIT_REFSPEC
227                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
228                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
229                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
230                 PROJECT=$GERRIT_PROJECT
231                 BRANCH=$BRANCH
232                 ARTIFACT_TO_DOWNLOAD=$ARTIFACT_TO_DOWNLOAD
233                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
234                 EXECUTION_MODE=$EXECUTION_MODE
235                 VERBOSITY=$VERBOSITY
236                 DISTRO=$DISTRO
237                 INSTALLER_TYPE=$INSTALLER_TYPE
238                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
239               property-file: "$WORKSPACE/build.properties"
240               kill-phase-on: FAILURE
241               abort-all-job: false
242
243 - job-template:
244     name: 'engine-verify-package-{distro}-{stream}'
245
246     disabled: '{obj:disabled}'
247
248     concurrent: true
249
250     properties:
251       - logrotate
252       - throttle:
253           max-per-node: 1
254           max-total: 3
255           option: project
256
257     wrappers:
258       - build-timeout:
259           timeout: 70
260       - credentials-binding:
261           - username-password-separated:
262               credential-id: 'nordix-cicd-arm-credentials'
263               username: NORDIX_ARM_USERNAME
264               password: NORDIX_ARM_TOKEN
265       - mask-passwords
266       - fix-workspace-permissions
267
268     scm:
269       - git-scm-gerrit:
270           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
271           branch: '{branch}'
272           refspec: $GERRIT_REFSPEC
273           wipe_workspace: true
274           clean_before: false
275
276     builders:
277       - 'package-macro'
278       - 'upload-artifact-macro'