Update setuptools in yardstick verify and merge jobs
[releng.git] / jjb / yardstick / yardstick.yml
1 - project:
2     name: yardstick
3     jobs:
4         - 'yardstick-{pod}'
5         - 'yardstick-daily-{stream}'
6         - 'yardstick-merge'
7         - 'yardstick-verify'
8
9     pod:
10         - opnfv-jump-1:
11             node: 'opnfv-jump-1'
12             installer_type: 'fuel'
13             installer_ip: '10.20.0.2'
14         - opnfv-jump-2:
15             node: 'opnfv-jump-2'
16             installer_type: 'foreman'
17             installer_ip: '172.30.10.73'
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
25     project: 'yardstick'
26     somevar: 'foo'
27
28 - job-template:
29     name: 'yardstick-daily-{stream}'
30
31     # Job template for daily builders
32     #
33     # Required Variables:
34     #     stream:    branch with - in place of / (eg. stable)
35     #     branch:    branch (eg. stable)
36
37     node: ericsson-build
38
39     project-type: freestyle
40     varsetabove: '{somevar}'
41
42     logrotate:
43         daysToKeep: '{build-days-to-keep}'
44         numToKeep: '{build-num-to-keep}'
45         artifactDaysToKeep: '{build-artifact-days-to-keep}'
46         artifactNumToKeep: '{build-artifact-num-to-keep}'
47
48     parameters:
49         - project-parameter:
50             project: '{project}'
51         - string:
52             name: GIT_BASE
53             default: https://gerrit.opnfv.org/gerrit/$PROJECT
54             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
55
56     scm:
57         - git-scm:
58             credentials-id: '{ssh-credentials}'
59             refspec: ''
60             branch: '{branch}'
61
62     wrappers:
63         - ssh-agent-credentials:
64             user: '{ssh-credentials}'
65
66     triggers:
67         - timed: 'H H * * *'
68
69     prebuilders:
70         - test-macro
71
72     builders:
73         - shell: |
74             pwd
75             find .
76             echo "Hello world from yardstick {somevar} daily"
77
78     postbuilders:
79         - test-macro
80
81 - job-template:
82     name: 'yardstick-verify'
83
84     project-type: freestyle
85
86     node: ericsson-build
87
88     logrotate:
89         daysToKeep: 30
90         numToKeep: 10
91         artifactDaysToKeep: -1
92         artifactNumToKeep: -1
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: '$GERRIT_REFSPEC'
108             choosing-strategy: 'gerrit'
109
110     wrappers:
111         - ssh-agent-credentials:
112             user: '{ssh-credentials}'
113
114     triggers:
115         - gerrit:
116             trigger-on:
117                 - patchset-created-event:
118                     exclude-drafts: 'false'
119                     exclude-trivial-rebase: 'false'
120                     exclude-no-code-change: 'false'
121                 - draft-published-event
122                 - comment-added-contains-event:
123                     comment-contains-value: 'recheck'
124                 - comment-added-contains-event:
125                     comment-contains-value: 'reverify'
126             projects:
127               - project-compare-type: 'ANT'
128                 project-pattern: 'yardstick'
129                 branches:
130                   - branch-compare-type: 'ANT'
131                     branch-pattern: '**/master'
132
133     builders:
134         - shell: |
135             #!/bin/bash
136
137             echo "Running unit tests..."
138             cd $WORKSPACE
139             virtualenv $WORKSPACE/yardstick_venv
140             source $WORKSPACE/yardstick_venv/bin/activate
141             easy_install -U setuptools
142             python setup.py develop > /dev/null 2>&1
143             ./run_tests.sh
144             deactivate
145
146 - job-template:
147     name: 'yardstick-merge'
148
149     # builder-merge job to run JJB update
150     #
151     # This job's purpose is to update all the JJB
152
153     project-type: freestyle
154
155     node: ericsson-build
156
157     logrotate:
158         daysToKeep: 30
159         numToKeep: 40
160         artifactDaysToKeep: -1
161         artifactNumToKeep: 5
162
163     parameters:
164         - project-parameter:
165             project: '{project}'
166         - gerrit-parameter:
167             branch: 'master'
168         - string:
169             name: GIT_BASE
170             default: https://gerrit.opnfv.org/gerrit/$PROJECT
171             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
172
173     scm:
174         - gerrit-trigger-scm:
175             credentials-id: '{ssh-credentials}'
176             refspec: ''
177             choosing-strategy: 'default'
178
179     wrappers:
180         - ssh-agent-credentials:
181             user: '{ssh-credentials}'
182
183     triggers:
184         - gerrit:
185             trigger-on:
186                 - change-merged-event
187                 - comment-added-contains-event:
188                     comment-contains-value: 'remerge'
189             projects:
190               - project-compare-type: 'ANT'
191                 project-pattern: 'yardstick'
192                 branches:
193                     - branch-compare-type: 'ANT'
194                       branch-pattern: '**/master'
195
196     builders:
197         - shell: |
198             #!/bin/bash
199
200             echo "Running unit tests..."
201             cd $WORKSPACE
202             virtualenv $WORKSPACE/yardstick_venv
203             source $WORKSPACE/yardstick_venv/bin/activate
204             easy_install -U setuptools
205             python setup.py develop > /dev/null 2>&1
206             ./run_tests.sh
207             deactivate
208
209 - job-template:
210     name: 'yardstick-{pod}'
211
212     project-type: freestyle
213
214     disabled: false
215
216     node: '{node}'
217
218     parameters:
219         - project-parameter:
220             project: '{project}'
221         - string:
222             name: INSTALLER_TYPE
223             default: '{installer_type}'
224             description: "Installer name that is used for deployment."
225         - string:
226             name: INSTALLER_IP
227             default: '{installer_ip}'
228             description: "Installer IP."
229
230     scm:
231         - git-scm:
232             credentials-id: '{ssh-credentials}'
233             refspec: ''
234             branch: master
235
236     logrotate:
237         daysToKeep: 30
238         numToKeep: 10
239         artifactDaysToKeep: -1
240         artifactNumToKeep: -1
241
242     builders:
243         - 'yardstick-fetch-os-creds'
244         - 'yardstick-ping'
245
246 ########################
247 # builder macros
248 ########################
249 - builder:
250     name: yardstick-ping
251     builders:
252         - shell: |
253             #!/bin/bash
254              set -o errexit
255              set -o pipefail
256
257             echo "Yardstick: prepare Yardstick environment"
258
259             # source openstack vars
260             if [[ ! -f $HOME/opnfv-openrc.sh ]]; then
261                 echo "Unable to access file $HOME/opnfv-openrc.sh"
262                 exit 1
263             fi
264             source $HOME/opnfv-openrc.sh
265
266             # check if cirros-0.3.3 image is already available
267             # if not, create the image
268             echo "Yardstick: configure the image"
269             IMAGE_NAME=cirros-0.3.3
270             if [[ ! $(nova image-show $IMAGE_NAME > /dev/null 2>&1) ]]; then
271                 echo "Image $IMAGE_NAME doesn't exist. Creating image $IMAGE_NAME"
272                 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
273             else
274                 echo "Image $IMAGE_NAME exists. Proceeding with yardstick."
275             fi
276
277             # set virtualenv
278             echo "Yardstick: setup virtualenv"
279             cd $WORKSPACE
280             virtualenv $WORKSPACE/yardstick_venv
281             source $WORKSPACE/yardstick_venv/bin/activate
282             python setup.py develop > /dev/null 2>&1
283
284             # set virtualenv
285             echo "Yardstick: execute ping scenario"
286             yardstick task start samples/ping.yaml -v -d
287
288             # cleanup
289             echo "Yardstick: cleanup"
290             glance image-delete $IMAGE_NAME
291
292             # done
293             echo "Yardstick: done!"
294
295 - builder:
296     name: yardstick-fetch-os-creds
297     builders:
298         - shell:
299             !include-raw ../../utils/fetch_os_creds.sh