Fully render GitHub SCM clone URLs
[releng/global-jjb.git] / jjb / 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 # Anchors & Macros #
22 ####################
23
24 - lf_tox_verify: &lf_tox_verify
25     name: lf-tox-verify
26
27     # Required Variables:
28     #     branch:    git branch (default: master)
29     #     tox-dir:   directory containing the project's tox.ini relative to
30     #                the workspace. Empty works if tox.ini is at project root.
31
32     project-type: freestyle
33     node: '{build-node}'
34     concurrent: true
35
36     ######################
37     # Default parameters #
38     ######################
39
40     branch: master
41     build-timeout: 10
42     git-url: '$GIT_URL/$GERRIT_PROJECT'
43     submodule-recursive: true
44     tox-dir: ''
45     tox-envs: ''
46
47     #####################
48     # Job Configuration #
49     #####################
50
51     properties:
52       - lf-infra-properties:
53           build-days-to-keep: 7
54
55     parameters:
56       - lf-infra-parameters:
57           project: '{project}'
58           branch: '{branch}'
59       - lf-infra-tox-parameters:
60           tox-dir: '{tox-dir}'
61           tox-envs: '{tox-envs}'
62
63     wrappers:
64       - lf-infra-wrappers:
65           build-timeout: '{build-timeout}'
66           jenkins-ssh-credential: '{jenkins-ssh-credential}'
67
68     builders:
69       - shell: !include-raw-escape:
70           # Workaround issue where the tox run later breaks the lftools virtualenv.
71           # Without running the install first the run in the publisher will fail
72           # due to missing lftools because it gets installed into a tox venv.
73           - ../shell/lftools-install.sh
74       - shell: !include-raw-escape:
75           - ../shell/tox-install.sh
76           - ../shell/tox-run.sh
77
78     publishers:
79       - lf-infra-publish
80
81 #################
82 # Job Templates #
83 #################
84
85 - job-template:
86     # Python projects typically use tox to run testing.
87     name: '{project-name}-tox-verify-{stream}'
88     id: gerrit-tox-verify
89     <<: *lf_tox_verify
90
91     scm:
92       - lf-infra-gerrit-scm:
93           jenkins-ssh-credential: '{jenkins-ssh-credential}'
94           git-url: '{git-url}'
95           refspec: '$GERRIT_REFSPEC'
96           branch: '$GERRIT_BRANCH'
97           submodule-recursive: '{submodule-recursive}'
98           choosing-strategy: gerrit
99
100     triggers:
101       - gerrit:
102           server-name: '{gerrit-server-name}'
103           trigger-on:
104             - patchset-created-event:
105                 exclude-drafts: false
106                 exclude-trivial-rebase: false
107                 exclude-no-code-change: false
108             - draft-published-event
109             - comment-added-contains-event:
110                 comment-contains-value: recheck$
111           projects:
112             - project-compare-type: ANT
113               project-pattern: '{project}'
114               branches:
115                 - branch-compare-type: ANT
116                   branch-pattern: '**/{branch}'
117
118 - job-template:
119     # Python projects typically use tox to run testing.
120     name: '{project-name}-tox-verify-{stream}'
121     id: github-tox-verify
122     <<: *lf_tox_verify
123
124     properties:
125       - github:
126           url: '{git-url}/{github-org}/{project}'
127
128     scm:
129       - lf-infra-github-scm:
130           url: '{git-clone-url}{github-org}/{project}'
131           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
132           branch: '{branch}'
133           submodule-recursive: '{submodule-recursive}'
134           choosing-strategy: default
135           jenkins-ssh-credential: '{jenkins-ssh-credential}'
136
137     triggers:
138       - github-pull-request:
139           trigger-phrase: '^recheck$'
140           only-trigger-phrase: false
141           status-context: 'JJB Verify'
142           permit-all: true
143           github-hooks: true
144           auto-close-on-fail: false