Remove OPNFV Docs Euphrates Jobs
[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
16     project: 'opnfvdocs'
17     rtdproject: 'opnfv'
18     # TODO: Archive Artifacts
19
20 - job-template:
21     name: 'docs-merge-rtd-{stream}'
22
23     project-type: freestyle
24
25     parameters:
26       - label:
27           name: SLAVE_LABEL
28           default: 'lf-build1'
29           description: 'Slave label on Jenkins'
30           all-nodes: false
31           node-eligibility: 'ignore-offline'
32       - project-parameter:
33           project: '{project}'
34           branch: '{branch}'
35
36     triggers:
37       - gerrit-trigger-change-merged:
38           project: '**'
39           branch: '{branch}'
40           files: 'docs/**/*.*'
41
42     builders:
43       - 'remove-old-docs-from-opnfv-artifacts'
44       - shell: |
45           if [ $GERRIT_BRANCH == "master" ]; then
46             RTD_BUILD_VERSION=latest
47           else
48             RTD_BUILD_VERSION=${{GERRIT_BRANCH/\//-}}
49           fi
50           curl -X POST --data "version_slug=$RTD_BUILD_VERSION" https://readthedocs.org/build/opnfvdocsdemo
51
52
53 - job-template:
54     name: 'docs-verify-rtd-{stream}'
55
56     project-type: freestyle
57
58     parameters:
59       - label:
60           name: SLAVE_LABEL
61           default: 'lf-build2'
62           description: 'Slave label on Jenkins'
63           all-nodes: false
64           node-eligibility: 'ignore-offline'
65       - project-parameter:
66           project: '{project}'
67           branch: '{branch}'
68       - string:
69           name: GIT_BASE
70           default: https://gerrit.opnfv.org/gerrit/opnfvdocs
71           description: 'Git URL to use on this Jenkins Slave'
72
73     scm:
74       - git-scm-with-submodules:
75           branch: '{branch}'
76
77     triggers:
78       - gerrit-trigger-patchset-created:
79           server: 'gerrit.opnfv.org'
80           project: '**'
81           branch: '{branch}'
82           files: 'docs/**'
83
84     builders:
85       - shell: |
86           if [ "$GERRIT_PROJECT" != "opnfvdocs" ]; then
87               # Temporary hacky solution to handle local builds for projects
88               # that already moved away from submodules
89               if ! cd docs/submodules/$GERRIT_PROJECT 2 > /dev/null; then
90                   rm -rf .* * 2 > /dev/null
91                   git clone ${{GIT_BASE/opnfvdocs/$GERRIT_PROJECT}} .
92               fi
93               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
94               cd -
95           else
96               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
97           fi
98           if [ -d docs/subdmodules ]; then
99               for project in docs/submodules/*; do
100                   cd $project && git submodule deinit -f . && cd -
101               done
102           fi
103       - shell: |
104           sudo -H pip install virtualenv
105           virtualenv $WORKSPACE/venv
106           . $WORKSPACE/venv/bin/activate
107           pip install --upgrade pip
108           pip freeze
109           pip install tox
110           sed -i s,\-b\ html,\-b\ singlehtml,g tox.ini
111           tox -edocs
112       - 'upload-review-docs'