f943ced2301e8f1ea71006afc82706fca8f5dcd4
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-verify-jobs.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 - project:
22     name: 'cloud-infra-verify'
23
24     project: 'infra/engine'
25
26     stream:
27       - 'master':
28           branch: '{stream}'
29           disabled: 'false'
30
31     os:
32       - ubuntu1604:
33           disabled: 'true'
34           distribution: 'ubuntu16'
35           ipa_dib_os_element: 'fedora'
36           dib_os_release: 'xenial'
37           dib_os_element: 'ubuntu-minimal'
38       - ubuntu1804:
39           disabled: 'false'
40           distribution: 'ubuntu18'
41           ipa_dib_os_element: 'fedora'
42           dib_os_release: 'bionic'
43           dib_os_element: 'ubuntu-minimal'
44       - centos7:
45           disabled: 'true'
46           distribution: 'centos7'
47           ipa_dib_os_element: 'fedora'
48           dib_os_release: '7'
49           dib_os_element: 'centos-minimal'
50
51     type:
52       - virtual
53
54     phase:
55       - deploy
56       - test
57
58     jobs:
59       - 'cloud-infra-verify-{os}-{type}-{stream}'
60       - 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
61
62 - job-template:
63     name: 'cloud-infra-verify-{os}-{type}-{stream}'
64
65     project-type: multijob
66
67     disabled: '{obj:disabled}'
68
69     concurrent: true
70
71     parameters:
72       - project-parameters:
73           project: '{project}'
74           branch: '{branch}'
75       - nordix-gerrit-parameters
76       - label:
77           name: SLAVE_LABEL
78           default: 'vpod-deploy-{os}'
79           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
80       - string:
81           name: DISTRIBUTION
82           default: '{distribution}'
83           description: 'Distribution to use for configuring target nodes (networking etc.)'
84       - string:
85           name: USE_PREBUILT_DEPLOYMENT_IMAGE
86           default: 'true'
87           description: 'Use prebuilt deployment image while running as part of CI/CD'
88       - string:
89           name: IPA_DIB_OS_ELEMENT
90           default: '{ipa_dib_os_element}'
91           description: 'DIB OS Element to use for building the ramdisk image'
92       - string:
93           name: DIB_OS_RELEASE
94           default: '{dib_os_release}'
95           description: 'DIB OS Release to use for building the deployment image to provision target nodes with'
96       - string:
97           name: DIB_OS_ELEMENT
98           default: '{dib_os_element}'
99           description: 'DIB OS Element to use for building the deployment image to provision target nodes with'
100       - string:
101           name: CLEANUP
102           default: 'true'
103           description: 'Cleanup leftovers of the previous run'
104
105     properties:
106       - logrotate
107       - build-blocker:
108           use-build-blocker: true
109           blocking-jobs:
110             - 'cloud-infra-verify-{os}-.*'
111             - 'cloud-infra-os-.*'
112             - 'cloud-infra-k8-.*'
113           block-level: 'NODE'
114       - throttle:
115           max-per-node: 1
116           max-total: 3
117           option: project
118
119     wrappers:
120       - build-timeout:
121           timeout: 120
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
132     triggers:
133       - nordix-gerrit-trigger-patchset-created:
134           project: 'infra\/engine|infra\/swconfig'
135           branch: '{branch}'
136           files: '**'
137
138     builders:
139       - multijob:
140           name: deploy
141           condition: SUCCESSFUL
142           projects:
143             - name: 'cloud-infra-verify-{os}-deploy-{type}-{stream}'
144               current-parameters: true
145               predefined-parameters: |
146                 DISTRIBUTION=$DISTRIBUTION
147                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
148                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
149                 DIB_OS_RELEASE=$DIB_OS_RELEASE
150                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
151                 CLEANUP=$CLEANUP
152                 GERRIT_PROJECT=$GERRIT_PROJECT
153                 GERRIT_BRANCH=$GERRIT_BRANCH
154                 GERRIT_REFSPEC=$GERRIT_REFSPEC
155                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
156                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
157               node-parameters: true
158               kill-phase-on: FAILURE
159               abort-all-job: true
160       - multijob:
161           name: test
162           condition: SUCCESSFUL
163           projects:
164             - name: 'cloud-infra-verify-{os}-test-{type}-{stream}'
165               current-parameters: true
166               predefined-parameters: |
167                 DISTRIBUTION=$DISTRIBUTION
168                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
169                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
170                 DIB_OS_RELEASE=$DIB_OS_RELEASE
171                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
172                 CLEANUP=$CLEANUP
173                 GERRIT_PROJECT=$GERRIT_PROJECT
174                 GERRIT_BRANCH=$GERRIT_BRANCH
175                 GERRIT_REFSPEC=$GERRIT_REFSPEC
176                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
177                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
178               node-parameters: true
179               kill-phase-on: test
180               abort-all-job: true
181
182 - job-template:
183     name: 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
184
185     disabled: false
186
187     concurrent: true
188
189     properties:
190       - logrotate
191
192     parameters:
193       - string:
194           name: PROJECT
195           default: $GERRIT_PROJECT
196       - string:
197           name: DISTRIBUTION
198           default: 'ubuntu18'
199           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
200       - string:
201           name: USE_PREBUILT_DEPLOYMENT_IMAGE
202           default: 'false'
203           description: 'Use prebuilt deployment image while running as part of CI/CD'
204       - string:
205           name: IPA_DIB_OS_ELEMENT
206           default: 'fedora'
207           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
208       - string:
209           name: DIB_OS_RELEASE
210           default: 'bionic'
211           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
212       - string:
213           name: DIB_OS_ELEMENT
214           default: 'ubuntu-minimal'
215           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
216       - string:
217           name: CLEANUP
218           default: 'false'
219
220     wrappers:
221       - build-timeout:
222           timeout: 120
223       - fix-workspace-permissions
224
225     scm:
226       - git-scm-gerrit:
227           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
228           branch: '{branch}'
229           refspec: $GERRIT_REFSPEC
230
231     builders:
232       - 'cloud-infra-verify-{phase}-macro'
233
234 # -------------------------------
235 # builder macros
236 # -------------------------------
237
238 - builder:
239     name: 'cloud-infra-verify-deploy-macro'
240     builders:
241       - shell:
242           !include-raw: ./wait-for-pkg-manager.sh
243       - shell:
244           !include-raw: ./cloud-infra-deploy.sh
245
246 - builder:
247     name: 'cloud-infra-verify-test-macro'
248     builders:
249       - shell:
250           !include-raw: ./cloud-infra-test.sh
251
252 # vim: set ts=2 sw=2 expandtab: