d002d9d43d55ca0a93bdc51f68dd6e1c9538381b
[ci-management.git] / jjb / doc / doc-templates-rtd.yaml
1 ---
2 - job-template:
3     # Job template for verifying Sphinx/Restructured Text for RTD
4     #
5     # The purpose of this job template is verify documentation source
6     #
7     # Required Variables:
8     #     branch:        git branch
9     # Optional Variables:
10     #     path:      directory containing the project's tox.ini relative to
11     #                the workspace. The default is the project root.
12
13     name: '{project-name}-{stream}-verify-rtd'
14     path: '$WORKSPACE'
15
16     project-type: freestyle
17     concurrent: true
18     node: '{build-node}'
19
20     properties:
21       - infra-properties:
22           build-days-to-keep: '{build-days-to-keep}'
23
24     parameters:
25       - infra-parameters:
26           project: '{project}'
27           branch: '{branch}'
28           refspec: 'refs/heads/{branch}'
29           artifacts: '{archive-artifacts}'
30       - maven-exec:
31           maven-version: '{maven-version}'
32
33     scm:
34       - git:
35           credentials-id: '{jenkins-ssh-credential}'
36           url: '$GIT_BASE'
37           refspec: ''
38           choosing-strategy: 'default'
39           branches:
40             - 'refs/heads/{branch}'
41           skip-tag: true
42           wipe-workspace: true
43           submodule:
44             recursive: '{submodule-recursive}'
45             timeout: '12'
46
47     wrappers:
48       - infra-wrappers:
49           build-timeout: '{build-timeout}'
50
51     triggers:
52       - gerrit-trigger-patch-submitted:
53           server: '{server-name}'
54           project: '**'
55           branch: '{branch}'
56           files: 'docs/**/*.rst'
57       - timed: 'H H * * *'
58
59     builders:
60       - shell: |
61           if [ "$GERRIT_PROJECT" != "doc" ]; then
62               if [ -d docs/submodules/$GERRIT_PROJECT.git ]; then
63                   cd docs/submodules/$GERRIT_PROJECT.git
64               else
65                   cd docs/submodules/$GERRIT_PROJECT
66               fi
67               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
68           else
69               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
70           fi
71       - shell: |
72           #!/bin/bash
73           virtualenv $WORKSPACE/venv-tox
74           source $WORKSPACE/venv-tox/bin/activate
75           pip install --upgrade pip
76           pip install --upgrade tox argparse
77           pip freeze
78           cd $WORKSPACE/{path}
79           tox
80
81     publishers:
82       - infra-shiplogs:
83           maven-version: '{maven-version}'
84
85 - job-template:
86     # Job template for merging/publishing Sphinx/Restructured Text at RTD
87     #
88     # The purpose of this job template is to trigger updates after
89     # a merge of documentation source in gerrit
90     #
91     # Required Variables:
92     #     branch:        git branch
93     #     rtdproject:    name of a project at readthedocs.io
94     # Optional Variables:
95     #     path:      directory containing the project's tox.ini relative to
96     #                the workspace. The default is the project root.
97
98     name: '{project-name}-{stream}-merge-rtd'
99     path: '$WORKSPACE'
100
101     project-type: freestyle
102     concurrent: false
103     node: '{build-node}'
104
105     properties:
106       - infra-properties:
107           build-days-to-keep: '{build-days-to-keep}'
108
109     parameters:
110       - infra-parameters:
111           project: '{project}'
112           branch: '{branch}'
113           refspec: 'refs/heads/{branch}'
114           artifacts: '{archive-artifacts}'
115       - maven-exec:
116           maven-version: '{maven-version}'
117
118     scm:
119       - git:
120           credentials-id: '{jenkins-ssh-credential}'
121           url: '$GIT_BASE'
122           refspec: ''
123           choosing-strategy: 'default'
124           branches:
125             - 'refs/heads/{branch}'
126           skip-tag: true
127           wipe-workspace: true
128           submodule-recursive: '{submodule-recursive}'
129
130
131     wrappers:
132       - infra-wrappers:
133           build-timeout: '{build-timeout}'
134
135     triggers:
136       - gerrit:
137           server-name: '{server-name}'
138           trigger-on:
139             - change-merged-event
140             - comment-added-contains-event:
141                 comment-contains-value: 'remerge'
142           projects:
143             - project-compare-type: 'ANT'
144               project-pattern: '**'
145               branches:
146                 - branch-compare-type: 'ANT'
147                   branch-pattern: '**/{branch}'
148               file-paths:
149                 - compare-type: ANT
150                   pattern: docs/**/*.rst
151
152     builders:
153       - shell: !include-raw: doc-post-rtd.sh
154
155     publishers:
156       - infra-shiplogs:
157           maven-version: '{maven-version}'
158