4ed2c3f51717672c90621b452376c33cdc543933
[infra/cicd.git] / jjb / engine / engine-verify-tox.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 - project:
21     name: 'engine-tox'
22
23     project: 'engine-tox'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28
29     lint-type:
30       - ansible-lint:
31           disabled: false
32           repos-to-ignore: 'infra/hwconfig'
33       - docs:
34           disabled: false
35           repos-to-ignore: 'infra/hwconfig|infra/swconfig|infra/test'
36       - shellcheck:
37           disabled: false
38           repos-to-ignore: 'infra/hwconfig'
39       - yamllint:
40           disabled: false
41           repos-to-ignore: ''
42
43     jobs:
44       - 'engine-verify-tox-{stream}'
45       - 'engine-verify-{lint-type}-{stream}'
46
47 - job-template:
48     name: 'engine-verify-tox-{stream}'
49
50     project-type: multijob
51
52     concurrent: true
53
54     node: infra-tools-docker-slave-ubuntu1804
55
56     parameters:
57       - project-parameters:
58           project: $GERRIT_PROJECT
59           branch: '{branch}'
60           description: 'The project and branch which the change is proposed for'
61       - string:
62           name: VERBOSITY
63           default: 'false'
64           description: 'Verbosity setting for the tox script'
65       - nordix-gerrit-parameters
66
67     properties:
68       - logrotate
69
70     wrappers:
71       - build-timeout:
72           timeout: 60
73       - fix-workspace-permissions
74
75     scm:
76       - git-scm-gerrit:
77           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
78           branch: '{branch}'
79           refspec: $GERRIT_REFSPEC
80           wipe_workspace: true
81           clean_before: false
82
83     triggers:
84       - gerrit:
85           server-name: 'Nordix Gerrit'
86           trigger-on:
87             - patchset-created-event:
88                 exclude-drafts: 'false'
89                 exclude-trivial-rebase: 'false'
90                 exclude-no-code-change: 'false'
91             - draft-published-event
92             - comment-added-contains-event:
93                 comment-contains-value: 'recheck'
94             - comment-added-contains-event:
95                 comment-contains-value: 'reverify'
96           projects:
97             - project-compare-type: 'REG_EXP'
98               project-pattern: 'infra\/engine|infra\/test|infra\/swconfig|infra\/hwconfig'
99               branches:
100                 - branch-compare-type: 'ANT'
101                   branch-pattern: '**/{branch}'
102               disable-strict-forbidden-file-verification: 'false'
103               forbidden-file-paths:
104                 - compare-type: ANT
105                   pattern: '.gitignore|.gitreview|.yamllint|README.md|bindep.txt|setup.cfg|setup.py'
106           custom-url: '* $JOB_NAME $BUILD_URL'
107
108     builders:
109       - multijob:
110           name: ansible-lint
111           condition: ALWAYS
112           projects:
113             - name: 'engine-verify-ansible-lint-{stream}'
114               current-parameters: true
115               kill-phase-on: NEVER
116               abort-all-job: false
117               predefined-parameters: |
118                 GERRIT_PROJECT=$GERRIT_PROJECT
119                 GERRIT_BRANCH=$GERRIT_BRANCH
120                 GERRIT_REFSPEC=$GERRIT_REFSPEC
121                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
122                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
123                 VERBOSITY=$VERBOSITY
124       - multijob:
125           name: shellcheck
126           condition: ALWAYS
127           projects:
128             - name: 'engine-verify-shellcheck-{stream}'
129               current-parameters: true
130               kill-phase-on: NEVER
131               abort-all-job: false
132               predefined-parameters: |
133                 GERRIT_PROJECT=$GERRIT_PROJECT
134                 GERRIT_BRANCH=$GERRIT_BRANCH
135                 GERRIT_REFSPEC=$GERRIT_REFSPEC
136                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
137                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
138                 VERBOSITY=$VERBOSITY
139       - multijob:
140           name: yamllint
141           condition: ALWAYS
142           projects:
143             - name: 'engine-verify-yamllint-{stream}'
144               current-parameters: true
145               kill-phase-on: NEVER
146               abort-all-job: false
147               predefined-parameters: |
148                 GERRIT_PROJECT=$GERRIT_PROJECT
149                 GERRIT_BRANCH=$GERRIT_BRANCH
150                 GERRIT_REFSPEC=$GERRIT_REFSPEC
151                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
152                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
153                 VERBOSITY=$VERBOSITY
154       - multijob:
155           name: docs
156           condition: ALWAYS
157           projects:
158             - name: 'engine-verify-ansible-lint-{stream}'
159               current-parameters: true
160               kill-phase-on: NEVER
161               abort-all-job: false
162               predefined-parameters: |
163                 GERRIT_PROJECT=$GERRIT_PROJECT
164                 GERRIT_BRANCH=$GERRIT_BRANCH
165                 GERRIT_REFSPEC=$GERRIT_REFSPEC
166                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
167                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
168                 VERBOSITY=$VERBOSITY
169
170 - job-template:
171     name: 'engine-verify-{lint-type}-{stream}'
172
173     disabled: '{obj:disabled}'
174
175     concurrent: true
176
177     node: infra-tools-docker-slave-ubuntu1804
178
179     parameters:
180       - string:
181           name: PROJECT
182           default: $GERRIT_PROJECT
183           description: 'The project which the change is proposed for'
184       - string:
185           name: LINT_TYPE
186           default: '{lint-type}'
187           description: 'Lint type to run'
188       - string:
189           name: REPOS_TO_IGNORE
190           default: '{repos-to-ignore}'
191           description: 'Repos to ignore for the specific lint type'
192       - string:
193           name: VERBOSITY
194           default: 'false'
195           description: 'Verbosity setting for the tox script'
196       - nordix-gerrit-parameters
197
198     properties:
199       - logrotate
200
201     wrappers:
202       - build-timeout:
203           timeout: 150
204       - fix-workspace-permissions
205
206     scm:
207       - git-scm-gerrit:
208           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
209           branch: '{branch}'
210           refspec: $GERRIT_REFSPEC
211           wipe_workspace: true
212           clean_before: false
213
214     builders:
215       - 'engine-verify-tox-macro'
216
217 # vim: set ts=2 sw=2 expandtab: