Update RTD to use Generic API v2 webhook
[releng/global-jjb.git] / docs / jjb / lf-rtd-jobs.rst
1 .. _lf-global-jjb-rtd-jobs:
2
3 ################
4 ReadTheDocs Jobs
5 ################
6
7 Job Groups
8 ==========
9
10 {project-name}-rtd-jobs
11 -----------------------
12
13 Jobs to deploy for a project producing ReadTheDocs using Gerrit.
14
15 :Includes:
16
17     - gerrit-rtd-merge
18     - gerrit-rtd-verify
19
20 {project-name}-github-rtd-jobs
21 ------------------------------
22
23 Jobs to deploy for a project producing ReadTheDocs using GitHub.
24
25 :Includes:
26
27     - github-rtd-merge
28     - github-rtd-verify
29
30
31 Macros
32 ======
33
34 lf-rtd-common
35 -------------
36
37 RTD verify and merge jobs are the same except for their scm, trigger, and
38 builders definition. This anchor is the common template.
39
40
41 Job Templates
42 =============
43
44 ReadTheDocs Merge
45 -----------------
46
47 Merge job which triggers a POST of the docs project to readthedocs.
48
49 To use this job first configure the ``Generic API incoming webhook`` in
50 ReadTheDocs. To do that follow these steps:
51
52 #. Browse to https://readthedocs.org/dashboard/PROJECT/integrations/
53 #. Click on ``Generic API incoming webhook``
54
55    .. note::
56
57       If not available click on ``Add integration`` and add the
58       ``Generic API incoming webhook``.
59
60 #. Copy the custom webhook URL, this is your ``rtd-build-url``
61
62    For example: https://readthedocs.org/api/v2/webhook/opendaylight/32321/
63
64 #. Copy the token, this is your ``rtd-token``
65
66 :Template Names:
67     - {project-name}-rtd-merge-{stream}
68     - gerrit-rtd-merge
69     - github-rtd-merge
70
71 :Required parameters:
72
73     :build-node: The node to run build on.
74     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
75         in defaults.yaml)
76     :rtd-build-url: This is the generic webhook url from readthedocs.org. Refer
77         to the above instructions to generate one.
78         (Check Admin > Integrations > Generic API incoming webhook)
79     :rtd-token: The unique token for the project Generic webhook. Refer
80         to the above instructions to generate one.
81         (Check Admin > Integrations > Generic API incoming webhook)
82
83 :Optional parameters:
84
85     :branch: Git branch to fetch for the build. (default: master)
86     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
87     :build-timeout: Timeout in seconds before aborting build. (default: 15)
88     :git-url: base URL of git project. (default: https://github.com)
89     :project-pattern: Project to trigger build against. (default: \*\*)
90     :stream: Keyword representing a release code-name.
91         Often the same as the branch. (default: master)
92     :submodule-recursive: Whether to checkout submodules recursively.
93         (default: true)
94
95     :gerrit_merge_triggers: Override Gerrit Triggers.
96     :gerrit_trigger_file_paths: Override file paths filter which checks which
97         file modifications will trigger a build.
98         **default**::
99
100             - compare-type: ANT
101               pattern: '**/*.rst'
102             - compare-type: ANT
103               pattern: '**/conf.py'
104
105
106 ReadTheDocs Verify
107 ------------------
108
109 Verify job which runs a tox build of the docs project
110
111 :Template Names:
112     - {project-name}-rtd-verify-{stream}
113     - gerrit-rtd-verify
114     - github-rtd-verify
115
116 :Required Parameters:
117
118     :build-node: The node to run build on.
119     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
120         in defaults.yaml)
121
122 :Optional Parameters:
123
124     :branch: Git branch to fetch for the build. (default: master)
125     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
126     :build-node: The node to run build on.
127     :build-timeout: Timeout in seconds before aborting build. (default: 15)
128     :doc-dir: Directory where tox will place built docs.
129         as defined in the tox.ini (default: docs/_build/html)
130     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
131     :project-pattern: Project to trigger build against. (default: \*\*)
132     :stream: Keyword representing a release code-name.
133         Often the same as the branch. (default: master)
134     :submodule-recursive: Whether to checkout submodules recursively.
135         (default: true)
136
137     :gerrit_verify_triggers: Override Gerrit Triggers.
138     :gerrit_trigger_file_paths: Override file paths filter which checks which
139         file modifications will trigger a build.
140         **default**::
141
142             - compare-type: ANT
143               pattern: '**/*.rst'
144             - compare-type: ANT
145               pattern: '**/conf.py'