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