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