Feat!: Upgrade Jenkins-job-builder to 6x
[ci-management.git] / jjb / csit / csit-tox.yaml
1 # Copyright (c) 2023 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 ---
15 - project:
16     name: csit-validate
17
18     jobs:
19       - 'csit-verify-tox-{stream}-{os}-{executor-arch}'
20
21     project: 'csit'
22     branch: 'master'
23     os: 'ubuntu2204'
24     executor-arch: 'x86_64'
25     stream:
26       - master:
27           branch: 'master'
28       - '2402':
29           branch: 'rls2402'
30
31 - job-template:
32     name: 'csit-verify-tox-{stream}-{os}-{executor-arch}'
33
34     project-type: freestyle
35     node: 's-builder-{os}-prod-{executor-arch}'
36     concurrent: true
37     latest-only: false
38
39     properties:
40       - lf-infra-properties:
41           build-days-to-keep: "{build-days-to-keep}"
42
43     parameters:
44       - project-parameter:
45           project: '{project}'
46       - gerrit-parameter:
47           branch: '{branch}'
48       - gerrit-refspec-parameter:
49           refspec: '$GERRIT_REFSPEC'
50
51     scm:
52       - gerrit-trigger-scm:
53           credentials-id: 'jenkins-gerrit-credentials'
54           refspec: '$GERRIT_REFSPEC'
55           choosing-strategy: 'gerrit'
56
57     wrappers:
58       - fdio-infra-wrappers:
59           build-timeout: '{build-timeout}'
60
61     triggers:
62       # Tox trigger is special.
63       - gerrit:
64           server-name: 'Primary'
65           trigger-on:
66             - patchset-created-event:
67                 exclude-drafts: 'true'
68                 exclude-trivial-rebase: 'false'
69                 exclude-no-code-change: 'false'
70             # Not enabling on draft published event.
71             # Frequently, people publish for public access, not fr verify.
72             # Use recheck comment to trigger verify.
73             - comment-added-contains-event:
74                 comment-contains-value: 'recheck'
75             - comment-added-contains-event:
76                 comment-contains-value: 'reverify'
77           projects:
78             - project-compare-type: 'ANT'
79               project-pattern: '{project}'
80               branches:
81                 - branch-compare-type: 'ANT'
82                   branch-pattern: '**/{branch}'
83           override-votes: true
84           gerrit-build-notbuilt-verified-value: 0
85           gerrit-build-successful-verified-value: 1
86           failed-message: 'Tox failed. No further verify jobs will be started.'
87           successful-message: 'tox_success'
88           skip-vote:
89             successful: true
90             failed: false
91             unstable: false
92             notbuilt: false
93
94     builders:
95       - shell:
96           !include-raw-escape:
97           - ../scripts/setup_executor_env.sh
98       - shell:
99           !include-raw-escape:
100           - ../scripts/csit/tox.sh
101
102     publishers:
103       - fdio-infra-publish