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