engine: Enable testing of online deployments
[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           successful: false
35           failed: false
36           unstable: false
37           notbuilt: false
38       - offline:
39           disabled: false
40           execution-mode: offline-deployment
41           successful: true
42           failed: true
43           unstable: true
44           notbuilt: true
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-packaging-{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: VERBOSITY
77           default: 'true'
78           description: 'Verbosity setting for the engine - true or false - default is false'
79       - string:
80           name: NORDIX_ARM_PUBLIC_IP
81           default: '91.106.198.25'
82           description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
83       - string:
84           name: NORDIX_ARM_HTTPS_URL
85           default: 'https://artifactory.nordix.org/artifactory'
86           description: 'URL to Nordix Artifactory'
87       - string:
88           name: NORDIX_ARM_REPO
89           default: 'nordix-kubernetes'
90           description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
91       - string:
92           name: NORDIX_ARTIFACT_URL
93           default: "$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/change/$GERRIT_CHANGE_NUMBER/k8s-installer-ubuntu1804.bsx"
94           description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
95       - label:
96           name: SLAVE_LABEL
97           default: 'engine-master-{environment-type}-{distro}'
98           description: 'Slave label to schedule this job on.'
99       - project-parameters:
100           project: $GERRIT_PROJECT
101           branch: '{branch}'
102           description: 'The project and branch which the change is proposed for'
103       - nordix-gerrit-parameters
104
105     properties:
106       - logrotate
107 #      - build-blocker:
108 #          use-build-blocker: true
109 #          blocking-jobs:
110 #            - 'engine-verify-online-ubuntu1804.*'
111 #            - 'engine-verify-offline-ubuntu1804.*'
112 #          block-level: 'NODE'
113       - throttle:
114           max-per-node: 1
115           max-total: 3
116           option: project
117
118     wrappers:
119       - build-timeout:
120           timeout: 180
121       - mask-passwords
122       - fix-workspace-permissions
123       - openstack:
124           single-use: True
125
126     scm:
127       - git-scm-gerrit:
128           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
129           branch: '{branch}'
130           refspec: $GERRIT_REFSPEC
131           wipe_workspace: true
132           clean_before: false
133
134     triggers:
135       - gerrit:
136           server-name: 'Nordix Gerrit'
137           trigger-on:
138             - patchset-created-event:
139                 exclude-drafts: 'false'
140                 exclude-trivial-rebase: 'false'
141                 exclude-no-code-change: 'false'
142             - draft-published-event
143             - comment-added-contains-event:
144                 comment-contains-value: 'recheck'
145             - comment-added-contains-event:
146                 comment-contains-value: 'reverify'
147           projects:
148             - project-compare-type: 'REG_EXP'
149               project-pattern: '{gated-projects}'
150               branches:
151                 - branch-compare-type: 'ANT'
152                   branch-pattern: '**/{branch}'
153               disable-strict-forbidden-file-verification: 'true'
154               forbidden-file-paths:
155                 - compare-type: ANT
156                   pattern: 'docs/**'
157           skip-vote:
158             successful: '{obj:successful}'
159             failed: '{obj:failed}'
160             unstable: '{obj:unstable}'
161             notbuilt: '{obj:notbuilt}'
162           custom-url: '* $JOB_NAME $BUILD_URL'
163           readable-message: 'true'
164
165     builders:
166       - multijob:
167           name: packaging
168           condition: SUCCESSFUL
169           execution-type: PARALLEL
170           projects:
171             - name: 'engine-verify-packaging-{distro}-{stream}'
172               current-parameters: true
173               node-parameters: true
174               kill-phase-on: FAILURE
175               abort-all-job: true
176 #             enable-condition: "\"$EXECUTION_MODE\" == \"offline-deployment\""
177       - multijob:
178           name: "{environment-type} deployment and testing"
179           condition: SUCCESSFUL
180           execution-type: PARALLEL
181           projects:
182             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-virtual-master'
183               current-parameters: false
184               node-parameters: false
185               predefined-parameters: |
186                 GIT_BASE_SSH=$GIT_BASE_SSH
187                 GERRIT_PROJECT=$GERRIT_PROJECT
188                 GERRIT_BRANCH=$GERRIT_BRANCH
189                 GERRIT_REFSPEC=$GERRIT_REFSPEC
190                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
191                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
192                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
193                 PROJECT=$GERRIT_PROJECT
194                 BRANCH=$BRANCH
195                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
196                 NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
197                 EXECUTION_MODE=$EXECUTION_MODE
198                 VERBOSITY=$VERBOSITY
199                 DISTRO=$DISTRO
200               property-file: "$WORKSPACE/change.properties"
201               kill-phase-on: FAILURE
202               abort-all-job: true
203             - name: 'engine-verify-{environment-type}-deploy-test-{distro}-city-cloud-master'
204               current-parameters: false
205               node-parameters: false
206               predefined-parameters: |
207                 GIT_BASE_SSH=$GIT_BASE_SSH
208                 GERRIT_PROJECT=$GERRIT_PROJECT
209                 GERRIT_BRANCH=$GERRIT_BRANCH
210                 GERRIT_REFSPEC=$GERRIT_REFSPEC
211                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
212                 GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
213                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
214                 PROJECT=$GERRIT_PROJECT
215                 BRANCH=$BRANCH
216                 NORDIX_ARM_PUBLIC_IP=$NORDIX_ARM_PUBLIC_IP
217                 NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
218                 EXECUTION_MODE=$EXECUTION_MODE
219                 VERBOSITY=$VERBOSITY
220                 DISTRO=$DISTRO
221               kill-phase-on: FAILURE
222               abort-all-job: true
223
224 - job-template:
225     name: 'engine-verify-packaging-{distro}-{stream}'
226
227     disabled: '{obj:disabled}'
228
229     concurrent: true
230
231     properties:
232       - logrotate
233       - throttle:
234           max-per-node: 1
235           max-total: 3
236           option: project
237
238     wrappers:
239       - build-timeout:
240           timeout: 70
241       - credentials-binding:
242           - username-password-separated:
243               credential-id: 'nordix-cicd-arm-credentials'
244               username: NORDIX_ARM_USERNAME
245               password: NORDIX_ARM_TOKEN
246       - mask-passwords
247       - fix-workspace-permissions
248
249     scm:
250       - git-scm-gerrit:
251           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
252           branch: '{branch}'
253           refspec: $GERRIT_REFSPEC
254           wipe_workspace: true
255           clean_before: false
256
257     builders:
258       - 'engine-wait-pkg-mgr-macro'
259       - 'engine-generate-ssh-keypair-macro'
260       - 'engine-packaging-macro'
261       - 'engine-upload-artifact-macro'