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