8f8ba5d7b75b47fd923dc46d25e4f127abf4527d
[releng/global-jjb.git] / lf-rtd-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-rtd-jobs'
4
5     jobs:
6       - gerrit-rtd-merge
7       - gerrit-rtd-verify
8
9 - job-group:
10     name: '{project-name}-github-rtd-jobs'
11
12     jobs:
13       - github-rtd-merge
14       - github-rtd-verify
15
16 ####################
17 # COMMON FUNCTIONS #
18 ####################
19
20 - lf_rtd_common: &lf_rtd_common
21     name: lf-rtd-common
22
23     ######################
24     # Default parameters #
25     ######################
26
27     gerrit_trigger_file_paths:
28       - compare-type: ANT
29         pattern: '**/*.rst'
30       - compare-type: ANT
31         pattern: '**/conf.py'
32
33     #####################
34     # Job Configuration #
35     #####################
36
37     project-type: freestyle
38     node: '{build-node}'
39
40     properties:
41       - lf-infra-properties:
42           build-days-to-keep: 7
43
44     parameters:
45       - lf-infra-parameters:
46           project: '{project}'
47           branch: '{branch}'
48           refspec: 'refs/heads/{branch}'
49           stream: '{stream}'
50           lftools-version: '{lftools-version}'
51
52     wrappers:
53       - lf-infra-wrappers:
54           build-timeout: '{build-timeout}'
55           jenkins-ssh-credential: '{jenkins-ssh-credential}'
56
57     publishers:
58       - lf-infra-publish
59
60 #############
61 # RTD MERGE #
62 #############
63
64 - lf_rtd_merge: &lf_rtd_merge
65     name: lf-rtd-merge
66
67     ######################
68     # Default parameters #
69     ######################
70
71     branch: master
72     build-days-to-keep: 7
73     build-timeout: 15
74     git-url: https://github.com
75     project-pattern: '**'
76     stream: master
77     submodule-recursive: true
78
79     gerrit_merge_triggers:
80       - change-merged-event
81       - comment-added-contains-event:
82           comment-contains-value: remerge$
83
84     #####################
85     # Job Configuration #
86     #####################
87
88     builders:
89       - lf-rtd-trigger-build:
90           rtd-project: '{rtd-project}'
91
92 - job-template:
93     name: '{project-name}-rtd-merge-{stream}'
94     id: gerrit-rtd-merge
95     <<: *lf_rtd_common
96     # yamllint disable-line rule:key-duplicates
97     <<: *lf_rtd_merge
98
99     triggers:
100       - gerrit:
101           server-name: '{gerrit-server-name}'
102           trigger-on: '{obj:gerrit_merge_triggers}'
103           projects:
104             - project-compare-type: 'ANT'
105               project-pattern: '{project-pattern}'
106               branches:
107                 - branch-compare-type: 'ANT'
108                   branch-pattern: '**/{branch}'
109               file-paths: '{obj:gerrit_trigger_file_paths}'
110
111 - job-template:
112     name: '{project-name}-rtd-merge-{stream}'
113     id: github-rtd-merge
114     <<: *lf_rtd_common
115     # yamllint disable-line rule:key-duplicates
116     <<: *lf_rtd_merge
117
118     properties:
119       - github:
120           url: '{git-url}/{github-org}/{project}'
121
122     triggers:
123       - lf-infra-github-pr-trigger:
124           trigger-phrase: '^remerge$'
125           only-trigger-phrase: false
126           status-context: 'RTD Merge'
127           permit-all: true
128           github-hooks: true
129           github-org: ''
130           github_pr_whitelist:
131             - ''
132           github_pr_admin_list:
133             - ''
134       - timed: 'H H * * *'
135
136 #############
137 # RTD VERIFY#
138 #############
139
140 - lf_rtd_verify: &lf_rtd_verify
141     name: lf-rtd-verify
142
143     ######################
144     # Default parameters #
145     ######################
146
147     branch: master
148     build-days-to-keep: 7
149     build-timeout: 15
150     doc-dir: docs/_build/html
151     git-url: '$GIT_URL/$PROJECT'
152     project-pattern: '**'
153     stream: master
154     submodule-recursive: true
155
156     gerrit_verify_triggers:
157       - patchset-created-event:
158           exclude-drafts: true
159           exclude-trivial-rebase: false
160           exclude-no-code-change: false
161       - draft-published-event
162       - comment-added-contains-event:
163           comment-contains-value: recheck$
164
165     #####################
166     # Job Configuration #
167     #####################
168
169     builders:
170       - lf-rtd-verify:
171           doc-dir: '{doc-dir}'
172
173 - job-template:
174     name: '{project-name}-rtd-verify-{stream}'
175     id: gerrit-rtd-verify
176     concurrent: true
177     <<: *lf_rtd_common
178     # yamllint disable-line rule:key-duplicates
179     <<: *lf_rtd_verify
180
181     scm:
182       - lf-infra-gerrit-scm:
183           branch: '$GERRIT_BRANCH'
184           jenkins-ssh-credential: '{jenkins-ssh-credential}'
185           git-url: '{git-url}'
186           refspec: ''  # Leave blank!! A later script will handle fetching
187           submodule-recursive: '{submodule-recursive}'
188           choosing-strategy: default
189
190     triggers:
191       - gerrit:
192           server-name: '{gerrit-server-name}'
193           trigger-on: '{obj:gerrit_verify_triggers}'
194           projects:
195             - project-compare-type: 'ANT'
196               project-pattern: '{project-pattern}'
197               branches:
198                 - branch-compare-type: 'ANT'
199                   branch-pattern: '**/{branch}'
200               file-paths: '{obj:gerrit_trigger_file_paths}'
201
202 - job-template:
203     name: '{project-name}-rtd-verify-{stream}'
204     id: github-rtd-verify
205     concurrent: true
206     <<: *lf_rtd_common
207     # yamllint disable-line rule:key-duplicates
208     <<: *lf_rtd_verify
209
210     properties:
211       - github:
212           url: '{git-url}/{github-org}/{project}'
213
214     scm:
215       - lf-infra-github-scm:
216           url: '{git-clone-url}{github-org}/{project}'
217           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
218           branch: '{branch}'
219           submodule-recursive: '{submodule-recursive}'
220           choosing-strategy: default
221           jenkins-ssh-credential: '{jenkins-ssh-credential}'
222
223     triggers:
224       - lf-infra-github-pr-trigger:
225           trigger-phrase: '^recheck$'
226           only-trigger-phrase: false
227           status-context: 'RTD Verify'
228           permit-all: true
229           github-hooks: true
230           github-org: ''
231           github_pr_whitelist:
232             - ''
233           github_pr_admin_list:
234             - ''