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