a8d29e4b447f7d6224b5d2307fe4ec2fc3716a35
[releng.git] / jjb / opnfvdocs / docs-rtd.yaml
1 ---
2 - project:
3     name: docs-rtd
4     jobs:
5       - 'docs-merge-rtd-{stream}'
6       - 'docs-verify-rtd-{stream}'
7
8     stream:
9       - master:
10           branch: 'master'
11       - gambia:
12           branch: 'stable/{stream}'
13       - fraser:
14           branch: 'stable/{stream}'
15       - danube:
16           branch: 'stable/{stream}'
17
18     project: 'opnfvdocs'
19     rtdproject: 'opnfv'
20     # TODO: Archive Artifacts
21
22 - job-template:
23     name: 'docs-merge-rtd-{stream}'
24
25     project-type: freestyle
26
27     parameters:
28       - label:
29           name: SLAVE_LABEL
30           default: 'lf-build1'
31           description: 'Slave label on Jenkins'
32           all-nodes: false
33           node-eligibility: 'ignore-offline'
34       - project-parameter:
35           project: '{project}'
36           branch: '{branch}'
37
38     triggers:
39       - gerrit-trigger-change-merged:
40           project: '**'
41           branch: '{branch}'
42           files: 'docs/**/*.*'
43
44     builders:
45       - 'remove-old-docs-from-opnfv-artifacts'
46       - shell: |
47           if [ $GERRIT_BRANCH == "master" ]; then
48             RTD_BUILD_VERSION=latest
49           else
50             RTD_BUILD_VERSION=${{GERRIT_BRANCH/\//-}}
51           fi
52           curl -X POST --data "version_slug=$RTD_BUILD_VERSION" https://readthedocs.org/build/opnfvdocsdemo
53
54
55 - job-template:
56     name: 'docs-verify-rtd-{stream}'
57
58     project-type: freestyle
59
60     parameters:
61       - label:
62           name: SLAVE_LABEL
63           default: 'lf-build2'
64           description: 'Slave label on Jenkins'
65           all-nodes: false
66           node-eligibility: 'ignore-offline'
67       - project-parameter:
68           project: '{project}'
69           branch: '{branch}'
70       - string:
71           name: GIT_BASE
72           default: https://gerrit.opnfv.org/gerrit/opnfvdocs
73           description: 'Git URL to use on this Jenkins Slave'
74
75     scm:
76       - git-scm-with-submodules:
77           branch: '{branch}'
78
79     triggers:
80       - gerrit-trigger-patchset-created:
81           server: 'gerrit.opnfv.org'
82           project: 'opnfvdocs'
83           branch: '{branch}'
84           files: 'docs/**'
85
86     builders:
87       - shell: |
88           sudo -H pip install virtualenv
89           virtualenv $WORKSPACE/venv
90           . $WORKSPACE/venv/bin/activate
91           pip install --upgrade pip
92           pip freeze
93           pip install tox
94           sed -i s,\-b\ html,\-b\ singlehtml,g tox.ini
95           tox -edocs
96       - 'upload-review-docs'