Forgot to move all three jobs
[releng.git] / jjb / genesis / genesis-fuel.yml
1 # this is the job configuration for bgs
2 - project:
3
4     name: genesis-fuel
5
6     installer:
7         - fuel
8     jobs:
9         - 'genesis-fuel-verify'
10         - 'genesis-fuel-merge'
11         - 'genesis-fuel-daily-{stream}'
12
13     # stream:    branch with - in place of / (eg. stable-helium)
14     # branch:    branch (eg. stable/helium)
15     stream:
16         - master:
17             branch: 'master'
18
19     project: 'genesis'
20
21 ########################
22 # job templates
23 ########################
24
25 - job-template:
26     name: 'genesis-fuel-verify'
27
28     project-type: freestyle
29
30     node: gce-opnfv-docker-1
31
32     logrotate:
33         daysToKeep: 30
34         numToKeep: 10
35         artifactDaysToKeep: -1
36         artifactNumToKeep: -1
37
38     parameters:
39         - string:
40             name: BUILD_DIRECTORY
41             default: $WORKSPACE/build_output
42         - string:
43             name: GIT_BASE
44             default: https://gerrit.opnfv.org/gerrit/genesis
45         - project-parameter:
46             project: '{project}'
47         - gerrit-parameter:
48             branch: 'master'
49
50     scm:
51         - gerrit-trigger-scm:
52             credentials-id: '{ssh-credentials}'
53             refspec: '$GERRIT_REFSPEC'
54             choosing-strategy: 'gerrit'
55
56     wrappers:
57         - ssh-agent-credentials:
58             user: '{ssh-credentials}'
59
60     triggers:
61         - gerrit:
62             trigger-on:
63                 - patchset-created-event:
64                     exclude-drafts: 'false'
65                     exclude-trivial-rebase: 'false'
66                     exclude-no-code-change: 'false'
67                 - draft-published-event
68                 - comment-added-contains-event:
69                     comment-contains-value: 'recheck'
70                 - comment-added-contains-event:
71                     comment-contains-value: 'reverify'
72             projects:
73               - project-compare-type: 'ANT'
74                 project-pattern: 'genesis'
75                 branches:
76                   - branch-compare-type: 'ANT'
77                     branch-pattern: '**/master'
78                 file-paths:
79                   - compare-type: ANT
80                     pattern: 'common/**'
81                   - compare-type: ANT
82                     pattern: 'fuel/**'
83
84
85     builders:
86         - 'fuel-verify'
87
88 - job-template:
89     name: 'genesis-fuel-merge'
90
91     # builder-merge job to run JJB update
92     #
93     # This job's purpose is to update all the JJB
94
95     project-type: freestyle
96
97     node: gce-opnfv-docker-1
98
99     logrotate:
100         daysToKeep: 30
101         numToKeep: 40
102         artifactDaysToKeep: -1
103         artifactNumToKeep: 5
104
105     parameters:
106         - string:
107             name: BUILD_DIRECTORY
108             default: $WORKSPACE/build_output
109         - string:
110             name: GIT_BASE
111             default: https://gerrit.opnfv.org/gerrit/genesis
112         - project-parameter:
113             project: '{project}'
114         - gerrit-parameter:
115             branch: 'master'
116
117     scm:
118         - gerrit-trigger-scm:
119             credentials-id: '{ssh-credentials}'
120             refspec: ''
121             choosing-strategy: 'default'
122
123     wrappers:
124         - ssh-agent-credentials:
125             user: '{ssh-credentials}'
126
127     triggers:
128         - gerrit:
129             trigger-on:
130                 - change-merged-event
131                 - comment-added-contains-event:
132                     comment-contains-value: 'remerge'
133             projects:
134               - project-compare-type: 'ANT'
135                 project-pattern: 'genesis'
136                 branches:
137                     - branch-compare-type: 'ANT'
138                       branch-pattern: '**/master'
139                 file-paths:
140                   - compare-type: ANT
141                     pattern: 'common/**'
142                   - compare-type: ANT
143                     pattern: 'fuel/**'
144
145     builders:
146         - 'fuel-merge'
147
148 - job-template:
149     name: 'genesis-fuel-daily-{stream}'
150
151     project-type: freestyle
152
153     node: gce-opnfv-docker-1
154
155     parameters:
156         - string:
157             name: BUILD_DIRECTORY
158             default: $WORKSPACE/build_output
159             description: "Directory where the build artifact will be located upon the completion of the build."
160         - string:
161             name: GS_URL
162             default: 'artifacts.opnfv.org/genesis/fuel'
163             description: "URL to Google Storage."
164         - string:
165             name: INSTALLER
166             default: 'fuel'
167             description: "Installer to use."
168         - string:
169             name: GIT_BASE
170             default: https://gerrit.opnfv.org/gerrit/genesis
171         - string:
172             name: GERRIT_BRANCH
173             default: origin/master
174             description: "Branch to build, deploy and test."
175         - string:
176             name: GERRIT_REFSPEC
177             default: refs/heads/master
178             description: "Refspec to retrieve."
179
180     scm:
181         - git:
182             skip-tag: true
183             url: $GIT_BASE
184             branches:
185                 - $GERRIT_BRANCH
186             refspec: $GERRIT_REFSPEC
187
188     triggers:
189         - pollscm: '@midnight'
190
191     logrotate:
192         daysToKeep: 30
193         numToKeep: 10
194         artifactDaysToKeep: -1
195         artifactNumToKeep: -1
196
197     builders:
198         - 'fuel-daily-master'
199
200
201 - builder:
202     name: fuel-verify
203     builders:
204         - shell: |
205             #!/bin/bash
206             set -o errexit
207             set -o nounset
208             set -o pipefail
209             set -x
210
211             # set/create the cache location
212             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
213             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
214
215             # do the build
216             cd $WORKSPACE/fuel/ci
217             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
218
219             # list the build artifacts
220             ls -al $BUILD_DIRECTORY
221
222             # remove the BUILD_DIRECTORY to reclaim some space
223             /bin/rm -rf $BUILD_DIRECTORY
224
225 - builder:
226     name: fuel-merge
227     builders:
228         - shell: |
229             #!/bin/bash
230             set -o errexit
231             set -o nounset
232             set -o pipefail
233             set -x
234
235             # set/create the cache location
236             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
237             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
238
239             # do the build
240             cd $WORKSPACE/fuel/ci
241             ./build.sh -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
242
243             # list the build artifacts
244             ls -al $BUILD_DIRECTORY
245
246             # remove the BUILD_DIRECTORY to reclaim some space
247             /bin/rm -rf $BUILD_DIRECTORY
248
249 - builder:
250     name: fuel-daily-master
251     builders:
252         - shell: |
253             #!/bin/bash
254             set -o errexit
255             set -o nounset
256             set -o pipefail
257             set -x
258
259             # set/create the cache location
260             OPNFV_FUEL_CACHE="$(dirname $WORKSPACE)/opnfv_fuel_cache"
261             [[ -d $OPNFV_FUEL_CACHE ]] || mkdir -p $OPNFV_FUEL_CACHE
262
263             # do the build
264             cd $WORKSPACE/fuel/ci
265             ./build.sh -f t -v $BUILD_ID -c file://$OPNFV_FUEL_CACHE $BUILD_DIRECTORY
266
267         - shell: |
268             #!/bin/bash
269             set -o errexit
270             set -o nounset
271             set -o pipefail
272             set -x
273
274             # list the build artifacts
275             ls -al $BUILD_DIRECTORY
276
277             cd $BUILD_DIRECTORY
278
279             # save information regarding artifact into file
280             (
281                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
282                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
283                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
284                 echo "OPNFV_BUILD_URL=$BUILD_URL"
285                 echo "OPNFV_BUILD=OK"
286             ) > opnfv-$BUILD_ID.properties
287
288             # copy artifact property file as latest.properties
289             # so we can directly get info regarding latest artifact
290             /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
291
292             # upload artifact and additional files to google storage
293             gsutil cp opnfv-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
294             gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
295             gsutil cp latest.properties gs://$GS_URL/latest.properties
296
297         - shell: |
298             #!/bin/bash
299             set -o errexit
300             set -o nounset
301             set -o pipefail
302             set -x
303
304             # get the latest.properties file in order to get info regarding latest artifact
305             gsutil cp gs://$GS_URL/latest.properties latest.properties
306
307             # check if we got the file
308             [[ -f latest.properties ]] || exit 1
309
310             # source the file so we get OPNFV vars
311             source latest.properties
312
313             # download the file
314             gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
315
316             # list the file
317             ls -al $WORKSPACE/opnfv.iso
318
319             # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
320             /bin/rm -rf $BUILD_DIRECTORY
321             /bin/rm -rf $WORKSPACE/opnfv.iso