Merge "Update Global-jjb to master"
[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       - fraser:
12           branch: 'stable/{stream}'
13       - danube:
14           branch: 'stable/{stream}'
15       - euphrates:
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: '**'
83           branch: '{branch}'
84           files: 'docs/**'
85
86     builders:
87       - shell: |
88           if [ "$GERRIT_PROJECT" != "opnfvdocs" ]; then
89               cd docs/submodules/$GERRIT_PROJECT
90               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
91               cd -
92           else
93               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
94           fi
95           if [ -d docs/subdmodules ]; then
96               for project in docs/submodules/*; do
97                   cd $project && git submodule deinit -f . && cd -
98               done
99           fi
100       - shell: |
101           sudo -H pip install virtualenv
102           virtualenv $WORKSPACE/venv
103           . $WORKSPACE/venv/bin/activate
104           pip install --upgrade pip
105           pip freeze
106           pip install tox
107           sed -i s,\-b\ html,\-b\ singlehtml,g tox.ini
108           tox -edocs
109       - 'upload-review-docs'