cloud-infra: Fix SLAVE_LABEL to schedule jobs on
[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'
62       - string:
63           name: DISTRO
64           default: '{distro}'
65       - string:
66           name: CLEANUP
67           default: 'true'
68
69     properties:
70       - logrotate
71       - build-blocker:
72           use-build-blocker: true
73           blocking-jobs:
74             - 'cloud-infra-verify-{distro}-.*'
75             - 'cloud-infra-os-.*'
76             - 'cloud-infra-k8-.*'
77           blocking-level: 'NODE'
78       - throttle:
79           max-per-node: 1
80           max-total: 2
81           option: project
82
83     wrappers:
84       - build-timeout:
85           timeout: 120
86       - fix-workspace-permissions
87
88     scm:
89       - git-scm-gerrit:
90           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
91           branch: '{branch}'
92           refspec: $GERRIT_REFSPEC
93
94     triggers:
95       - nordix-gerrit-trigger-patchset-created:
96           project: 'infra\/engine|infra\/swconfig'
97           branch: '{branch}'
98           files: '**'
99
100     builders:
101       - multijob:
102           name: deploy
103           condition: SUCCESSFUL
104           projects:
105             - name: 'cloud-infra-verify-{distro}-deploy-{type}-{stream}'
106               current-parameters: true
107               predefined-parameters: |
108                 DISTRO={distro}
109                 CLEANUP=$CLEANUP
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                 CLEANUP=$CLEANUP
127                 GERRIT_PROJECT=$GERRIT_PROJECT
128                 GERRIT_BRANCH=$GERRIT_BRANCH
129                 GERRIT_REFSPEC=$GERRIT_REFSPEC
130                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
131                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
132               node-parameters: true
133               kill-phase-on: test
134               abort-all-job: true
135
136 - job-template:
137     name: 'cloud-infra-verify-{distro}-{phase}-{type}-{stream}'
138
139     disabled: false
140
141     concurrent: true
142
143     properties:
144       - logrotate
145
146     parameters:
147       - string:
148           name: PROJECT
149           default: $GERRIT_PROJECT
150       - string:
151           name: DISTRO
152           default: 'ubuntu1604'
153       - string:
154           name: CLEANUP
155           default: 'false'
156
157     wrappers:
158       - build-timeout:
159           timeout: 120
160       - fix-workspace-permissions
161
162     scm:
163       - git-scm-gerrit:
164           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
165           branch: '{branch}'
166           refspec: $GERRIT_REFSPEC
167
168     builders:
169       - 'cloud-infra-verify-{phase}-macro'
170
171 # -------------------------------
172 # builder macros
173 # -------------------------------
174
175 - builder:
176     name: 'cloud-infra-verify-deploy-macro'
177     builders:
178       - shell:
179           !include-raw: ./cloud-infra-deploy.sh
180
181 - builder:
182     name: 'cloud-infra-verify-test-macro'
183     builders:
184       - shell:
185           !include-raw: ./cloud-infra-test.sh
186
187 # vim: set ts=2 sw=2 expandtab: