container4nfv: add fraser branch in arm jobs
[releng.git] / jjb / bottlenecks / bottlenecks-project-jobs.yml
1 ---
2 ###################################################
3 # Non-ci jobs for Bottlenecks project
4 # They will only be enabled on request by projects!
5 ###################################################
6 - project:
7     name: bottlenecks-project-jobs
8
9     project: 'bottlenecks'
10
11     jobs:
12       - 'bottlenecks-verify-{stream}'
13       - 'bottlenecks-merge-{stream}'
14       - 'bottlenecks-{suite}-upload-artifacts-{stream}'
15
16     stream:
17       - master:
18           branch: '{stream}'
19           # This is used for common project file storage
20           gs-pathname: ''
21           # This is used for different test suite dependent packages storage
22           gs-packagepath: '/{suite}'
23           disabled: false
24       - fraser: &fraser
25           branch: 'stable/{stream}'
26           gs-pathname: '/{stream}'
27           gs-packagepath: '/{stream}/{suite}'
28           disabled: false
29       - euphrates:
30           branch: 'stable/{stream}'
31           gs-pathname: '/{stream}'
32           gs-packagepath: '/{stream}/{suite}'
33           disabled: false
34
35     suite:
36       - 'posca_stress_traffic'
37       - 'posca_stress_ping'
38
39 ################################
40 # job templates
41 ################################
42
43 - job-template:
44     name: 'bottlenecks-verify-{stream}'
45
46     disabled: '{obj:disabled}'
47
48     parameters:
49       - project-parameter:
50           project: '{project}'
51           branch: '{branch}'
52       - 'opnfv-build-ubuntu-defaults'
53
54     scm:
55       - git-scm-gerrit
56
57     triggers:
58       - gerrit:
59           server-name: 'gerrit.opnfv.org'
60           trigger-on:
61             - patchset-created-event:
62                 exclude-drafts: 'false'
63                 exclude-trivial-rebase: 'false'
64                 exclude-no-code-change: 'false'
65             - draft-published-event
66             - comment-added-contains-event:
67                 comment-contains-value: 'recheck'
68             - comment-added-contains-event:
69                 comment-contains-value: 'reverify'
70           projects:
71             - project-compare-type: 'ANT'
72               project-pattern: '{project}'
73               branches:
74                 - branch-compare-type: 'ANT'
75                   branch-pattern: '**/{branch}'
76
77     builders:
78       # - bottlenecks-hello
79       - bottlenecks-unit-tests
80
81 - job-template:
82     name: 'bottlenecks-merge-{stream}'
83
84     disabled: '{obj:disabled}'
85
86     parameters:
87       - project-parameter:
88           project: '{project}'
89           branch: '{branch}'
90       - 'opnfv-build-ubuntu-defaults'
91
92     scm:
93       - git-scm
94
95     triggers:
96       - gerrit:
97           server-name: 'gerrit.opnfv.org'
98           trigger-on:
99             - change-merged-event
100             - comment-added-contains-event:
101                 comment-contains-value: 'remerge'
102           projects:
103             - project-compare-type: 'ANT'
104               project-pattern: '{project}'
105               branches:
106                 - branch-compare-type: 'ANT'
107                   branch-pattern: '**/{branch}'
108
109     builders:
110       - bottlenecks-hello
111       # - bottlenecks-unit-tests
112
113 - job-template:
114     name: 'bottlenecks-{suite}-upload-artifacts-{stream}'
115
116
117     disabled: '{obj:disabled}'
118
119     concurrent: true
120
121     properties:
122       - logrotate-default
123       - throttle:
124           enabled: true
125           max-total: 1
126           max-per-node: 1
127           option: 'project'
128
129     parameters:
130       - project-parameter:
131           project: '{project}'
132           branch: '{branch}'
133       - 'opnfv-build-ubuntu-defaults'
134       - bottlenecks-parameter:
135           gs-packagepath: '{gs-packagepath}'
136
137     scm:
138       - git-scm
139
140     builders:
141       - 'bottlenecks-builder-upload-artifact'
142       - 'bottlenecks-artifact-workspace-cleanup'
143
144 ####################
145 # parameter macros
146 ####################
147 - parameter:
148     name: bottlenecks-parameter
149     parameters:
150       - string:
151           name: CACHE_DIR
152           default: $WORKSPACE/cache{gs-packagepath}
153           description: "the cache to store packages downloaded from public IP"
154       - string:
155           name: SUITE_URL
156           default: gs://artifacts.opnfv.org/bottlenecks{gs-packagepath}
157           description: "LF artifacts url for storage of bottlenecks packages"
158       - string:
159           name: PACKAGE_URL
160           default: http://205.177.226.237:9999/bottlenecks{gs-packagepath}/
161           description: "the url where we store the packages used for bottlenecks\
162             \ rubbos"
163
164 ####################################
165 # builders for bottlenecks project
166 ####################################
167 - builder:
168     name: bottlenecks-builder-upload-artifact
169     builders:
170       - shell: |
171           #!/bin/bash
172           set -o errexit
173
174           echo "Bottlenecks: upload to artifacts from the public IP"
175
176           [[ -d $CACHE_DIR ]] || mkdir -p $CACHE_DIR
177
178           for file in $(curl -s $PACKAGE_URL |
179                              grep href |
180                              sed 's/.*href="//' |
181                              sed 's/".*//' |
182                              grep '^[a-zA-Z].*'); do
183                curl --connect-timeout 10 -o $CACHE_DIR/$file $PACKAGE_URL$file -v
184                echo "bottlenecks: copy file $CACHE_DIR/$file to $SUITE_URL"
185                gsutil cp $CACHE_DIR/$file $SUITE_URL
186           done
187
188 - builder:
189     name: bottlenecks-artifact-workspace-cleanup
190     builders:
191       - shell: |
192           #!/bin/bash
193           set -o errexit
194
195           echo "Bottlenecks: cleanup cache used for storage downloaded packages"
196
197           /bin/rm -rf $CACHE_DIR
198
199 - builder:
200     name: bottlenecks-unit-tests
201     builders:
202       - shell: |
203           #!/bin/bash
204           set -o errexit
205           set -o pipefail
206
207           echo "Running unit tests..."
208           cd $WORKSPACE
209           virtualenv $WORKSPACE/bottlenecks_venv
210           source $WORKSPACE/bottlenecks_venv/bin/activate
211
212           # install python packages
213           easy_install -U setuptools
214           easy_install -U pip
215           pip install -r $WORKSPACE/requirements/verify.txt
216
217           # unit tests
218           /bin/bash $WORKSPACE/verify.sh
219
220           deactivate
221
222 - builder:
223     name: bottlenecks-hello
224     builders:
225       - shell: |
226           #!/bin/bash
227           set -o errexit
228
229           echo -e "Wellcome to Bottlenecks! \nMerge event is planning to support more functions! "