f15aa8f7c9f93d3e3aa602b0cccdd503c26db45f
[releng.git] / jjb / bottlenecks / bottlenecks.yml
1 ####################################
2 # Job configuration for bottlenecks
3 ####################################
4 - project:
5     name: bottlenecks
6     jobs:
7         - 'bottlenecks-verify-{stream}'
8         - 'bottlenecks-daily-{installer}-{pod}-{stream}'
9         - 'bottlenecks-upload-artifacts-{stream}'
10     pod:
11         - lf:
12             node: 'opnfv-jump-2'
13             installer_type: 'fuel'
14             installer_ip: '10.20.0.2'
15
16     installer:
17         -fuel
18
19 # only master branch is enabled at the moment to keep no of jobs sane
20     stream:
21         - master:
22             branch: 'master'
23             gs-pathname: ''
24 #        - brahmaputra:
25 #            branch: 'stable/brahmaputra'
26 #            gs-pathname: '/brahmaputra'
27
28     project: 'bottlenecks'
29 ###############################
30 # Job templates
31 ##############################
32 - job-template:
33     name: 'bottlenecks-verify-{stream}'
34
35     parameters:
36         - project-parameter:
37             project: '{project}'
38         - gerrit-parameter:
39             branch: '{branch}'
40         - 'opnfv-build-defaults'
41
42     scm:
43         - gerrit-trigger-scm:
44             credentials-id: '{ssh-credentials}'
45             refspec: '$GERRIT_REFSPEC'
46             choosing-strategy: 'gerrit'
47
48     triggers:
49         - gerrit:
50             trigger-on:
51                 - patchset-created-event:
52                     exclude-drafts: 'false'
53                     exclude-trivial-rebase: 'false'
54                     exclude-no-code-change: 'false'
55                 - draft-published-event
56                 - comment-added-contains-event:
57                     comment-contains-value: 'recheck'
58                 - comment-added-contains-event:
59                     comment-contains-value: 'reverify'
60             projects:
61               - project-compare-type: 'ANT'
62                 project-pattern: '{project}'
63                 branches:
64                   - branch-compare-type: 'ANT'
65                     branch-pattern: '**/{branch}'
66                 forbidden-file-paths:
67                   - compare-type: ANT
68                     pattern: 'docs/**|.gitignore'
69
70     builders:
71         - shell: |
72             echo "Nothing to verify!"
73
74 - job-template:
75     name: 'bottlenecks-upload-artifacts-{stream}'
76
77     node: ericsson-build
78
79     concurrent: true
80
81     properties:
82         - throttle:
83             enabled: true
84             max-total: 1
85             max-per-node: 1
86
87     parameters:
88         - project-parameter:
89             project: '{project}'
90         - 'ericsson-ca-build-1-defaults'
91
92     scm:
93         - git-scm:
94             credentials-id: '{ssh-credentials}'
95             refspec: ''
96             branch: '{branch}'
97
98     builders:
99         - 'bottlenecks-builder-upload-artifact'
100         - 'bottlenecks-workspace-cleanup'
101
102 - job-template:
103     name: 'bottlenecks-daily-{installer}-{pod}-{stream}'
104
105     disabled: false
106
107     node: '{node}'
108
109     parameters:
110         - project-parameter:
111             project: '{project}'
112         - 'opnfv-jump-2-defaults'
113         - string:
114             name: POD_NAME
115             default: '{pod}'
116             description: "POD where the job runs"
117         - string:
118             name: INSTALLER_TYPE
119             default: '{installer_type}'
120             description: "Installer name that is used for deployment."
121         - string:
122             name: INSTALLER_IP
123             default: '{installer_ip}'
124             description: "Installer IP."
125
126     scm:
127         - git-scm:
128             credentials-id: '{ssh-credentials}'
129             refspec: ''
130             branch: '{branch}'
131
132     triggers:
133         - 'bottlenecks-trigger-{pod}'
134
135     builders:
136         - 'bottlenecks-fetch-os-creds'
137         - 'run-rubbos-env-preparation'
138         - 'bottlenecks-instance-creation'
139         - 'run-rubbos-tools-installation'
140         - 'rubbos-exec'
141
142     publishers:
143         - email:
144             recipients: hongbo.tianhongbo@huawei.com matthew.lijun@huawei.com
145
146 ####################
147 # parameter macros
148 ####################
149 - parameter:
150     name: bottlenecks-parameter
151     parameters:
152         -string:
153            name: CACHE_DIR
154            default: $WORKSPACE/cache
155            description: "the cache to store packages downloaded from public IP"
156         -string:
157            name: RUBBOS_URL
158            default: http://artifacts.opnfv.org/bottlenecks/rubbos
159            description: "LF artifacts url for storage of bottlenecks packages"
160         -string:
161            name: PACKAGE_URL
162            default: http://205.177.226.235:9999/bottlenecks/rubbos/
163            description: "the url where we store the packages used for bottlenecks rubbos"
164
165 ###################################
166 #builders for bottlenecks project
167 ###################################
168 - builder:
169     name: bottlenecks-fetch-os-creds
170     builders:
171         - shell:
172             !include-raw ../../utils/fetch_os_creds.sh
173
174 - builder:
175     name: run-rubbos-env-preparation
176     builders:
177         - shell: |
178             #!/bin/bash
179             set -o errexit
180
181             echo "Bottlenecks: export openstack parameters before rubbos running"
182
183             cd $WORKSPACE
184             ./rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
185
186 - builder:
187     name: bottlenecks-instance-creation
188     builders:
189         - shell: |
190             #!/bin/bash
191             set -o errexit
192
193             echo "Bottlenecks: instance creation by using heat template"
194             cd $WORKSPACE
195             ./utils/infra_setup/heat_template/HOT_create_instance.sh
196
197 - builder:
198     name: run-rubbos-tools-installation
199     builders:
200         - shell: |
201             #!/bin/bash
202             set -o errexit
203
204             echo "Bottlenecks: to install tools to run rubbos"
205
206             cd $WORKSPACE
207             cd rubbos/rubbos_scripts/1-1-1
208             source set_bottlenecks_rubbos_env.sh
209             ./rubbos/rubbos_scripts/1-1-1/scripts/run.sh
210
211 - builder:
212     name: rubbos-exec
213     builders:
214         - shell: |
215             #!/bin/bash
216             set -o errexit
217
218             echo "Bottlenecks: rubbos execution"
219
220             cd $WORKSPACE
221             cd ./rubbos/rubbos_scripts/1-1-1
222             source set_bottlenecks_rubbos_env.sh
223             ssh $CONTROL_HOST
224             ./tmp/CONTROL_rubbos_exec.sh
225
226 - builder:
227     name: bottlenecks-builder-upload-artifact
228     builders:
229         - shell: |
230             #!/bin/bash
231             set -o errexit
232
233             echo "Bottlenecks: upload to artifacts from the public IP"
234
235             [[ -d $CACHE_DIR ]] || mkdir -p $CACHE_DIR
236
237             for file in $(curl -s $PACKAGE_URL |
238                                grep href |
239                                sed 's/.*href="//' |
240                                sed 's/".*//' |
241                                grep '^[a-zA-Z].*'); do
242                  curl --connect-timeout 10 -o $CACHE_DIR/$file $PACKAGE_URL$file
243                  gsutil cp $CACHE_DIR/$file $RUBBOS_URL
244             done
245
246 - builder:
247     name: bottlenecks-workspace-cleanup
248     builders:
249         - shell: |
250             #!/bin/bash
251             set -o errexit
252
253             echo "Bottlenecks: cleanup cache used for storage downloaded packages"
254
255             /bin/rm -rf $WORKSPACE
256
257 #######################
258 #trigger macros
259 #######################
260 - trigger:
261     name: 'bottlenecks-trigger-lf'
262     triggers:
263         - timed: '@midnight'