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