c37fab3254f80835d65681500696f7eadeb79373
[releng/global-jjb.git] / lf-python-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-python-jobs'
4
5     # This job group contains all the recommended jobs that should be deployed
6     # for any project ci that is using Gerrit.
7
8     jobs:
9       - gerrit-tox-verify
10
11 - job-group:
12     name: '{project-name}-github-python-jobs'
13
14     # This job group contains all the recommended jobs that should be deployed
15     # for any project ci that is using GitHub.
16
17     jobs:
18       - github-tox-verify
19
20 ##############
21 # Tox Verify #
22 ##############
23
24 - lf_tox_verify: &lf_tox_verify
25     name: lf-tox-verify
26
27     ######################
28     # Default parameters #
29     ######################
30
31     branch: master
32     build-days-to-keep: 7
33     build-timeout: 10
34     git-url: '$GIT_URL/$GERRIT_PROJECT'
35     stream: master
36     submodule-recursive: true
37     tox-dir: ''
38     tox-envs: ''
39
40     #####################
41     # Job Configuration #
42     #####################
43
44     project-type: freestyle
45     node: '{build-node}'
46     concurrent: true
47
48     properties:
49       - lf-infra-properties:
50           build-days-to-keep: '{build-days-to-keep}'
51
52     parameters:
53       - lf-infra-parameters:
54           project: '{project}'
55           branch: '{branch}'
56           stream: '{stream}'
57           lftools-version: '{lftools-version}'
58       - lf-infra-tox-parameters:
59           tox-dir: '{tox-dir}'
60           tox-envs: '{tox-envs}'
61
62     wrappers:
63       - lf-infra-wrappers:
64           build-timeout: '{build-timeout}'
65           jenkins-ssh-credential: '{jenkins-ssh-credential}'
66
67     builders:
68       - shell: !include-raw-escape:
69           # Workaround issue where the tox run later breaks the lftools virtualenv.
70           # Without running the install first the run in the publisher will fail
71           # due to missing lftools because it gets installed into a tox venv.
72           - ../shell/lftools-install.sh
73       - shell: !include-raw-escape:
74           - ../shell/tox-install.sh
75           - ../shell/tox-run.sh
76
77     publishers:
78       - lf-infra-publish
79
80 - job-template:
81     # Python projects typically use tox to run testing.
82     name: '{project-name}-tox-verify-{stream}'
83     id: gerrit-tox-verify
84     <<: *lf_tox_verify
85
86     ######################
87     # Default parameters #
88     ######################
89
90     gerrit_verify_triggers:
91       - patchset-created-event:
92           exclude-drafts: true
93           exclude-trivial-rebase: false
94           exclude-no-code-change: false
95       - draft-published-event
96       - comment-added-contains-event:
97           comment-contains-value: recheck$
98
99     #####################
100     # Job Configuration #
101     #####################
102
103     scm:
104       - lf-infra-gerrit-scm:
105           jenkins-ssh-credential: '{jenkins-ssh-credential}'
106           git-url: '{git-url}'
107           refspec: '$GERRIT_REFSPEC'
108           branch: '$GERRIT_BRANCH'
109           submodule-recursive: '{submodule-recursive}'
110           choosing-strategy: gerrit
111
112     triggers:
113       - gerrit:
114           server-name: '{gerrit-server-name}'
115           trigger-on: '{obj:gerrit_verify_triggers}'
116           projects:
117             - project-compare-type: ANT
118               project-pattern: '{project}'
119               branches:
120                 - branch-compare-type: ANT
121                   branch-pattern: '**/{branch}'
122
123 - job-template:
124     # Python projects typically use tox to run testing.
125     name: '{project-name}-tox-verify-{stream}'
126     id: github-tox-verify
127     <<: *lf_tox_verify
128
129     properties:
130       - github:
131           url: '{git-url}/{github-org}/{project}'
132
133     scm:
134       - lf-infra-github-scm:
135           url: '{git-clone-url}{github-org}/{project}'
136           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
137           branch: '{branch}'
138           submodule-recursive: '{submodule-recursive}'
139           choosing-strategy: default
140           jenkins-ssh-credential: '{jenkins-ssh-credential}'
141
142     triggers:
143       - github-pull-request:
144           trigger-phrase: '^recheck$'
145           only-trigger-phrase: false
146           status-context: 'JJB Verify'
147           permit-all: true
148           github-hooks: true
149           auto-close-on-fail: false