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