docs: fix yardstick docs builder
[releng.git] / jjb / yardstick / yardstick-project-jobs.yml
1 ###################################################
2 # All the jobs except verify have been removed!
3 # They will only be enabled on request by projects!
4 ###################################################
5 - project:
6     name: yardstick-project-jobs
7
8     project: 'yardstick'
9
10     jobs:
11         - 'yardstick-verify-{stream}'
12         - 'yardstick-merge-{stream}'
13
14     stream:
15         - master:
16             branch: '{stream}'
17             gs-pathname: ''
18         - brahmaputra:
19             branch: 'stable/{stream}'
20             gs-pathname: '/{stream}'
21
22 ################################
23 # job templates
24 ################################
25
26 - job-template:
27     name: 'yardstick-verify-{stream}'
28
29     parameters:
30         - project-parameter:
31             project: '{project}'
32         - gerrit-parameter:
33             branch: '{branch}'
34         - 'ericsson-build-defaults'
35
36     scm:
37         - gerrit-trigger-scm:
38             credentials-id: '{ssh-credentials}'
39             refspec: '$GERRIT_REFSPEC'
40             choosing-strategy: 'gerrit'
41
42     triggers:
43         - gerrit:
44             trigger-on:
45                 - patchset-created-event:
46                     exclude-drafts: 'false'
47                     exclude-trivial-rebase: 'false'
48                     exclude-no-code-change: 'false'
49                 - draft-published-event
50                 - comment-added-contains-event:
51                     comment-contains-value: 'recheck'
52                 - comment-added-contains-event:
53                     comment-contains-value: 'reverify'
54             projects:
55               - project-compare-type: 'ANT'
56                 project-pattern: '{project}'
57                 branches:
58                   - branch-compare-type: 'ANT'
59                     branch-pattern: '**/{branch}'
60     builders:
61         - yardstick-unit-tests-and-docs-build
62         - upload-under-review-docs-to-opnfv-artifacts
63         - report-docs-build-result-to-gerrit
64
65 - job-template:
66     name: 'yardstick-merge-{stream}'
67
68     parameters:
69         - project-parameter:
70             project: '{project}'
71         - gerrit-parameter:
72             branch: '{branch}'
73         - 'ericsson-build-defaults'
74         - string:
75             name: GS_URL
76             default: '$GS_BASE{gs-pathname}'
77             description: "Directory where the build artifact will be located upon the completion     of the build."
78
79     scm:
80         - gerrit-trigger-scm:
81             credentials-id: '{ssh-credentials}'
82             refspec: ''
83             choosing-strategy: 'default'
84
85     triggers:
86         - gerrit:
87             trigger-on:
88                 - change-merged-event
89                 - comment-added-contains-event:
90                     comment-contains-value: 'remerge'
91             projects:
92               - project-compare-type: 'ANT'
93                 project-pattern: '{project}'
94                 branches:
95                     - branch-compare-type: 'ANT'
96                       branch-pattern: '**/{branch}'
97
98     builders:
99         - yardstick-unit-tests-and-docs-build
100         - upload-generated-docs-to-opnfv-artifacts
101         - report-docs-build-result-to-gerrit
102         - remove-old-docs-from-opnfv-artifacts
103
104 ################################
105 # job builders
106 ################################
107
108 - builder:
109     name: yardstick-unit-tests-and-docs-build
110     builders:
111         - shell: |
112             #!/bin/bash
113             set -o errexit
114             set -o pipefail
115
116             echo "Running unit tests..."
117             cd $WORKSPACE
118             virtualenv $WORKSPACE/yardstick_venv
119             source $WORKSPACE/yardstick_venv/bin/activate
120             easy_install -U setuptools
121             python setup.py develop
122
123             # unit tests
124             ./run_tests.sh
125
126             # generate api doc sources
127             sphinx-apidoc -o docs/apidocs yardstick
128
129             # build docs
130             git clone ssh://gerrit.opnfv.org:29418/releng
131             GERRIT_COMMENT=gerrit_comment.txt ./releng/utils/docs-build.sh
132
133             deactivate