Fix GIT_BASE, timer and downstream triggers and add POD_NAME parameter
[releng.git] / jjb / yardstick / yardstick.yml
1 - project:
2     name: yardstick
3
4     project: 'yardstick'
5
6     pod:
7         - lf:
8             node: 'opnfv-jump-2'
9             installer_type: 'fuel'
10             installer_ip: '10.20.0.2'
11         - ericsson:
12             node: 'yardstick-pod'
13             installer_type: 'fuel'
14             installer_ip: '10.20.0.2'
15
16     installer:
17         - fuel
18
19     jobs:
20         - 'yardstick-{installer}-{pod}-{stream}'
21         - 'yardstick-merge'
22         - 'yardstick-verify'
23
24     # stream:    branch with - in place of / (eg. stable-helium)
25     # branch:    branch (eg. stable/helium)
26     stream:
27         - master:
28             branch: 'master'
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}-{pod}-{stream}'
164
165     project-type: freestyle
166
167     disabled: false
168
169     node: '{node}'
170
171     parameters:
172         - project-parameter:
173             project: '{project}'
174         - '{pod}-parameters'
175         - string:
176             name: POD_NAME
177             default: '{pod}'
178             description: "POD where the job runs"
179         - string:
180             name: INSTALLER_TYPE
181             default: '{installer_type}'
182             description: "Installer name that is used for deployment."
183         - string:
184             name: INSTALLER_IP
185             default: '{installer_ip}'
186             description: "Installer IP."
187
188     scm:
189         - git-scm:
190             credentials-id: '{ssh-credentials}'
191             refspec: ''
192             branch: master
193
194     logrotate:
195         daysToKeep: 30
196         numToKeep: 10
197         artifactDaysToKeep: -1
198         artifactNumToKeep: -1
199
200     triggers:
201         - 'yardstick-trigger-{pod}'
202
203     builders:
204         - 'yardstick-fetch-os-creds'
205         - 'yardstick-daily'
206
207     publishers:
208         - email:
209             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
210
211 ########################
212 # builder macros
213 ########################
214 - builder:
215     name: yardstick-daily
216     builders:
217         - shell: |
218             #!/bin/bash
219             set -o errexit
220
221             echo "Yardstick: Run benchmark test suites ..."
222
223             # Remove old containers
224             docker ps | grep opnfv/yardstick-ci |\
225                 awk '{print $1}' | xargs -r docker stop &>/dev/null
226             docker ps -a | grep opnfv/yardstick-ci |\
227                 awk '{print $1}' | xargs -r  docker rm &>/dev/null
228
229             # Make sure we have latest image
230             docker pull opnfv/yardstick-ci
231
232             docker run \
233                --privileged=true \
234                 --rm \
235                 -t \
236                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
237                 -e "INSTALLER_IP=${INSTALLER_IP}" \
238                 opnfv/yardstick-ci \
239                 run_benchmarks
240
241             echo "Yardstick: done!"
242
243 - builder:
244     name: yardstick-fetch-os-creds
245     builders:
246         - shell:
247             !include-raw ../../utils/fetch_os_creds.sh
248
249 ########################
250 # parameter macros
251 ########################
252 - parameter:
253     name: 'ericsson-parameters'
254     parameters:
255         - string:
256             name: GIT_BASE
257             default: https://gerrit.opnfv.org/gerrit/$PROJECT
258             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
259
260 - parameter:
261     name: 'lf-parameters'
262     parameters:
263         - string:
264             name: GIT_BASE
265             default: ssh://gerrit.opnfv.org:29418/$PROJECT
266             description: "URL for LF POD"
267
268 ########################
269 # trigger macros
270 ########################
271 - trigger:
272     name: 'yardstick-trigger-ericsson'
273     triggers:
274         - timed: '@midnight'
275
276 - trigger:
277     name: 'yardstick-trigger-lf'
278     triggers:
279         - timed: '#@midnight'