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