Reconfigure Yardstick jobs after LF Lab reconfiguration
[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-ping'
198
199     publishers:
200         - email:
201             recipients: ana.cunha@ericsson.com
202
203 ########################
204 # builder macros
205 ########################
206 - builder:
207     name: yardstick-ping
208     builders:
209         - shell: |
210             #!/bin/bash
211              set -o errexit
212              set -o pipefail
213
214             echo "Yardstick: prepare Yardstick environment"
215
216             # source openstack vars
217             if [[ ! -f $HOME/opnfv-openrc.sh ]]; then
218                 echo "Unable to access file $HOME/opnfv-openrc.sh"
219                 exit 1
220             fi
221             source $HOME/opnfv-openrc.sh
222
223             # check if cirros-0.3.3 image is already available
224             # if not, create the image
225             echo "Yardstick: configure the image"
226             IMAGE_NAME=cirros-0.3.3
227             if ! nova image-show $IMAGE_NAME > /dev/null 2>&1; then
228                 echo "Image $IMAGE_NAME doesn't exist. Creating image $IMAGE_NAME"
229                 glance image-create --name cirros-0.3.3 --is-public true --disk-format qcow2 --container-format bare --file $HOME/yardstick/cirros-0.3.3-x86_64-disk.img
230             fi
231
232             # set virtualenv
233             echo "Yardstick: setup virtualenv"
234             cd $WORKSPACE
235             virtualenv $WORKSPACE/yardstick_venv
236             source $WORKSPACE/yardstick_venv/bin/activate
237             python setup.py develop > /dev/null 2>&1
238
239             # set virtualenv
240             echo "Yardstick: execute ping scenario"
241             yardstick task start samples/ping.yaml -v -d
242
243             # cleanup
244             echo "Yardstick: cleanup"
245             glance image-delete $IMAGE_NAME
246
247             # done
248             echo "Yardstick: done!"
249
250 - builder:
251     name: yardstick-fetch-os-creds
252     builders:
253         - shell:
254             !include-raw ../../utils/fetch_os_creds.sh