Merge "test: Set build name of test jobs to DEPLOY_SCENARIO"
[releng.git] / jjb / yardstick / yardstick-ci-jobs.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: yardstick
6
7     project: '{name}'
8
9 #--------------------------------
10 # BRANCH ANCHORS
11 #--------------------------------
12     master: &master
13         stream: master
14         branch: '{stream}'
15         gs-pathname: ''
16     brahmaputra: &brahmaputra
17         stream: brahmaputra
18         branch: 'stable/{stream}'
19         gs-pathname: '{stream}'
20 #--------------------------------
21 # POD, INSTALLER, AND BRANCH MAPPING
22 #--------------------------------
23 #        brahmaputra
24 #--------------------------------
25     pod:
26         - opnfv-jump-2:
27             installer: fuel
28             <<: *brahmaputra
29         - intel-pod5:
30             installer: joid
31             <<: *brahmaputra
32         - huawei-us-deploy-bare-1:
33             installer: compass
34             <<: *brahmaputra
35 #--------------------------------
36 #        master
37 #--------------------------------
38         - ericsson-pod1:
39             installer: fuel
40             <<: *master
41         - ericsson-pod2:
42             installer: fuel
43             <<: *master
44         - intel-pod6:
45             installer: joid
46             <<: *master
47         - intel-pod8:
48             installer: compass
49             <<: *master
50         - zte-build-1:
51             installer: fuel
52             <<: *master
53         - orange-pod2:
54             installer: joid
55             <<: *master
56 #--------------------------------
57     loop:
58         - daily
59
60     jobs:
61         - 'yardstick-{installer}-{pod}-{loop}-{stream}'
62
63 ################################
64 # job templates
65 ################################
66 - job-template:
67     name: 'yardstick-{installer}-{pod}-{loop}-{stream}'
68
69     disabled: false
70
71     wrappers:
72         - build-name:
73             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
74
75     parameters:
76         - project-parameter:
77             project: '{project}'
78         - '{pod}-defaults'
79         - '{installer}-defaults'
80         - 'yardstick-params-{pod}'
81         - string:
82             name: YARDSTICK_SUITE_NAME
83             default: opnfv_${{NODE_NAME}}_{loop}.yaml
84             description: 'Path to test suite'
85
86     scm:
87         - git-scm:
88             credentials-id: '{ssh-credentials}'
89             refspec: ''
90             branch: '{branch}'
91
92     builders:
93         - 'yardstick-cleanup'
94         - 'yardstick-fetch-os-creds'
95         - 'yardstick-daily'
96
97     publishers:
98         - email:
99             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
100
101 ########################
102 # builder macros
103 ########################
104 - builder:
105     name: yardstick-daily
106     builders:
107         - shell: |
108             #!/bin/bash
109             set -o errexit
110
111             echo "Yardstick: Run benchmark test suites ..."
112
113             # Pull the latest image
114             docker pull opnfv/yardstick
115
116             docker run \
117                --privileged=true \
118                 --rm \
119                 -t \
120                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
121                 -e "INSTALLER_IP=${INSTALLER_IP}" \
122                 -e "POD_NAME=${NODE_NAME}" \
123                 -e "EXTERNAL_NETWORK=${EXTERNAL_NETWORK}" \
124                 -e "YARDSTICK_BRANCH=${GERRIT_BRANCH}" \
125                 opnfv/yardstick \
126                 run_tests.sh $YARDSTICK_DB_BACKEND \
127                 $YARDSTICK_SUITE_NAME
128
129             echo "Yardstick: done!"
130
131 - builder:
132     name: yardstick-fetch-os-creds
133     builders:
134         - shell:
135             !include-raw ../../utils/fetch_os_creds.sh
136
137 - builder:
138     name: yardstick-cleanup
139     builders:
140         - shell: |
141             #!/bin/bash
142
143             echo "Cleaning up docker containers/images..."
144
145             # Remove previous running containers if exist
146             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
147                 echo "Removing existing opnfv/yardstick containers..."
148                 docker ps | grep opnfv/yardstick | awk '{print $1}' | xargs docker stop
149                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm
150             fi
151
152             # Remove existing images if exist
153             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
154                 echo "Docker images to remove:"
155                 docker images | head -1 && docker images | grep opnfv/yardstick
156                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
157                 for tag in "${image_tags[@]}"; do
158                     echo "Removing docker image opnfv/yardstick:$tag..."
159                     docker rmi opnfv/yardstick:$tag
160                 done
161             fi
162 ########################
163 # parameter macros
164 ########################
165 - parameter:
166     name: 'yardstick-params-intel-pod5'
167     parameters:
168         - string:
169             name: YARDSTICK_DB_BACKEND
170             default: ''
171             description: 'Arguments to use in order to choose the backend DB'
172
173 - parameter:
174     name: 'yardstick-params-intel-pod6'
175     parameters:
176         - string:
177             name: YARDSTICK_DB_BACKEND
178             default: ''
179             description: 'Arguments to use in order to choose the backend DB'
180
181 - parameter:
182     name: 'yardstick-params-intel-pod8'
183     parameters:
184         - string:
185             name: YARDSTICK_DB_BACKEND
186             default: ''
187             description: 'Arguments to use in order to choose the backend DB'
188
189 - parameter:
190     name: 'yardstick-params-ericsson-pod1'
191     parameters:
192         - string:
193             name: YARDSTICK_DB_BACKEND
194             default: ''
195             description: 'Arguments to use in order to choose the backend DB'
196
197 - parameter:
198     name: 'yardstick-params-ericsson-pod2'
199     parameters:
200         - string:
201             name: YARDSTICK_DB_BACKEND
202             default: ''
203             description: 'Arguments to use in order to choose the backend DB'
204
205 - parameter:
206     name: 'yardstick-params-opnfv-jump-2'
207     parameters:
208         - string:
209             name: YARDSTICK_DB_BACKEND
210             default: '-r 213.77.62.197'
211             description: 'Arguments to use in order to choose the backend DB'
212
213 - parameter:
214     name: 'yardstick-params-huawei-us-deploy-bare-1'
215     parameters:
216         - string:
217             name: YARDSTICK_DB_BACKEND
218             default: ''
219             description: 'Arguments to use in order to choose the backend DB'
220
221 - parameter:
222     name: 'yardstick-params-zte-build-1'
223     parameters:
224         - string:
225             name: YARDSTICK_DB_BACKEND
226             default: ''
227             description: 'Arguments to use in order to choose the backend DB'
228
229 - parameter:
230     name: 'yardstick-params-orange-pod2'
231     parameters:
232         - string:
233             name: YARDSTICK_DB_BACKEND
234             default: ''
235             description: 'Arguments to use in order to choose the backend DB'