a2e2050d665c5670f4662120e4045f9d6f5ddb91
[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: 'cloud-infra'
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           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       - build-timeout:
84           timeout: 120
85       - fix-workspace-permissions
86
87     scm:
88       - git-scm-gerrit:
89           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
90           branch: '{branch}'
91           refspec: $GERRIT_REFSPEC
92
93     triggers:
94       - nordix-gerrit-trigger-patchset-created:
95           project: 'infra/engine|infra/swconfig'
96           branch: '{branch}'
97           files: '**'
98
99     builders:
100       - multijob:
101           name: deploy
102           condition: SUCCESSFUL
103           projects:
104             - name: 'cloud-infra-verify-{distro}-deploy-{type}-{stream}'
105               current-parameters: true
106               predefined-parameters: |
107                 DISTRO={distro}
108                 GERRIT_PROJECT=$GERRIT_PROJECT
109                 GERRIT_BRANCH=$GERRIT_BRANCH
110                 GERRIT_REFSPEC=$GERRIT_REFSPEC
111                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
112                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
113               node-parameters: true
114               kill-phase-on: FAILURE
115               abort-all-job: true
116       - multijob:
117           name: test
118           condition: SUCCESSFUL
119           projects:
120             - name: 'cloud-infra-verify-{distro}-test-{type}-{stream}'
121               current-parameters: true
122               predefined-parameters: |
123                 DISTRO={distro}
124                 GERRIT_PROJECT=$GERRIT_PROJECT
125                 GERRIT_BRANCH=$GERRIT_BRANCH
126                 GERRIT_REFSPEC=$GERRIT_REFSPEC
127                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
128                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
129               node-parameters: true
130               kill-phase-on: test
131               abort-all-job: true
132
133 - job-template:
134     name: 'cloud-infra-verify-{distro}-{phase}-{type}-{stream}'
135
136     disabled: false
137
138     concurrent: true
139
140     properties:
141       - logrotate
142
143     parameters:
144       - string:
145           name: PROJECT
146           default: $GERRIT_PROJECT
147       - string:
148           name: DISTRO
149           default: 'ubuntu1604'
150
151     wrappers:
152       - build-timeout:
153           timeout: 120
154       - fix-workspace-permissions
155
156     scm:
157       - git-scm-gerrit:
158           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
159           branch: '{branch}'
160           refspec: $GERRIT_REFSPEC
161
162     builders:
163       - 'cloud-infra-verify-{phase}-macro'
164
165 # -------------------------------
166 # builder macros
167 # -------------------------------
168
169 - builder:
170     name: 'cloud-infra-verify-deploy-macro'
171     builders:
172       - shell:
173           !include-raw: ./cloud-infra-deploy.sh
174
175 - builder:
176     name: 'cloud-infra-verify-test-macro'
177     builders:
178       - shell:
179           !include-raw: ./cloud-infra-test.sh
180
181 # vim: set ts=2 sw=2 expandtab: