fis bugs for bottlenecks project jjb
[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         - 'bottlenecks-parameter'
92
93     scm:
94         - git-scm:
95             credentials-id: '{ssh-credentials}'
96             refspec: ''
97             branch: '{branch}'
98
99     builders:
100         - 'bottlenecks-builder-upload-artifact'
101         - 'bottlenecks-workspace-cleanup'
102
103 - job-template:
104     name: 'bottlenecks-daily-{installer}-{pod}-{stream}'
105
106     disabled: false
107
108     node: '{node}'
109
110     parameters:
111         - project-parameter:
112             project: '{project}'
113         - 'opnfv-jump-2-defaults'
114         - string:
115             name: POD_NAME
116             default: '{pod}'
117             description: "POD where the job runs"
118         - string:
119             name: INSTALLER_TYPE
120             default: '{installer_type}'
121             description: "Installer name that is used for deployment."
122         - string:
123             name: INSTALLER_IP
124             default: '{installer_ip}'
125             description: "Installer IP."
126
127     scm:
128         - git-scm:
129             credentials-id: '{ssh-credentials}'
130             refspec: ''
131             branch: '{branch}'
132
133     triggers:
134         - 'bottlenecks-trigger-{pod}'
135
136     builders:
137         - 'bottlenecks-fetch-os-creds'
138         #- 'run-rubbos-env-preparation'
139         - 'bottlenecks-instance-creation'
140         #- 'run-rubbos-tools-installation'
141         #- 'rubbos-exec'
142
143     publishers:
144         - email:
145             recipients: hongbo.tianhongbo@huawei.com matthew.lijun@huawei.com
146
147 ####################
148 # parameter macros
149 ####################
150 - parameter:
151     name: bottlenecks-parameter
152     parameters:
153         - string:
154            name: CACHE_DIR
155            default: $WORKSPACE/cache
156            description: "the cache to store packages downloaded from public IP"
157         - string:
158            name: RUBBOS_URL
159            default: http://artifacts.opnfv.org/bottlenecks/rubbos
160            description: "LF artifacts url for storage of bottlenecks packages"
161         - string:
162            name: PACKAGE_URL
163            default: http://205.177.226.235:9999/bottlenecks/rubbos/
164            description: "the url where we store the packages used for bottlenecks rubbos"
165
166 ###################################
167 #builders for bottlenecks project
168 ###################################
169 - builder:
170     name: bottlenecks-fetch-os-creds
171     builders:
172         - shell:
173             !include-raw ../../utils/fetch_os_creds.sh
174
175 - builder:
176     name: run-rubbos-env-preparation
177     builders:
178         - shell: |
179             #!/bin/bash
180             set -o errexit
181
182             echo "Bottlenecks: export openstack parameters before rubbos running"
183
184             cd $WORKSPACE
185             ./rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
186
187 - builder:
188     name: bottlenecks-instance-creation
189     builders:
190         - shell: |
191             #!/bin/bash
192             set -o errexit
193
194             echo "Bottlenecks: instance creation by using heat template"
195             cd $WORKSPACE
196             ./utils/infra_setup/heat_template/HOT_create_instance.sh
197
198 - builder:
199     name: run-rubbos-tools-installation
200     builders:
201         - shell: |
202             #!/bin/bash
203             set -o errexit
204
205             echo "Bottlenecks: to install tools to run rubbos"
206
207             cd $WORKSPACE
208             cd rubbos/rubbos_scripts/1-1-1
209             source set_bottlenecks_rubbos_env.sh
210             ./rubbos/rubbos_scripts/1-1-1/scripts/run.sh
211
212 - builder:
213     name: rubbos-exec
214     builders:
215         - shell: |
216             #!/bin/bash
217             set -o errexit
218
219             echo "Bottlenecks: rubbos execution"
220
221             cd $WORKSPACE
222             cd ./rubbos/rubbos_scripts/1-1-1
223             source set_bottlenecks_rubbos_env.sh
224             ssh $CONTROL_HOST
225             ./tmp/CONTROL_rubbos_exec.sh
226
227 - builder:
228     name: bottlenecks-builder-upload-artifact
229     builders:
230         - shell: |
231             #!/bin/bash
232             set -o errexit
233
234             echo "Bottlenecks: upload to artifacts from the public IP"
235
236             [[ -d $CACHE_DIR ]] || mkdir -p $CACHE_DIR
237
238             for file in $(curl -s $PACKAGE_URL |
239                                grep href |
240                                sed 's/.*href="//' |
241                                sed 's/".*//' |
242                                grep '^[a-zA-Z].*'); do
243                  curl --connect-timeout 10 -o $CACHE_DIR/$file $PACKAGE_URL$file
244                  gsutil cp $CACHE_DIR/$file $RUBBOS_URL
245             done
246
247 - builder:
248     name: bottlenecks-workspace-cleanup
249     builders:
250         - shell: |
251             #!/bin/bash
252             set -o errexit
253
254             echo "Bottlenecks: cleanup cache used for storage downloaded packages"
255
256             /bin/rm -rf $WORKSPACE
257
258 #######################
259 #trigger macros
260 #######################
261 - trigger:
262     name: 'bottlenecks-trigger-lf'
263     triggers:
264         - timed: '@midnight'