Bottlenecks: bugfix for missing SCENARIO parameter
[releng.git] / jjb / bottlenecks / bottlenecks-ci-jobs.yml
1 ####################################
2 # job configuration for bottlenecks
3 ####################################
4 - project:
5     name: bottlenecks-ci-jobs
6
7     project: 'bottlenecks'
8
9 #--------------------------------
10 # BRANCH ANCHORS
11 #--------------------------------
12     master: &master
13         stream: master
14         branch: '{stream}'
15         #This is used for common project file storage
16         gs-pathname: ''
17         #This is used for different test suite dependent packages storage
18         gs-packagepath: '/{suite}'
19         #docker tag used for version control
20         docker-tag: 'latest'
21     brahmaputra: &brahmaputra
22         stream: brahmaputra
23         branch: 'stable/{stream}'
24         gs-pathname: '/{stream}'
25         gs-packagepath: '/{stream}/{suite}'
26         docker-tag: 'brahmaputra'
27 #--------------------------------
28 # POD, INSTALLER, AND BRANCH MAPPING
29 #--------------------------------
30 #        brahmaputra
31 #--------------------------------
32     pod:
33         - opnfv-jump-2:
34             installer: fuel
35             <<: *brahmaputra
36         - intel-pod5:
37             installer: joid
38             <<: *brahmaputra
39         - huawei-us-deploy-bare-1:
40             installer: compass
41             <<: *brahmaputra
42 #--------------------------------
43 #        master
44 #--------------------------------
45         - ericsson-pod1:
46             installer: fuel
47             <<: *master
48         - ericsson-pod2:
49             installer: fuel
50             <<: *master
51         - intel-pod6:
52             installer: joid
53             <<: *master
54         - intel-pod8:
55             installer: compass
56             <<: *master
57         - zte-build-1:
58             installer: fuel
59             <<: *master
60         - orange-pod2:
61             installer: joid
62             <<: *master
63 #--------------------------------
64     suite:
65         - 'rubbos'
66         - 'vstf'
67
68     jobs:
69         - 'bottlenecks-{installer}-{suite}-{pod}-daily-{stream}'
70
71 ################################
72 # job templates
73 ################################
74 - job-template:
75     name: 'bottlenecks-{installer}-{suite}-{pod}-daily-{stream}'
76
77     disabled: false
78
79     wrappers:
80         - build-name:
81             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
82
83     parameters:
84         - project-parameter:
85             project: '{project}'
86         - '{pod}-defaults'
87         - '{installer}-defaults'
88         - 'bottlenecks-params-{pod}'
89         - string:
90             name: DEPLOY_SCENARIO
91             default: 'os-odl_l2-nofeature-ha'
92         - string:
93             name: GERRIT_REFSPEC_DEBUG
94             default: 'false'
95             description: "Gerrit refspec for debug."
96         - string:
97             name: SUITE_NAME
98             default: '{suite}'
99             description: "test suite name."
100         - string:
101             name: DOCKER_TAG
102             default: '{docker-tag}'
103             description: "docker image tag used for version control"
104
105     scm:
106         - git-scm:
107             credentials-id: '{ssh-credentials}'
108             refspec: ''
109             branch: '{branch}'
110
111     builders:
112         - 'bottlenecks-env-cleanup'
113         - 'bottlenecks-fetch-os-creds'
114         - 'bottlenecks-run-suite'
115
116     publishers:
117         - email:
118             recipients: hongbo.tianhongbo@huawei.com matthew.lijun@huawei.com liangqi1@huawei.com sunshine.wang@huawei.com
119
120 ########################
121 # builder macros
122 ########################
123 - builder:
124     name: bottlenecks-fetch-os-creds
125     builders:
126         - shell:
127             !include-raw ../../utils/fetch_os_creds.sh
128
129 - builder:
130     name: bottlenecks-env-cleanup
131     builders:
132         - shell: |
133             #!/bin/bash
134             set -e
135             [[ $GERRIT_REFSPEC_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
136
137             echo "Bottlenecks: docker containers/images cleaning up"
138             if [[ ! -z $(docker ps -a | grep opnfv/bottlenecks) ]]; then
139                 echo "removing existing opnfv/bottlenecks containers"
140                 docker ps -a | grep opnfv/bottlenecks | awk '{print $1}' | xargs docker rm -f >$redirect
141             fi
142
143             if [[ ! -z $(docker images | grep opnfv/bottlenecks) ]]; then
144                 echo "Bottlenecks: docker images to remove:"
145                 docker images | head -1 && docker images | grep opnfv/bottlenecks
146                 image_tags=($(docker images | grep opnfv/bottlenecks | awk '{print $2}'))
147                 for tag in "${image_tags[@]}"; do
148                     echo "Removing docker image opnfv/bottlenecks:$tag..."
149                     docker rmi opnfv/bottlenecks:$tag >$redirect
150                 done
151             fi
152
153 - builder:
154     name: bottlenecks-run-suite
155     builders:
156         - shell: |
157             #!/bin/bash
158             set -e
159             [[ $GERRIT_REFSPEC_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
160
161             echo "Bottlenecks: ${SUITE_NAME} running now..."
162
163             # pull latest image
164             docker pull opnfv/bottlenecks:$DOCKER_TAG >$redirect
165
166             # run tests by using docker
167             opts="--privileged=true --rm"
168             envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
169                   -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NET=${EXTERNAL_NETWORK} \
170                   -e BOTTLENECKS_BRANCH=${BOTTLENECKS_BRANCH} -e GERRIT_REFSPEC_DEBUG=${GERRIT_REFSPEC_DEBUG} \
171                   -e BOTTLENECKS_DB_TARGET=${BOTTLENECKS_DB_TARGET} -e PACKAGE_URL=${PACKAGE_URL}"
172             run_testsuite="run_tests.sh -s ${SUITE_NAME}"
173             cmd="sudo docker run ${opts} ${envs} opnfv/bottlenecks ${run_testsuite} >${redirect}"
174             echo "Bottlenecks: docker cmd running: ${cmd}"
175             ${cmd}
176
177 ####################
178 # parameter macros
179 ####################
180
181 - parameter:
182     name: 'bottlenecks-params-intel-pod5'
183     parameters:
184         - string:
185             name: BOTTLENECKS_DB_TARGET
186             default: '213.77.62.197'
187             description: 'Arguments to use in order to choose the backend DB'
188
189 - parameter:
190     name: 'bottlenecks-params-intel-pod6'
191     parameters:
192         - string:
193             name: BOTTLENECKS_DB_TARGET
194             default: '213.77.62.197'
195             description: 'Arguments to use in order to choose the backend DB'
196
197 - parameter:
198     name: 'bottlenecks-params-intel-pod8'
199     parameters:
200         - string:
201             name: BOTTLENECKS_DB_TARGET
202             default: '213.77.62.197'
203             description: 'Arguments to use in order to choose the backend DB'
204
205 - parameter:
206     name: 'bottlenecks-params-ericsson-pod1'
207     parameters:
208         - string:
209             name: BOTTLENECKS_DB_TARGET
210             default: '213.77.62.197'
211             description: 'Arguments to use in order to choose the backend DB'
212
213 - parameter:
214     name: 'bottlenecks-params-ericsson-pod2'
215     parameters:
216         - string:
217             name: BOTTLENECKS_DB_TARGET
218             default: '213.77.62.197'
219             description: 'Arguments to use in order to choose the backend DB'
220
221 - parameter:
222     name: 'bottlenecks-params-opnfv-jump-2'
223     parameters:
224         - string:
225             name: BOTTLENECKS_DB_TARGET
226             default: '213.77.62.197'
227             description: 'Arguments to use in order to choose the backend DB'
228
229 - parameter:
230     name: 'bottlenecks-params-huawei-us-deploy-bare-1'
231     parameters:
232         - string:
233             name: BOTTLENECKS_DB_TARGET
234             default: '213.77.62.197'
235             description: 'Arguments to use in order to choose the backend DB'
236
237 - parameter:
238     name: 'bottlenecks-params-zte-build-1'
239     parameters:
240         - string:
241             name: BOTTLENECKS_DB_TARGET
242             default: '213.77.62.197'
243             description: 'Arguments to use in order to choose the backend DB'
244
245 - parameter:
246     name: 'bottlenecks-params-orange-pod2'
247     parameters:
248         - string:
249             name: BOTTLENECKS_DB_TARGET
250             default: '213.77.62.197'
251             description: 'Arguments to use in order to choose the backend DB'