Invoke yardstick docker image.
[releng.git] / jjb / yardstick / yardstick.yml
1 - project:
2     name: yardstick
3
4     installer:
5         - fuel:
6             node: 'opnfv-jump-2'
7             installer_type: 'fuel'
8             installer_ip: '10.20.0.2'
9         - foreman:
10             node: 'opnfv-jump-2'
11             installer_type: 'foreman'
12             installer_ip: '172.30.10.73'
13
14     jobs:
15         - 'yardstick-{installer}-{stream}'
16         - 'yardstick-merge'
17         - 'yardstick-verify'
18
19     # stream:    branch with - in place of / (eg. stable-helium)
20     # branch:    branch (eg. stable/helium)
21     stream:
22         - master:
23             branch: 'master'
24         - stable-arno:
25             branch: 'stable/arno'
26             gs-pathname: '/arno'
27
28     project: 'yardstick'
29
30 - job-template:
31     name: 'yardstick-verify'
32
33     project-type: freestyle
34
35     node: ericsson-build
36
37     logrotate:
38         daysToKeep: 30
39         numToKeep: 10
40         artifactDaysToKeep: -1
41         artifactNumToKeep: -1
42
43     parameters:
44         - project-parameter:
45             project: '{project}'
46         - gerrit-parameter:
47             branch: 'master'
48         - string:
49             name: GIT_BASE
50             default: https://gerrit.opnfv.org/gerrit/$PROJECT
51             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
52
53     scm:
54         - gerrit-trigger-scm:
55             credentials-id: '{ssh-credentials}'
56             refspec: '$GERRIT_REFSPEC'
57             choosing-strategy: 'gerrit'
58
59     wrappers:
60         - ssh-agent-credentials:
61             user: '{ssh-credentials}'
62
63     triggers:
64         - gerrit:
65             trigger-on:
66                 - patchset-created-event:
67                     exclude-drafts: 'false'
68                     exclude-trivial-rebase: 'false'
69                     exclude-no-code-change: 'false'
70                 - draft-published-event
71                 - comment-added-contains-event:
72                     comment-contains-value: 'recheck'
73                 - comment-added-contains-event:
74                     comment-contains-value: 'reverify'
75             projects:
76               - project-compare-type: 'ANT'
77                 project-pattern: 'yardstick'
78                 branches:
79                   - branch-compare-type: 'ANT'
80                     branch-pattern: '**/master'
81
82     builders:
83         - shell: |
84             #!/bin/bash
85             set -o errexit
86             set -o pipefail
87
88             echo "Running unit tests..."
89             cd $WORKSPACE
90             virtualenv $WORKSPACE/yardstick_venv
91             source $WORKSPACE/yardstick_venv/bin/activate
92             easy_install -U setuptools
93             python setup.py develop
94             ./run_tests.sh
95             deactivate
96
97 - job-template:
98     name: 'yardstick-merge'
99
100     # builder-merge job to run JJB update
101     #
102     # This job's purpose is to update all the JJB
103
104     project-type: freestyle
105
106     node: ericsson-build
107
108     logrotate:
109         daysToKeep: 30
110         numToKeep: 40
111         artifactDaysToKeep: -1
112         artifactNumToKeep: 5
113
114     parameters:
115         - project-parameter:
116             project: '{project}'
117         - gerrit-parameter:
118             branch: 'master'
119         - string:
120             name: GIT_BASE
121             default: https://gerrit.opnfv.org/gerrit/$PROJECT
122             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
123
124     scm:
125         - gerrit-trigger-scm:
126             credentials-id: '{ssh-credentials}'
127             refspec: ''
128             choosing-strategy: 'default'
129
130     wrappers:
131         - ssh-agent-credentials:
132             user: '{ssh-credentials}'
133
134     triggers:
135         - gerrit:
136             trigger-on:
137                 - change-merged-event
138                 - comment-added-contains-event:
139                     comment-contains-value: 'remerge'
140             projects:
141               - project-compare-type: 'ANT'
142                 project-pattern: 'yardstick'
143                 branches:
144                     - branch-compare-type: 'ANT'
145                       branch-pattern: '**/master'
146
147     builders:
148         - shell: |
149             #!/bin/bash
150             set -o errexit
151             set -o pipefail
152
153             echo "Running unit tests..."
154             cd $WORKSPACE
155             virtualenv $WORKSPACE/yardstick_venv
156             source $WORKSPACE/yardstick_venv/bin/activate
157             easy_install -U setuptools
158             python setup.py develop
159             ./run_tests.sh
160             deactivate
161
162 - job-template:
163     name: 'yardstick-{installer}-{stream}'
164
165     project-type: freestyle
166
167     disabled: false
168
169     node: '{node}'
170
171     parameters:
172         - project-parameter:
173             project: '{project}'
174         - string:
175             name: INSTALLER_TYPE
176             default: '{installer_type}'
177             description: "Installer name that is used for deployment."
178         - string:
179             name: INSTALLER_IP
180             default: '{installer_ip}'
181             description: "Installer IP."
182
183     scm:
184         - git-scm:
185             credentials-id: '{ssh-credentials}'
186             refspec: ''
187             branch: master
188
189     logrotate:
190         daysToKeep: 30
191         numToKeep: 10
192         artifactDaysToKeep: -1
193         artifactNumToKeep: -1
194
195     builders:
196         - 'yardstick-fetch-os-creds'
197         - 'yardstick-daily'
198
199     publishers:
200         - email:
201             recipients: ana.cunha@ericsson.com
202
203 ########################
204 # builder macros
205 ########################
206 - builder:
207     name: yardstick-daily
208     builders:
209         - shell: |
210             #!/bin/bash
211             set -o errexit
212             set -o pipefail
213
214             echo "Yardstick: Run benchmark test suites ..."
215
216             # Make sure we have latest image
217             docker pull opnfv/yardstick-ci
218
219             docker run \
220                --privileged=true \
221                 --rm \
222                 -t \
223                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
224                 -e "INSTALLER_IP=${INSTALLER_IP}" \
225                 opnfv/yardstick-ci \
226                 run_benchmarks
227
228             echo "Yardstick: done!"
229
230 - builder:
231     name: yardstick-fetch-os-creds
232     builders:
233         - shell:
234             !include-raw ../../utils/fetch_os_creds.sh