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