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