OPENDEV: Add additional parameters to SCM module
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-engine.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying cloud-infra
23 # engine from the tip of the master branch periodically to check the stability of it.
24 #
25 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
26 # The slaves have
27 #   - Ubuntu1604 as the base distro
28 #   - nested virtualization
29 #   - internet access
30 #   - passwordless sudo
31 #   - 16 CPUs/32GB RAM/200 GB Disk
32 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
33 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
34 #
35 # The slaves should not have a cloud infra scenario deployed on them.
36 #--------------------------------------------------------------------------------------
37
38 - project:
39     name: 'cloud-infra-periodic-engine'
40
41     project: 'infra/engine'
42
43     stream:
44       - 'master':
45           branch: '{stream}'
46           disabled: 'false'
47
48     distro:
49       - ubuntu1804:
50           disabled: 'false'
51       - centos7:
52           disabled: 'true'
53
54     type:
55       - virtual:
56           slave-label: 'vpod-deploy-city'
57           yardstick-dispatcher: 'file'
58           build-trigger: 'H H/3 * * *'
59       - baremetal:
60           slave-label: 'baremetal-deploy'
61           yardstick-dispatcher: 'influxdb'
62           build-trigger: '@daily'
63
64     phase:
65       - deploy:
66           build-timeout: 60
67       - functest:
68           build-timeout: 120
69       - yardstick:
70           build-timeout: 30
71
72     jobs:
73       - 'cloud-infra-periodic-engine-{distro}-{type}-{stream}'
74       - 'cloud-infra-periodic-{distro}-{phase}-{type}-{stream}'
75
76 - job-template:
77     name: 'cloud-infra-periodic-engine-{distro}-{type}-{stream}'
78
79     project-type: multijob
80
81     disabled: '{obj:disabled}'
82
83     concurrent: true
84
85     parameters:
86       - project-parameters:
87           project: '{project}'
88           branch: '{branch}'
89       - nordix-gerrit-parameters
90       - label:
91           name: SLAVE_LABEL
92           default: '{slave-label}'
93           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
94       - string:
95           name: DISTRO
96           default: '{distro}'
97           description: 'Distribution to use for configuring target nodes (networking etc.)'
98       - string:
99           name: DEPLOY_TYPE
100           default: '{type}'
101           description: 'Type of the deployment'
102       - string:
103           name: USE_PREBUILT_DEPLOYMENT_IMAGE
104           default: 'true'
105           description: 'Use prebuilt deployment image while running as part of CI/CD'
106       - string:
107           name: INSTALLER_TYPE
108           default: 'kubespray'
109           description: 'Installer to use for deploying the scenario'
110       - string:
111           name: DEPLOY_SCENARIO
112           default: 'k8-calico-nofeature'
113           description: 'Scenario to deploy and test'
114       - string:
115           name: TEST_SUITE
116           default: 'smoke'
117           description: 'Test suite to run'
118       - string:
119           name: YARDSTICK_DISPATCHER
120           default: '{yardstick-dispatcher}'
121           description: 'Dispatcher to use for Yardstick reporting'
122       - string:
123           name: CLEANUP
124           default: 'true'
125           description: 'Cleanup leftovers of the previous run'
126
127     properties:
128       - logrotate
129       - build-blocker:
130           use-build-blocker: true
131           blocking-jobs:
132             - 'cloud-infra-verify-engine-.*'
133             - 'cloud-infra-verify-scenario-.*'
134             - 'cloud-infra-periodic-engine-.*'
135             - 'k8-.*'
136           block-level: 'NODE'
137       - throttle:
138           max-per-node: 1
139           max-total: 3
140           option: project
141
142     wrappers:
143       - build-timeout:
144           timeout: 210
145       - fix-workspace-permissions
146
147     scm:
148       - git-scm:
149           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
150           branch: '{branch}'
151           refspec: ''
152           wipe_workspace: true
153           clean_before: false
154
155     triggers:
156       - timed: '{build-trigger}'
157
158     builders:
159       - multijob:
160           name: deploy
161           condition: SUCCESSFUL
162           projects:
163             - name: 'cloud-infra-periodic-{distro}-deploy-{type}-{stream}'
164               current-parameters: true
165               predefined-parameters: |
166                 DISTRO=$DISTRO
167                 DEPLOY_TYPE=$DEPLOY_TYPE
168                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
169                 INSTALLER_TYPE=$INSTALLER_TYPE
170                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
171                 CLEANUP=$CLEANUP
172               git-revision: true
173               node-parameters: true
174               kill-phase-on: FAILURE
175               abort-all-job: true
176       - multijob:
177           name: functest
178           condition: ALWAYS
179           projects:
180             - name: 'cloud-infra-periodic-{distro}-functest-{type}-{stream}'
181               current-parameters: true
182               predefined-parameters: |
183                 DISTRO=$DISTRO
184                 DEPLOY_TYPE=$DEPLOY_TYPE
185                 INSTALLER_TYPE=$INSTALLER_TYPE
186                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
187                 TEST_SUITE=$TEST_SUITE
188                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
189                 CLEANUP=$CLEANUP
190               node-parameters: true
191               kill-phase-on: NEVER
192               abort-all-job: false
193       - multijob:
194           name: yardstick
195           condition: ALWAYS
196           projects:
197             - name: 'cloud-infra-periodic-{distro}-yardstick-{type}-{stream}'
198               current-parameters: true
199               predefined-parameters: |
200                 DISTRO=$DISTRO
201                 DEPLOY_TYPE=$DEPLOY_TYPE
202                 INSTALLER_TYPE=$INSTALLER_TYPE
203                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
204                 TEST_SUITE=$TEST_SUITE
205                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
206                 CLEANUP=$CLEANUP
207               node-parameters: true
208               kill-phase-on: NEVER
209               abort-all-job: false
210
211 - job-template:
212     name: 'cloud-infra-periodic-{distro}-{phase}-{type}-{stream}'
213
214     disabled: false
215
216     concurrent: true
217
218     properties:
219       - logrotate
220
221     parameters:
222       - string:
223           name: PROJECT
224           default: $GERRIT_PROJECT
225       - string:
226           name: DISTRO
227           default: 'ubuntu1804'
228           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
229       - string:
230           name: DEPLOY_TYPE
231           default: 'virtual'
232           description: 'Type of the deployment. Overriden by upstream job.'
233       - string:
234           name: USE_PREBUILT_DEPLOYMENT_IMAGE
235           default: 'false'
236           description: 'Use prebuilt deployment image while running as part of CI/CD'
237       - string:
238           name: ENGINE_ANSIBLE_PARAMS
239           default: ' -v '
240           description: 'Extra paramters that can be added when run the play books.'
241       - string:
242           name: INSTALLER_TYPE
243           default: 'kubespray'
244           description: 'Installer to use for deploying the scenario'
245       - string:
246           name: DEPLOY_SCENARIO
247           default: 'k8-calico-nofeature'
248           description: 'Scenario to deploy and test'
249       - string:
250           name: TEST_FW
251           default: '{phase}'
252           description: 'Test framework to use'
253       - string:
254           name: TEST_SUITE
255           default: 'smoke'
256           description: 'Test suite to run'
257       - string:
258           name: TEST_REPO_URL
259           default: 'https://gerrit.nordix.org/infra/test.git'
260           description: 'URL to Nordix Cloud Infra test repository'
261       - string:
262           name: YARDSTICK_DISPATCHER
263           default: 'file'
264           description: 'Dispatcher to use for Yardstick reporting'
265       - string:
266           name: CLEANUP
267           default: 'false'
268
269     wrappers:
270       - build-timeout:
271           timeout: '{build-timeout}'
272       - fix-workspace-permissions
273
274     scm:
275       - git-scm:
276           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
277           branch: '{branch}'
278           refspec: ''
279           wipe_workspace: true
280           clean_before: false
281
282     builders:
283       - 'cloud-infra-{phase}-macro'
284
285 # vim: set ts=2 sw=2 expandtab: