1 # this is the job configuration for bgs
9 - 'genesis-foreman-verify'
10 - 'genesis-foreman-merge'
11 - 'genesis-foreman-daily-{stream}'
13 # stream: branch with - in place of / (eg. stable-helium)
14 # branch: branch (eg. stable/helium)
21 ########################
23 ########################
26 name: 'genesis-foreman-verify'
28 project-type: freestyle
35 artifactDaysToKeep: -1
41 default: $WORKSPACE/build_output
44 default: https://gerrit.opnfv.org/gerrit/genesis
52 credentials-id: '{ssh-credentials}'
53 refspec: '$GERRIT_REFSPEC'
54 choosing-strategy: 'gerrit'
57 - ssh-agent-credentials:
58 user: '{ssh-credentials}'
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'
73 - project-compare-type: 'ANT'
74 project-pattern: 'genesis'
76 - branch-compare-type: 'ANT'
77 branch-pattern: '**/master'
89 name: 'genesis-foreman-merge'
91 # builder-merge job to run JJB update
93 # This job's purpose is to update all the JJB
95 project-type: freestyle
102 artifactDaysToKeep: -1
107 name: BUILD_DIRECTORY
108 default: $WORKSPACE/build_output
111 default: https://gerrit.opnfv.org/gerrit/genesis
118 - gerrit-trigger-scm:
119 credentials-id: '{ssh-credentials}'
121 choosing-strategy: 'default'
124 - ssh-agent-credentials:
125 user: '{ssh-credentials}'
130 - change-merged-event
131 - comment-added-contains-event:
132 comment-contains-value: 'remerge'
134 - project-compare-type: 'ANT'
135 project-pattern: 'genesis'
137 - branch-compare-type: 'ANT'
138 branch-pattern: '**/master'
143 pattern: 'foreman/**'
149 name: 'genesis-foreman-daily-{stream}'
151 project-type: freestyle
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."
162 default: 'artifacts.opnfv.org/genesis/foreman'
163 description: "URL to Google Storage."
167 description: "Installer to use."
170 default: https://gerrit.opnfv.org/gerrit/genesis
173 default: origin/master
174 description: "Branch to build, deploy and test."
177 default: refs/heads/master
178 description: "Refspec to retrieve."
186 refspec: $GERRIT_REFSPEC
189 - pollscm: '@midnight'
194 artifactDaysToKeep: -1
195 artifactNumToKeep: -1
198 - 'foreman-daily-master'
201 ########################
203 ########################
214 # get the dependencies - temporary fix for RC0
215 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
216 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
218 # below lines perhaps need to be enabled in order to fetch images from internet
219 # as we are having disk space issues on ericsson-build slave
220 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
221 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
222 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
225 cd $WORKSPACE/foreman/ci
226 ./build.sh $BUILD_DIRECTORY
228 # list the build artifacts
229 ls -al $BUILD_DIRECTORY
231 # remove the BUILD_DIRECTORY to reclaim some space
232 /bin/rm -rf $BUILD_DIRECTORY
244 # get the dependencies - temporary fix for RC0
245 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
246 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
248 # below lines perhaps need to be enabled in order to fetch images from internet
249 # as we are having disk space issues on ericsson-build slave
250 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
251 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
252 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
255 cd $WORKSPACE/foreman/ci
256 ./build.sh $BUILD_DIRECTORY
258 # list the build artifacts
259 ls -al $BUILD_DIRECTORY
261 # remove the BUILD_DIRECTORY to reclaim some space
262 /bin/rm -rf $BUILD_DIRECTORY
265 name: foreman-daily-master
274 # get the dependencies - temporary fix for RC0
275 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
276 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
278 # below lines perhaps need to be enabled in order to fetch images from internet
279 # as we are having disk space issues on ericsson-build slave
280 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
281 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
282 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
285 cd $WORKSPACE/foreman/ci
286 ./build.sh -v $BUILD_ID $BUILD_DIRECTORY
295 # list the build artifacts
296 ls -al $BUILD_DIRECTORY
300 # save information regarding artifact into file
302 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
303 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
304 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
305 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum opnfv-$ARTIFACT_VERSION.iso | cut -d' ' -f1)"
306 echo "OPNFV_BUILD_URL=$BUILD_URL"
307 echo "OPNFV_BUILD=OK"
308 ) > opnfv-$BUILD_ID.properties
310 # copy artifact property file as latest.properties
311 # so we can directly get info regarding latest artifact
312 /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
314 # upload artifact and additional files to google storage
315 gsutil cp OPNFV-CentOS-7-x86_64-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
316 gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
317 gsutil cp latest.properties gs://$GS_URL/latest.properties
326 # get the latest.properties file in order to get info regarding latest artifact
327 gsutil cp gs://$GS_URL/latest.properties latest.properties
329 # check if we got the file
330 [[ -f latest.properties ]] || exit 1
332 # source the file so we get OPNFV vars
333 source latest.properties
336 gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
339 ls -al $WORKSPACE/opnfv.iso
341 # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
342 /bin/rm -rf $BUILD_DIRECTORY
343 /bin/rm -rf $WORKSPACE/opnfv.iso