65d98621cf71baa51fbbb55aba53fad9e7bd5622
[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     node: ericsson-build
34
35     parameters:
36         - project-parameter:
37             project: '{project}'
38         - gerrit-parameter:
39             branch: 'master'
40         - string:
41             name: GIT_BASE
42             default: https://gerrit.opnfv.org/gerrit/$PROJECT
43             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
44
45     scm:
46         - gerrit-trigger-scm:
47             credentials-id: '{ssh-credentials}'
48             refspec: '$GERRIT_REFSPEC'
49             choosing-strategy: 'gerrit'
50
51     triggers:
52         - gerrit:
53             trigger-on:
54                 - patchset-created-event:
55                     exclude-drafts: 'false'
56                     exclude-trivial-rebase: 'false'
57                     exclude-no-code-change: 'false'
58                 - draft-published-event
59                 - comment-added-contains-event:
60                     comment-contains-value: 'recheck'
61                 - comment-added-contains-event:
62                     comment-contains-value: 'reverify'
63             projects:
64               - project-compare-type: 'ANT'
65                 project-pattern: 'yardstick'
66                 branches:
67                   - branch-compare-type: 'ANT'
68                     branch-pattern: '**/master'
69
70     builders:
71         - shell: |
72             #!/bin/bash
73             set -o errexit
74             set -o pipefail
75
76             echo "Running unit tests..."
77             cd $WORKSPACE
78             virtualenv $WORKSPACE/yardstick_venv
79             source $WORKSPACE/yardstick_venv/bin/activate
80             easy_install -U setuptools
81             python setup.py develop
82             ./run_tests.sh
83             deactivate
84
85 - job-template:
86     name: 'yardstick-merge'
87
88     # builder-merge job to run JJB update
89     #
90     # This job's purpose is to update all the JJB
91
92     node: ericsson-build
93
94     parameters:
95         - project-parameter:
96             project: '{project}'
97         - gerrit-parameter:
98             branch: 'master'
99         - string:
100             name: GIT_BASE
101             default: https://gerrit.opnfv.org/gerrit/$PROJECT
102             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
103
104     scm:
105         - gerrit-trigger-scm:
106             credentials-id: '{ssh-credentials}'
107             refspec: ''
108             choosing-strategy: 'default'
109
110     triggers:
111         - gerrit:
112             trigger-on:
113                 - change-merged-event
114                 - comment-added-contains-event:
115                     comment-contains-value: 'remerge'
116             projects:
117               - project-compare-type: 'ANT'
118                 project-pattern: 'yardstick'
119                 branches:
120                     - branch-compare-type: 'ANT'
121                       branch-pattern: '**/master'
122
123     builders:
124         - shell: |
125             #!/bin/bash
126             set -o errexit
127             set -o pipefail
128
129             echo "Running unit tests..."
130             cd $WORKSPACE
131             virtualenv $WORKSPACE/yardstick_venv
132             source $WORKSPACE/yardstick_venv/bin/activate
133             easy_install -U setuptools
134             python setup.py develop
135             ./run_tests.sh
136             deactivate
137
138 - job-template:
139     name: 'yardstick-{installer}-{pod}-{stream}'
140
141     disabled: false
142
143     node: '{node}'
144
145     parameters:
146         - project-parameter:
147             project: '{project}'
148         - '{pod}-parameters'
149         - string:
150             name: POD_NAME
151             default: '{pod}'
152             description: "POD where the job runs"
153         - string:
154             name: INSTALLER_TYPE
155             default: '{installer_type}'
156             description: "Installer name that is used for deployment."
157         - string:
158             name: INSTALLER_IP
159             default: '{installer_ip}'
160             description: "Installer IP."
161
162     scm:
163         - git-scm:
164             credentials-id: '{ssh-credentials}'
165             refspec: ''
166             branch: master
167
168     triggers:
169         - 'yardstick-trigger-{pod}'
170
171     builders:
172         - 'yardstick-fetch-os-creds'
173         - 'yardstick-daily'
174
175     publishers:
176         - email:
177             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
178
179 ########################
180 # builder macros
181 ########################
182 - builder:
183     name: yardstick-daily
184     builders:
185         - shell: |
186             #!/bin/bash
187             set -o errexit
188
189             echo "Yardstick: Run benchmark test suites ..."
190
191             # Remove old containers
192             docker ps | grep opnfv/yardstick-ci |\
193                 awk '{print $1}' | xargs -r docker stop &>/dev/null
194             docker ps -a | grep opnfv/yardstick-ci |\
195                 awk '{print $1}' | xargs -r  docker rm &>/dev/null
196
197             # Make sure we have latest image
198             docker pull opnfv/yardstick-ci
199
200             docker run \
201                --privileged=true \
202                 --rm \
203                 -t \
204                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
205                 -e "INSTALLER_IP=${INSTALLER_IP}" \
206                 opnfv/yardstick-ci \
207                 run_benchmarks
208
209             echo "Yardstick: done!"
210
211 - builder:
212     name: yardstick-fetch-os-creds
213     builders:
214         - shell:
215             !include-raw ../../utils/fetch_os_creds.sh
216
217 ########################
218 # parameter macros
219 ########################
220 - parameter:
221     name: 'ericsson-parameters'
222     parameters:
223         - string:
224             name: GIT_BASE
225             default: https://gerrit.opnfv.org/gerrit/$PROJECT
226             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
227
228 - parameter:
229     name: 'lf-parameters'
230     parameters:
231         - string:
232             name: GIT_BASE
233             default: ssh://gerrit.opnfv.org:29418/$PROJECT
234             description: "URL for LF POD"
235
236 ########################
237 # trigger macros
238 ########################
239 - trigger:
240     name: 'yardstick-trigger-ericsson'
241     triggers:
242         - timed: '@midnight'
243
244 - trigger:
245     name: 'yardstick-trigger-lf'
246     triggers:
247         - timed: '#@midnight'