Adjust jobs based on supported distros
[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           distribution: ubuntu16
34           disabled: 'false'
35       - ubuntu1804:
36           distribution: ubuntu18
37           disabled: 'true'
38       - centos7:
39           distribution: centos7
40           disabled: 'true'
41
42     type:
43       - virtual
44
45     phase:
46       - deploy
47       - test
48
49     jobs:
50       - 'cloud-infra-verify-{os}-{type}-{stream}'
51       - 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
52
53 - job-template:
54     name: 'cloud-infra-verify-{os}-{type}-{stream}'
55
56     project-type: multijob
57
58     disabled: '{obj:disabled}'
59
60     concurrent: true
61
62     parameters:
63       - project-parameters:
64           project: '{project}'
65           branch: '{branch}'
66       - nordix-gerrit-parameters
67       - label:
68           name: SLAVE_LABEL
69           default: 'vpod-deploy-{os}'
70       - string:
71           name: DISTRO
72           default: '{os}'
73       - string:
74           name: CLEANUP
75           default: 'true'
76
77     properties:
78       - logrotate
79       - build-blocker:
80           use-build-blocker: true
81           blocking-jobs:
82             - 'cloud-infra-verify-{os}-.*'
83             - 'cloud-infra-os-.*'
84             - 'cloud-infra-k8-.*'
85           block-level: 'NODE'
86       - throttle:
87           max-per-node: 1
88           max-total: 3
89           option: project
90
91     wrappers:
92       - build-timeout:
93           timeout: 120
94       - fix-workspace-permissions
95       - openstack:
96           single-use: True
97
98     scm:
99       - git-scm-gerrit:
100           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
101           branch: '{branch}'
102           refspec: $GERRIT_REFSPEC
103
104     triggers:
105       - nordix-gerrit-trigger-patchset-created:
106           project: 'infra\/engine|infra\/swconfig'
107           branch: '{branch}'
108           files: '**'
109
110     builders:
111       - multijob:
112           name: deploy
113           condition: SUCCESSFUL
114           projects:
115             - name: 'cloud-infra-verify-{os}-deploy-{type}-{stream}'
116               current-parameters: true
117               predefined-parameters: |
118                 DISTRIBUTION={distribution}
119                 CLEANUP=$CLEANUP
120                 GERRIT_PROJECT=$GERRIT_PROJECT
121                 GERRIT_BRANCH=$GERRIT_BRANCH
122                 GERRIT_REFSPEC=$GERRIT_REFSPEC
123                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
124                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
125               node-parameters: true
126               kill-phase-on: FAILURE
127               abort-all-job: true
128       - multijob:
129           name: test
130           condition: SUCCESSFUL
131           projects:
132             - name: 'cloud-infra-verify-{os}-test-{type}-{stream}'
133               current-parameters: true
134               predefined-parameters: |
135                 DISTRIBUTION={distribution}
136                 CLEANUP=$CLEANUP
137                 GERRIT_PROJECT=$GERRIT_PROJECT
138                 GERRIT_BRANCH=$GERRIT_BRANCH
139                 GERRIT_REFSPEC=$GERRIT_REFSPEC
140                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
141                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
142               node-parameters: true
143               kill-phase-on: test
144               abort-all-job: true
145
146 - job-template:
147     name: 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
148
149     disabled: false
150
151     concurrent: true
152
153     properties:
154       - logrotate
155
156     parameters:
157       - string:
158           name: PROJECT
159           default: $GERRIT_PROJECT
160       - string:
161           name: DISTRO
162           default: 'ubuntu1604'
163       - string:
164           name: CLEANUP
165           default: 'false'
166
167     wrappers:
168       - build-timeout:
169           timeout: 120
170       - fix-workspace-permissions
171
172     scm:
173       - git-scm-gerrit:
174           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
175           branch: '{branch}'
176           refspec: $GERRIT_REFSPEC
177
178     builders:
179       - 'cloud-infra-verify-{phase}-macro'
180
181 # -------------------------------
182 # builder macros
183 # -------------------------------
184
185 - builder:
186     name: 'cloud-infra-verify-deploy-macro'
187     builders:
188       - shell: |
189           #!/bin/bash
190
191           # it takes some time before the OpenStack slave becomes fully operational
192           # so we give it some more time before doing anything
193           sleep 30
194       - shell:
195           !include-raw: ./cloud-infra-deploy.sh
196
197 - builder:
198     name: 'cloud-infra-verify-test-macro'
199     builders:
200       - shell:
201           !include-raw: ./cloud-infra-test.sh
202
203 # vim: set ts=2 sw=2 expandtab: