b146572a79e05d9a2f4b1ec5e19c6a24aac9d837
[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             set -o errexit
242             set -o nounset
243             set -o pipefail
244             set -x
245
246             # get the dependencies - temporary fix for RC0
247             [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
248             cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
249
250             # below lines perhaps need to be enabled in order to fetch images from internet
251             # as we are having disk space issues on ericsson-build slave
252             #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
253             #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
254             #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
255
256             # do the build
257             cd $WORKSPACE/foreman/ci
258             ./build.sh $BUILD_DIRECTORY
259
260             # list the build artifacts
261             ls -al $BUILD_DIRECTORY
262
263             # remove the BUILD_DIRECTORY to reclaim some space
264             /bin/rm -rf $BUILD_DIRECTORY
265
266 - builder:
267     name: foreman-daily-master
268     builders:
269         - shell: |
270             #!/bin/bash
271             set -o errexit
272             set -o nounset
273             set -o pipefail
274             set -x
275
276             # get the dependencies - temporary fix for RC0
277             [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
278             cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
279
280             # below lines perhaps need to be enabled in order to fetch images from internet
281             # as we are having disk space issues on ericsson-build slave
282             #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
283             #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
284             #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
285
286             # do the build
287             cd $WORKSPACE/foreman/ci
288             ./build.sh -v $BUILD_ID $BUILD_DIRECTORY
289
290         - shell: |
291             #!/bin/bash
292             set -o errexit
293             set -o nounset
294             set -o pipefail
295             set -x
296
297             # list the build artifacts
298             ls -al $BUILD_DIRECTORY
299
300             cd $BUILD_DIRECTORY
301
302             # save information regarding artifact into file
303             (
304                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
305                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
306                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
307                 echo "OPNFV_BUILD_URL=$BUILD_URL"
308                 echo "OPNFV_BUILD=OK"
309             ) > opnfv-$BUILD_ID.properties
310
311             # copy artifact property file as latest.properties
312             # so we can directly get info regarding latest artifact
313             /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
314
315             # upload artifact and additional files to google storage
316             gsutil cp OPNFV-CentOS-7-x86_64-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
317             gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
318             gsutil cp latest.properties gs://$GS_URL/latest.properties
319
320         - shell: |
321             #!/bin/bash
322             set -o errexit
323             set -o nounset
324             set -o pipefail
325             set -x
326
327             # get the latest.properties file in order to get info regarding latest artifact
328             gsutil cp gs://$GS_URL/latest.properties latest.properties
329
330             # check if we got the file
331             [[ -f latest.properties ]] || exit 1
332
333             # source the file so we get OPNFV vars
334             source latest.properties
335
336             # download the file
337             gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
338
339             # list the file
340             ls -al $WORKSPACE/opnfv.iso
341
342             # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
343             /bin/rm -rf $BUILD_DIRECTORY
344             /bin/rm -rf $WORKSPACE/opnfv.iso
345
346 - builder:
347     name: fuel-verify
348     builders:
349         - shell: |
350             #!/bin/bash
351             set -o errexit
352             set -o nounset
353             set -o pipefail
354             set -x
355
356             # set/create the cache location
357             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
358             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
359
360             # do the build
361             cd $WORKSPACE/fuel/ci
362             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
363
364             # list the build artifacts
365             ls -al $BUILD_DIRECTORY
366
367             # remove the BUILD_DIRECTORY to reclaim some space
368             /bin/rm -rf $BUILD_DIRECTORY
369
370 - builder:
371     name: fuel-merge
372     builders:
373         - shell: |
374             #!/bin/bash
375             set -o errexit
376             set -o nounset
377             set -o pipefail
378             set -x
379
380             # set/create the cache location
381             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
382             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
383
384             # do the build
385             cd $WORKSPACE/fuel/ci
386             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
387
388             # list the build artifacts
389             ls -al $BUILD_DIRECTORY
390
391             # remove the BUILD_DIRECTORY to reclaim some space
392             /bin/rm -rf $BUILD_DIRECTORY
393
394 - builder:
395     name: fuel-daily-master
396     builders:
397         - shell: |
398             #!/bin/bash
399             set -o errexit
400             set -o nounset
401             set -o pipefail
402             set -x
403
404             # set/create the cache location
405             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
406             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
407
408             # do the build
409             cd $WORKSPACE/fuel/ci
410             ./build.sh -f t -v $BUILD_ID -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
411
412         - shell: |
413             #!/bin/bash
414             set -o errexit
415             set -o nounset
416             set -o pipefail
417             set -x
418
419             # list the build artifacts
420             ls -al $BUILD_DIRECTORY
421
422             cd $BUILD_DIRECTORY
423
424             # save information regarding artifact into file
425             (
426                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
427                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
428                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
429                 echo "OPNFV_BUILD_URL=$BUILD_URL"
430                 echo "OPNFV_BUILD=OK"
431             ) > opnfv-$BUILD_ID.properties
432
433             # copy artifact property file as latest.properties
434             # so we can directly get info regarding latest artifact
435             /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
436
437             # upload artifact and additional files to google storage
438             gsutil cp opnfv-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
439             gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
440             gsutil cp latest.properties gs://$GS_URL/latest.properties
441
442         - shell: |
443             #!/bin/bash
444             set -o errexit
445             set -o nounset
446             set -o pipefail
447             set -x
448
449             # get the latest.properties file in order to get info regarding latest artifact
450             gsutil cp gs://$GS_URL/latest.properties latest.properties
451
452             # check if we got the file
453             [[ -f latest.properties ]] || exit 1
454
455             # source the file so we get OPNFV vars
456             source latest.properties
457
458             # download the file
459             gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
460
461             # list the file
462             ls -al $WORKSPACE/opnfv.iso
463
464             # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
465             /bin/rm -rf $BUILD_DIRECTORY
466             /bin/rm -rf $WORKSPACE/opnfv.iso
467
468 - builder:
469     name: opensteak-verify
470     builders:
471         - shell: |
472             #!/bin/bash
473
474             echo "Hello World!"
475
476 - builder:
477     name: opensteak-merge
478     builders:
479         - shell: |
480             #!/bin/bash
481
482             echo "Hello World!"
483
484 - builder:
485     name: opensteak-daily-master
486     builders:
487         - shell: |
488             #!/bin/bash
489
490             echo "Hello World!"
491 - builder:
492     name: juju-verify
493     builders:
494         - shell: |
495             #!/bin/bash
496
497             echo "Hello World!"
498
499 - builder:
500     name: juju-merge
501     builders:
502         - shell: |
503             #!/bin/bash
504
505             echo "Hello World!"
506
507 - builder:
508     name: juju-daily-master
509     builders:
510         - shell: |
511             #!/bin/bash
512
513             echo "Hello World!"