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