3121a3d6f58e95ca5656bb9156e0f246236bbc4d
[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/**'
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
175     builders:
176       - 'generate-ssh-keypair-macro'
177       - 'generate-build-metadata-macro'
178       - 'wait-pkg-mgr-macro'
179       - multijob:
180           name: package
181           condition: SUCCESSFUL
182           execution-type: PARALLEL
183           projects:
184             - name: 'engine-verify-package-{distro}-{stream}'
185               current-parameters: true
186               node-parameters: true
187               property-file: "$WORKSPACE/build.properties"
188               kill-phase-on: FAILURE
189               abort-all-job: true
190       - multijob:
191           name: "{environment-type} deployment and testing"
192           condition: SUCCESSFUL
193           execution-type: PARALLEL
194           projects:
195             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-virtual-master'
196               current-parameters: false
197               node-parameters: false
198               predefined-parameters: |
199                 GIT_BASE_SSH=$GIT_BASE_SSH
200                 GERRIT_PROJECT=$GERRIT_PROJECT
201                 GERRIT_BRANCH=$GERRIT_BRANCH
202                 GERRIT_REFSPEC=$GERRIT_REFSPEC
203                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
204                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
205                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
206                 PROJECT=$GERRIT_PROJECT
207                 BRANCH=$BRANCH
208                 ARTIFACT_TO_DOWNLOAD=$ARTIFACT_TO_DOWNLOAD
209                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
210                 EXECUTION_MODE=$EXECUTION_MODE
211                 VERBOSITY=$VERBOSITY
212                 DISTRO=$DISTRO
213                 INSTALLER_TYPE=$INSTALLER_TYPE
214                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
215               property-file: "$WORKSPACE/build.properties"
216               kill-phase-on: FAILURE
217               abort-all-job: false
218             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-cloud-master'
219               current-parameters: false
220               node-parameters: false
221               predefined-parameters: |
222                 GIT_BASE_SSH=$GIT_BASE_SSH
223                 GERRIT_PROJECT=$GERRIT_PROJECT
224                 GERRIT_BRANCH=$GERRIT_BRANCH
225                 GERRIT_REFSPEC=$GERRIT_REFSPEC
226                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
227                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
228                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
229                 PROJECT=$GERRIT_PROJECT
230                 BRANCH=$BRANCH
231                 ARTIFACT_TO_DOWNLOAD=$ARTIFACT_TO_DOWNLOAD
232                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
233                 EXECUTION_MODE=$EXECUTION_MODE
234                 VERBOSITY=$VERBOSITY
235                 DISTRO=$DISTRO
236                 INSTALLER_TYPE=$INSTALLER_TYPE
237                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
238               property-file: "$WORKSPACE/build.properties"
239               kill-phase-on: FAILURE
240               abort-all-job: false
241
242 - job-template:
243     name: 'engine-verify-package-{distro}-{stream}'
244
245     disabled: '{obj:disabled}'
246
247     concurrent: true
248
249     properties:
250       - logrotate
251       - throttle:
252           max-per-node: 1
253           max-total: 3
254           option: project
255
256     wrappers:
257       - build-timeout:
258           timeout: 70
259       - credentials-binding:
260           - username-password-separated:
261               credential-id: 'nordix-cicd-arm-credentials'
262               username: NORDIX_ARM_USERNAME
263               password: NORDIX_ARM_TOKEN
264       - mask-passwords
265       - fix-workspace-permissions
266
267     scm:
268       - git-scm-gerrit:
269           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
270           branch: '{branch}'
271           refspec: $GERRIT_REFSPEC
272           wipe_workspace: true
273           clean_before: false
274
275     builders:
276       - 'package-macro'
277       - 'upload-artifact-macro'