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