Merge "Re-enabling docs jobs for Danube"
[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       - danube:
12           branch: 'stable/{stream}'
13       - euphrates:
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       - 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       - shell: |
42           if [ $GERRIT_BRANCH == "master" ]; then
43             RTD_BUILD_VERSION=latest
44           else
45             RTD_BUILD_VERSION=${{GERRIT_BRANCH/\//-}}
46           fi
47           curl -X POST --data "version_slug=$RTD_BUILD_VERSION" https://readthedocs.org/build/opnfvdocsdemo
48
49
50 - job-template:
51     name: 'docs-verify-rtd-{stream}'
52
53     project-type: freestyle
54
55     parameters:
56       - label:
57           name: SLAVE_LABEL
58           default: 'lf-build2'
59           description: 'Slave label on Jenkins'
60       - project-parameter:
61           project: '{project}'
62           branch: '{branch}'
63       - string:
64           name: GIT_BASE
65           default: https://gerrit.opnfv.org/gerrit/opnfvdocs
66           description: 'Git URL to use on this Jenkins Slave'
67
68     scm:
69       - git-scm-with-submodules:
70           branch: '{branch}'
71
72     triggers:
73       - gerrit-trigger-patchset-created:
74           server: 'gerrit.opnfv.org'
75           project: '**'
76           branch: '{branch}'
77           files: 'docs/**/*.*'
78
79     builders:
80       - shell: |
81           if [ "$GERRIT_PROJECT" != "opnfvdocs" ]; then
82               cd docs/submodules/$GERRIT_PROJECT
83               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
84           else
85               git fetch origin $GERRIT_REFSPEC && git checkout FETCH_HEAD
86           fi
87       - shell: |
88           sudo 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           tox -edocs