Implement ODL JJB get-scm-with-submodules
[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       - gerrit-trigger-scm:
35           refspec: ''
36           choosing-strategy: 'gerrit'
37           submodule-recursive: '{submodule-recursive}'
38
39     wrappers:
40       - infra-wrappers:
41           build-timeout: '{build-timeout}'
42
43     triggers:
44       - gerrit-trigger-patch-submitted:
45           server: '{server-name}'
46           project: '**'
47           branch: '{branch}'
48           files: 'docs/**/*.rst'
49       - timed: 'H H * * *'
50
51     builders:
52       - shell: |
53           if [ "$GERRIT_PROJECT" != "doc" ]; then
54               cd docs/submodules/$GERRIT_PROJECT
55               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
56           else
57               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
58           fi
59       - shell: |
60           #!/bin/bash
61           virtualenv $WORKSPACE/venv-tox
62           source $WORKSPACE/venv-tox/bin/activate
63           pip install --upgrade pip
64           pip install --upgrade tox argparse
65           pip freeze
66           cd $WORKSPACE/{path}
67           tox
68
69     publishers:
70       - infra-shiplogs:
71           maven-version: '{maven-version}'
72
73 - job-template:
74     # Job template for merging/publishing Sphinx/Restructured Text at RTD
75     #
76     # The purpose of this job template is to trigger updates after
77     # a merge of documentation source in gerrit
78     #
79     # Required Variables:
80     #     branch:        git branch
81     #     rtdproject:    name of a project at readthedocs.io
82     # Optional Variables:
83     #     path:      directory containing the project's tox.ini relative to
84     #                the workspace. The default is the project root.
85
86     name: '{project-name}-{stream}-merge-rtd'
87     path: '$WORKSPACE'
88
89     project-type: freestyle
90     concurrent: false
91     node: '{build-node}'
92
93     properties:
94       - infra-properties:
95           build-days-to-keep: '{build-days-to-keep}'
96
97     parameters:
98       - infra-parameters:
99           project: '{project}'
100           branch: '{branch}'
101           refspec: 'refs/heads/{branch}'
102           artifacts: '{archive-artifacts}'
103       - maven-exec:
104           maven-version: '{maven-version}'
105
106
107     scm:
108       - gerrit-trigger-scm:
109           refspec: ''
110           choosing-strategy: 'gerrit'
111           submodule-recursive: '{submodule-recursive}'
112
113     wrappers:
114       - infra-wrappers:
115           build-timeout: '{build-timeout}'
116
117     triggers:
118       - gerrit:
119           server-name: '{server-name}'
120           trigger-on:
121             - change-merged-event
122             - comment-added-contains-event:
123                 comment-contains-value: 'remerge'
124           projects:
125             - project-compare-type: 'ANT'
126               project-pattern: '**'
127               branches:
128                 - branch-compare-type: 'ANT'
129                   branch-pattern: '**/{branch}'
130               file-paths:
131                 - compare-type: ANT
132                   pattern: docs/**/*.rst
133
134     builders:
135       - shell: !include-raw: doc-post-rtd.sh
136
137     publishers:
138       - infra-shiplogs:
139           maven-version: '{maven-version}'
140