56d9444e93a5a06bf0b4fddaf44df8dfe6b6c259
[releng.git] / jjb / genesis / genesis.yml
1 # this is the job configuration for bgs
2 - project:
3
4     name: genesis
5
6     installer:
7         - foreman
8         - fuel
9         - opensteak
10         - juju
11     jobs:
12         - 'genesis-{installer}-verify'
13         - 'genesis-{installer}-merge'
14         - 'genesis-{installer}-daily-master'
15
16     # stream:    branch with - in place of / (eg. stable-helium)
17     # branch:    branch (eg. stable/helium)
18     stream:
19         - master:
20             branch: 'master'
21
22     project: 'genesis'
23
24 ########################
25 # job templates
26 ########################
27
28 - job-template:
29     name: 'genesis-{installer}-verify'
30
31     project-type: freestyle
32
33     node: ericsson-build
34
35     logrotate:
36         daysToKeep: 30
37         numToKeep: 10
38         artifactDaysToKeep: -1
39         artifactNumToKeep: -1
40
41     parameters:
42         - string:
43             name: BUILD_DIRECTORY
44             default: $WORKSPACE/build_output
45         - string:
46             name: GIT_BASE
47             default: https://gerrit.opnfv.org/gerrit/genesis
48         - project-parameter:
49             project: '{project}'
50         - gerrit-parameter:
51             branch: 'master'
52
53     scm:
54         - gerrit-trigger-scm:
55             credentials-id: '{ssh-credentials}'
56             refspec: '$GERRIT_REFSPEC'
57             choosing-strategy: 'gerrit'
58
59     wrappers:
60         - ssh-agent-credentials:
61             user: '{ssh-credentials}'
62
63     triggers:
64         - gerrit:
65             trigger-on:
66                 - patchset-created-event:
67                     exclude-drafts: 'false'
68                     exclude-trivial-rebase: 'false'
69                     exclude-no-code-change: 'false'
70                 - draft-published-event
71                 - comment-added-contains-event:
72                     comment-contains-value: 'recheck'
73                 - comment-added-contains-event:
74                     comment-contains-value: 'reverify'
75             projects:
76               - project-compare-type: 'ANT'
77                 project-pattern: 'genesis'
78                 branches:
79                   - branch-compare-type: 'ANT'
80                     branch-pattern: '**/master'
81                 file-paths:
82                   - compare-type: ANT
83                     pattern: 'common/**'
84                   - compare-type: ANT
85                     pattern: '{installer}/**'
86
87
88     builders:
89         - '{installer}-verify'
90
91 - job-template:
92     name: 'genesis-{installer}-merge'
93
94     # builder-merge job to run JJB update
95     #
96     # This job's purpose is to update all the JJB
97
98     project-type: freestyle
99
100     node: ericsson-build
101
102     logrotate:
103         daysToKeep: 30
104         numToKeep: 40
105         artifactDaysToKeep: -1
106         artifactNumToKeep: 5
107
108     parameters:
109         - string:
110             name: BUILD_DIRECTORY
111             default: $WORKSPACE/build_output
112         - string:
113             name: GIT_BASE
114             default: https://gerrit.opnfv.org/gerrit/genesis
115         - project-parameter:
116             project: '{project}'
117         - gerrit-parameter:
118             branch: 'master'
119
120     scm:
121         - gerrit-trigger-scm:
122             credentials-id: '{ssh-credentials}'
123             refspec: ''
124             choosing-strategy: 'default'
125
126     wrappers:
127         - ssh-agent-credentials:
128             user: '{ssh-credentials}'
129
130     triggers:
131         - gerrit:
132             trigger-on:
133                 - change-merged-event
134                 - comment-added-contains-event:
135                     comment-contains-value: 'remerge'
136             projects:
137               - project-compare-type: 'ANT'
138                 project-pattern: 'genesis'
139                 branches:
140                     - branch-compare-type: 'ANT'
141                       branch-pattern: '**/master'
142                 file-paths:
143                   - compare-type: ANT
144                     pattern: 'common/**'
145                   - compare-type: ANT
146                     pattern: '{installer}/**'
147
148     builders:
149         - '{installer}-merge'
150
151 - job-template:
152     name: 'genesis-{installer}-daily-master'
153
154     project-type: freestyle
155
156     node: ericsson-build
157
158     parameters:
159         - string:
160             name: BUILD_DIRECTORY
161             default: $WORKSPACE/build_output
162             description: "Directory where the build artifact will be located upon the completion of the build."
163         - string:
164             name: GS_URL
165             default: 'artifacts.opnfv.org/genesis/{installer}'
166             description: "URL to Google Storage."
167         - string:
168             name: INSTALLER
169             default: '{installer}'
170             description: "Installer to use."
171         - string:
172             name: GIT_BASE
173             default: https://gerrit.opnfv.org/gerrit/genesis
174         - string:
175             name: GERRIT_BRANCH
176             default: origin/master
177             description: "Branch to build, deploy and test."
178         - string:
179             name: GERRIT_REFSPEC
180             default: refs/heads/master
181             description: "Refspec to retrieve."
182
183     scm:
184         - git:
185             skip-tag: true
186             url: $GIT_BASE
187             branches:
188                 - $GERRIT_BRANCH
189             refspec: $GERRIT_REFSPEC
190
191     triggers:
192         - pollscm: '@midnight'
193
194     logrotate:
195         daysToKeep: 30
196         numToKeep: 10
197         artifactDaysToKeep: -1
198         artifactNumToKeep: -1
199
200     builders:
201         - '{installer}-daily-master'
202
203 ########################
204 # builder macros
205 ########################
206 - builder:
207     name: foreman-verify
208     builders:
209         - shell: |
210             #!/bin/bash
211             set -o errexit
212             set -o nounset
213             set -o pipefail
214             set -x
215
216             # get the dependencies - temporary fix for RC0
217             [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
218             cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
219
220             # below lines perhaps need to be enabled in order to fetch images from internet
221             # as we are having disk space issues on ericsson-build slave
222             #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
223             #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
224             #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
225
226             # do the build
227             cd $WORKSPACE/foreman/ci
228             ./build.sh $BUILD_DIRECTORY
229
230             # list the build artifacts
231             ls -al $BUILD_DIRECTORY
232
233             # remove the BUILD_DIRECTORY to reclaim some space
234             /bin/rm -rf $BUILD_DIRECTORY
235
236 - builder:
237     name: foreman-merge
238     builders:
239         - shell: |
240             #!/bin/bash
241
242             echo "Hello World!"
243
244 - builder:
245     name: foreman-daily-master
246     builders:
247         - shell: |
248             #!/bin/bash
249             set -o errexit
250             set -o nounset
251             set -o pipefail
252             set -x
253
254             # get the dependencies - temporary fix for RC0
255             [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
256             cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
257
258             # below lines perhaps need to be enabled in order to fetch images from internet
259             # as we are having disk space issues on ericsson-build slave
260             #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
261             #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
262             #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
263
264             # do the build
265             cd $WORKSPACE/foreman/ci
266             ./build.sh -v $BUILD_ID $BUILD_DIRECTORY
267
268         - shell: |
269             #!/bin/bash
270             set -o errexit
271             set -o nounset
272             set -o pipefail
273             set -x
274
275             # list the build artifacts
276             ls -al $BUILD_DIRECTORY
277
278             cd $BUILD_DIRECTORY
279
280             # save information regarding artifact into file
281             (
282                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
283                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
284                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
285                 echo "OPNFV_BUILD_URL=$BUILD_URL"
286                 echo "OPNFV_BUILD=OK"
287             ) > opnfv-$BUILD_ID.properties
288
289             # copy artifact property file as latest.properties
290             # so we can directly get info regarding latest artifact
291             /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
292
293             # upload artifact and additional files to google storage
294             gsutil cp OPNFV-CentOS-7-x86_64-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
295             gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
296             gsutil cp latest.properties gs://$GS_URL/latest.properties
297
298         - shell: |
299             #!/bin/bash
300             set -o errexit
301             set -o nounset
302             set -o pipefail
303             set -x
304
305             # get the latest.properties file in order to get info regarding latest artifact
306             gsutil cp gs://$GS_URL/latest.properties latest.properties
307
308             # check if we got the file
309             [[ -f latest.properties ]] || exit 1
310
311             # source the file so we get OPNFV vars
312             source latest.properties
313
314             # download the file
315             gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
316
317             # list the file
318             ls -al $WORKSPACE/opnfv.iso
319
320             # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
321             /bin/rm -rf $BUILD_DIRECTORY
322             /bin/rm -rf $WORKSPACE/opnfv.iso
323
324 - builder:
325     name: fuel-verify
326     builders:
327         - shell: |
328             #!/bin/bash
329             set -o errexit
330             set -o nounset
331             set -o pipefail
332             set -x
333
334             # set/create the cache location
335             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
336             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
337
338             # do the build
339             cd $WORKSPACE/fuel/ci
340             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
341
342             # list the build artifacts
343             ls -al $BUILD_DIRECTORY
344
345             # remove the BUILD_DIRECTORY to reclaim some space
346             /bin/rm -rf $BUILD_DIRECTORY
347
348 - builder:
349     name: fuel-merge
350     builders:
351         - shell: |
352             #!/bin/bash
353             set -o errexit
354             set -o nounset
355             set -o pipefail
356             set -x
357
358             # set/create the cache location
359             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
360             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
361
362             # do the build
363             cd $WORKSPACE/fuel/ci
364             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
365
366             # list the build artifacts
367             ls -al $BUILD_DIRECTORY
368
369             # remove the BUILD_DIRECTORY to reclaim some space
370             /bin/rm -rf $BUILD_DIRECTORY
371
372 - builder:
373     name: fuel-daily-master
374     builders:
375         - shell: |
376             #!/bin/bash
377             set -o errexit
378             set -o nounset
379             set -o pipefail
380             set -x
381
382             # set/create the cache location
383             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
384             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
385
386             # do the build
387             cd $WORKSPACE/fuel/ci
388             ./build.sh -f t -v $BUILD_ID -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
389
390         - shell: |
391             #!/bin/bash
392             set -o errexit
393             set -o nounset
394             set -o pipefail
395             set -x
396
397             # list the build artifacts
398             ls -al $BUILD_DIRECTORY
399
400             cd $BUILD_DIRECTORY
401
402             # save information regarding artifact into file
403             (
404                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
405                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
406                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
407                 echo "OPNFV_BUILD_URL=$BUILD_URL"
408                 echo "OPNFV_BUILD=OK"
409             ) > opnfv-$BUILD_ID.properties
410
411             # copy artifact property file as latest.properties
412             # so we can directly get info regarding latest artifact
413             /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
414
415             # upload artifact and additional files to google storage
416             gsutil cp opnfv-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
417             gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
418             gsutil cp latest.properties gs://$GS_URL/latest.properties
419
420         - shell: |
421             #!/bin/bash
422             set -o errexit
423             set -o nounset
424             set -o pipefail
425             set -x
426
427             # get the latest.properties file in order to get info regarding latest artifact
428             gsutil cp gs://$GS_URL/latest.properties latest.properties
429
430             # check if we got the file
431             [[ -f latest.properties ]] || exit 1
432
433             # source the file so we get OPNFV vars
434             source latest.properties
435
436             # download the file
437             gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
438
439             # list the file
440             ls -al $WORKSPACE/opnfv.iso
441
442             # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
443             /bin/rm -rf $BUILD_DIRECTORY
444             /bin/rm -rf $WORKSPACE/opnfv.iso
445
446 - builder:
447     name: opensteak-verify
448     builders:
449         - shell: |
450             #!/bin/bash
451
452             echo "Hello World!"
453
454 - builder:
455     name: opensteak-merge
456     builders:
457         - shell: |
458             #!/bin/bash
459
460             echo "Hello World!"
461
462 - builder:
463     name: opensteak-daily-master
464     builders:
465         - shell: |
466             #!/bin/bash
467
468             echo "Hello World!"
469 - builder:
470     name: juju-verify
471     builders:
472         - shell: |
473             #!/bin/bash
474
475             echo "Hello World!"
476
477 - builder:
478     name: juju-merge
479     builders:
480         - shell: |
481             #!/bin/bash
482
483             echo "Hello World!"
484
485 - builder:
486     name: juju-daily-master
487     builders:
488         - shell: |
489             #!/bin/bash
490
491             echo "Hello World!"