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