bugfix: Use correct macros for cloud-infra-verify-engine jobs
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-verify-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 patches
23 # that are sent to the repositories below
24 #   - cloud-infra/engine
25 #
26 # These jobs verify changes that
27 #   - implement new features or fix bugs for the deployment framework, engine, itself
28 #   - implement new features or fix bugs to the playbooks and roles used for utilizing
29 #     open source components such as bifrost, kubespray, and kolla-ansible
30 #   - bump versions of open source components or the scenarios
31 #
32 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
33 # The slaves have
34 #   - Ubuntu1604 as the base distro
35 #   - nested virtualization
36 #   - internet access
37 #   - passwordless sudo
38 #   - 16 CPUs/32GB RAM/200 GB Disk
39 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
40 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
41 #
42 # The slaves should not have a cloud infra scenario deployed on them.
43 #--------------------------------------------------------------------------------------
44
45 - project:
46     name: 'cloud-infra-verify-engine'
47
48     project: 'infra/engine'
49
50     stream:
51       - 'master':
52           branch: '{stream}'
53           disabled: 'false'
54
55     os:
56       - ubuntu1804:
57           disabled: 'false'
58           distribution: 'ubuntu18'
59           ipa_dib_os_element: 'coreos'
60           dib_os_release: 'bionic'
61           dib_os_element: 'ubuntu-minimal'
62       - centos7:
63           disabled: 'true'
64           distribution: 'centos7'
65           ipa_dib_os_element: 'coreos'
66           dib_os_release: '7'
67           dib_os_element: 'centos-minimal'
68
69     type:
70       - virtual
71
72     phase:
73       - deploy
74       - functest
75
76     jobs:
77       - 'cloud-infra-verify-engine-{os}-{type}-{stream}'
78       - 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
79
80 - job-template:
81     name: 'cloud-infra-verify-engine-{os}-{type}-{stream}'
82
83     project-type: multijob
84
85     disabled: '{obj:disabled}'
86
87     concurrent: true
88
89     parameters:
90       - project-parameters:
91           project: '{project}'
92           branch: '{branch}'
93       - nordix-gerrit-parameters
94       - label:
95           name: SLAVE_LABEL
96           default: 'vpod-deploy-{os}'
97           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
98       - string:
99           name: DISTRIBUTION
100           default: '{distribution}'
101           description: 'Distribution to use for configuring target nodes (networking etc.)'
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: IPA_DIB_OS_ELEMENT
108           default: '{ipa_dib_os_element}'
109           description: 'DIB OS Element to use for building the ramdisk image'
110       - string:
111           name: DIB_OS_RELEASE
112           default: '{dib_os_release}'
113           description: 'DIB OS Release to use for building the deployment image to provision target nodes with'
114       - string:
115           name: DIB_OS_ELEMENT
116           default: '{dib_os_element}'
117           description: 'DIB OS Element to use for building the deployment image to provision target nodes with'
118       - string:
119           name: DEPLOY_SCENARIO
120           default: 'k8-calico-nofeature'
121           description: 'Scenario to deploy and test'
122       - string:
123           name: TEST_SUITE
124           default: 'healthcheck'
125           description: 'Test suite to run'
126       - string:
127           name: CLEANUP
128           default: 'true'
129           description: 'Cleanup leftovers of the previous run'
130
131     properties:
132       - logrotate
133       - build-blocker:
134           use-build-blocker: true
135           blocking-jobs:
136             - 'cloud-infra-verify-engine-{os}-.*'
137             - 'cloud-infra-periodic-engine-{os}-.*'
138             - 'cloud-infra-os-.*'
139             - 'cloud-infra-k8-.*'
140           block-level: 'NODE'
141       - throttle:
142           max-per-node: 1
143           max-total: 3
144           option: project
145
146     wrappers:
147       - build-timeout:
148           timeout: 120
149       - fix-workspace-permissions
150       - openstack:
151           single-use: True
152
153     scm:
154       - git-scm-gerrit:
155           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
156           branch: '{branch}'
157           refspec: $GERRIT_REFSPEC
158
159     triggers:
160       - nordix-gerrit-trigger-patchset-created:
161           project: 'infra\/engine'
162           branch: '{branch}'
163           files: '**'
164
165     builders:
166       - multijob:
167           name: deploy
168           condition: SUCCESSFUL
169           projects:
170             - name: 'cloud-infra-verify-{os}-deploy-{type}-{stream}'
171               current-parameters: true
172               predefined-parameters: |
173                 DISTRIBUTION=$DISTRIBUTION
174                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
175                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
176                 DIB_OS_RELEASE=$DIB_OS_RELEASE
177                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
178                 CLEANUP=$CLEANUP
179                 GERRIT_PROJECT=$GERRIT_PROJECT
180                 GERRIT_BRANCH=$GERRIT_BRANCH
181                 GERRIT_REFSPEC=$GERRIT_REFSPEC
182                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
183                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
184               node-parameters: true
185               kill-phase-on: FAILURE
186               abort-all-job: true
187       - multijob:
188           name: functest
189           condition: SUCCESSFUL
190           projects:
191             - name: 'cloud-infra-verify-{os}-functest-{type}-{stream}'
192               current-parameters: true
193               predefined-parameters: |
194                 DISTRIBUTION=$DISTRIBUTION
195                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
196                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
197                 DIB_OS_RELEASE=$DIB_OS_RELEASE
198                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
199                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
200                 TEST_SUITE=$TEST_SUITE
201                 CLEANUP=$CLEANUP
202                 GERRIT_PROJECT=$GERRIT_PROJECT
203                 GERRIT_BRANCH=$GERRIT_BRANCH
204                 GERRIT_REFSPEC=$GERRIT_REFSPEC
205                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
206                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
207               node-parameters: true
208               kill-phase-on: FAILURE
209               abort-all-job: true
210
211 - job-template:
212     name: 'cloud-infra-verify-{os}-{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: DISTRIBUTION
227           default: 'ubuntu18'
228           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
229       - string:
230           name: USE_PREBUILT_DEPLOYMENT_IMAGE
231           default: 'false'
232           description: 'Use prebuilt deployment image while running as part of CI/CD'
233       - string:
234           name: IPA_DIB_OS_ELEMENT
235           default: 'fedora'
236           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
237       - string:
238           name: DIB_OS_RELEASE
239           default: 'bionic'
240           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
241       - string:
242           name: DIB_OS_ELEMENT
243           default: 'ubuntu-minimal'
244           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
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: 'healthcheck'
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: CLEANUP
263           default: 'false'
264
265     wrappers:
266       - build-timeout:
267           timeout: 120
268       - fix-workspace-permissions
269
270     scm:
271       - git-scm-gerrit:
272           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
273           branch: '{branch}'
274           refspec: $GERRIT_REFSPEC
275
276     builders:
277       - 'cloud-infra-verify-{phase}-macro'
278
279 # -------------------------------
280 # builder macros
281 # -------------------------------
282
283 - builder:
284     name: 'cloud-infra-verify-deploy-macro'
285     builders:
286       - shell:
287           !include-raw: ./wait-for-pkg-manager.sh
288       - shell:
289           !include-raw: ./cloud-infra-deploy.sh
290
291 - builder:
292     name: 'cloud-infra-verify-functest-macro'
293     builders:
294       - shell:
295           !include-raw: ./prepare-for-test.sh
296       - shell:
297           !include-raw: ./cloud-infra-test.sh
298
299 # vim: set ts=2 sw=2 expandtab: