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