7f3b903140b5d6c3158f5d22e1637ee10acf7b9e
[infra/cicd.git] / jjb / engine / engine-verify-jobs / engine-verify-online-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-online-deploy-test'
22
23     project: 'engine-verify-online-deploy-test'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28
29     phase:
30       - deploy
31       - test
32
33     type:
34       - virtual:
35           provisioner-type: 'bifrost'
36           slave-type: 'vpod'
37       - cloud:
38           provisioner-type: 'heat'
39           slave-type: 'jumphost'
40
41     distro:
42       - ubuntu1804
43
44     cloud:
45       - city:
46           openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
47
48     jobs:
49       - 'engine-verify-online-deploy-test-{distro}-{cloud}-{type}-{stream}'
50       - 'engine-verify-online-{phase}-{distro}-{cloud}-{type}-{stream}'
51
52 - job-template:
53     name: 'engine-verify-online-deploy-test-{distro}-{cloud}-{type}-{stream}'
54
55     project-type: multijob
56
57     disabled: '{obj:disabled}'
58
59     concurrent: true
60
61     parameters:
62       - project-parameters:
63           project: $GERRIT_PROJECT
64           branch: '{branch}'
65           description: 'The project and branch which the change is proposed for'
66       - label:
67           name: SLAVE_LABEL
68           default: 'engine-{slave-type}-online-{distro}'
69           description: 'Slave label to schedule this job on.'
70       - string:
71           name: PROVISIONER_TYPE
72           default: '{provisioner-type}'
73           description: 'Provisioner type to use'
74       - string:
75           name: HEAT_ENVIRONMENT_FILENAME
76           default: 'heat-environment-{cloud}-{distro}.yaml'
77           description: 'Name of heat-environment file to use.'
78       - string:
79           name: STACK_NAME
80           default: "nordix-cicd-verify-engine-online-{distro}-$GERRIT_CHANGE_NUMBER"
81           description: 'Name of the created stack'
82       - string:
83           name: KEYPAIR_NAME
84           default: "keypair-nordix-cicd-verify-online-engine-{distro}-$GERRIT_CHANGE_NUMBER"
85           description: 'Name of the created keypair'
86       - string:
87           name: USE_PREBUILT_DEPLOYMENT_IMAGE
88           default: 'true'
89           description: 'Use prebuilt deployment image while running as part of CI/CD'
90       - string:
91           name: TEST_REPO_URL
92           default: 'https://gerrit.nordix.org/infra/test.git'
93           description: 'URL to clone the test repo from'
94       - string:
95           name: TEST_FW
96           default: 'functest'
97           description: 'Test framework to use'
98       - string:
99           name: TEST_SUITE
100           default: 'healthcheck'
101           description: 'Test suite to run'
102       - string:
103           name: DELETE_STACK
104           default: 'true'
105           description: 'Delete the stack upon completion of the build'
106
107     properties:
108       - logrotate
109       - throttle:
110           max-per-node: 1
111           max-total: 3
112           option: project
113
114     wrappers:
115       - build-timeout:
116           timeout: 180
117       - credentials-binding:
118           - file:
119               credential-id: '{openrc-credentials-file}'
120               variable: OPENRC_FILE
121           - username-password-separated:
122               credential-id: 'nordix-cicd-arm-credentials'
123               username: NORDIX_ARM_USERNAME
124               password: NORDIX_ARM_TOKEN
125       - mask-passwords
126       - fix-workspace-permissions
127       - openstack:
128           single-use: True
129
130     scm:
131       - git-scm-gerrit:
132           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
133           branch: '{branch}'
134           refspec: $GERRIT_REFSPEC
135           wipe_workspace: true
136           clean_before: false
137
138     builders:
139       - 'engine-wait-pkg-mgr-macro'
140       - 'engine-generate-ssh-keypair-macro'
141       - 'engine-download-artifact-macro'
142       - multijob:
143           name: "Online Deployment on {type} instances"
144           condition: SUCCESSFUL
145           execution-type: PARALLEL
146           projects:
147             - name: 'engine-verify-online-deploy-{distro}-city-{type}-master'
148               current-parameters: true
149               node-parameters: true
150               kill-phase-on: FAILURE
151               abort-all-job: false
152       - multijob:
153           name: "Online Testing on {type} instances"
154           condition: SUCCESSFUL
155           execution-type: PARALLEL
156           projects:
157             - name: 'engine-verify-online-test-{distro}-city-{type}-master'
158               current-parameters: true
159               node-parameters: true
160               kill-phase-on: FAILURE
161               abort-all-job: false
162
163     publishers:
164       - postbuildscript:
165           builders:
166             - role: SLAVE
167               build-on:
168                 - SUCCESS
169                 - FAILURE
170                 - ABORTED
171                 - NOT_BUILT
172                 - UNSTABLE
173               build-steps:
174                 - 'engine-wait-pkg-mgr-macro'
175                 - 'engine-delete-stack-macro'
176
177 - job-template:
178     name: 'engine-verify-online-{phase}-{distro}-{cloud}-{type}-{stream}'
179
180     disabled: '{obj:disabled}'
181
182     concurrent: true
183
184     properties:
185       - logrotate
186       - throttle:
187           max-per-node: 1
188           max-total: 3
189           option: project
190
191     wrappers:
192       - build-timeout:
193           timeout: 180
194       - credentials-binding:
195           - file:
196               credential-id: '{openrc-credentials-file}'
197               variable: OPENRC_FILE
198           - username-password-separated:
199               credential-id: 'nordix-cicd-arm-credentials'
200               username: NORDIX_ARM_USERNAME
201               password: NORDIX_ARM_TOKEN
202       - mask-passwords
203       - fix-workspace-permissions
204
205     scm:
206       - git-scm-gerrit:
207           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
208           branch: '{branch}'
209           refspec: $GERRIT_REFSPEC
210           wipe_workspace: true
211           clean_before: false
212
213     builders:
214       - 'engine-{phase}-macro'