1 # this is the job configuration for bgs
12 - 'genesis-{installer}-verify'
13 - 'genesis-{installer}-merge'
14 - 'genesis-{installer}-daily-{stream}'
15 - 'genesis-{installer}-build'
16 - 'genesis-{installer}-deploy'
18 # stream: branch with - in place of / (eg. stable-helium)
19 # branch: branch (eg. stable/helium)
25 ########################
27 ########################
30 name: 'genesis-{installer}-verify'
32 project-type: freestyle
39 artifactDaysToKeep: -1
45 default: '{installer}'
46 description: "Installer to use."
49 default: $WORKSPACE/build_output
52 default: '$HOME/opnfv/cache/genesis-{installer}'
55 default: https://gerrit.opnfv.org/gerrit/genesis
63 credentials-id: '{ssh-credentials}'
64 refspec: '$GERRIT_REFSPEC'
65 choosing-strategy: 'gerrit'
68 - ssh-agent-credentials:
69 user: '{ssh-credentials}'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: 'genesis'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/master'
93 pattern: '{installer}/**'
100 name: 'genesis-{installer}-merge'
102 # builder-merge job to run JJB update
104 # This job's purpose is to update all the JJB
106 project-type: freestyle
113 artifactDaysToKeep: -1
119 default: '{installer}'
120 description: "Installer to use."
122 name: BUILD_DIRECTORY
123 default: $WORKSPACE/build_output
125 name: CACHE_DIRECTORY
126 default: '$HOME/opnfv/cache/genesis-{installer}'
129 default: https://gerrit.opnfv.org/gerrit/genesis
136 - gerrit-trigger-scm:
137 credentials-id: '{ssh-credentials}'
139 choosing-strategy: 'default'
142 - ssh-agent-credentials:
143 user: '{ssh-credentials}'
148 - change-merged-event
149 - comment-added-contains-event:
150 comment-contains-value: 'remerge'
152 - project-compare-type: 'ANT'
153 project-pattern: 'genesis'
155 - branch-compare-type: 'ANT'
156 branch-pattern: '**/master'
161 pattern: '{installer}/**'
167 name: 'genesis-{installer}-daily-{stream}'
169 project-type: freestyle
174 - genesis-parameters:
175 installer: '{installer}'
183 refspec: $GERRIT_REFSPEC
186 - pollscm: '@midnight'
191 artifactDaysToKeep: -1
192 artifactNumToKeep: -1
196 - project: 'genesis-{installer}-build'
201 name: 'genesis-{installer}-build'
203 project-type: freestyle
210 artifactDaysToKeep: -1
211 artifactNumToKeep: -1
214 - genesis-parameters:
215 installer: '{installer}'
223 refspec: $GERRIT_REFSPEC
230 name: 'genesis-{installer}-deploy'
232 project-type: freestyle
239 artifactDaysToKeep: -1
240 artifactNumToKeep: -1
245 default: '{installer}'
246 description: "Installer to use."
249 default: https://gerrit.opnfv.org/gerrit/genesis
250 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
253 default: origin/master
254 description: "Branch to build, deploy and test."
257 default: refs/heads/master
258 description: "Refspec to retrieve."
261 default: 'artifacts.opnfv.org/genesis/{installer}'
262 description: "URL to Google Storage."
264 name: BUILD_DIRECTORY
265 default: $WORKSPACE/build_output
266 description: "Directory where the build artifact will be located upon the completion of the build."
274 refspec: $GERRIT_REFSPEC
279 ########################
281 ########################
283 name: genesis-parameters
287 default: '{installer}'
288 description: "Installer to use."
290 name: BUILD_DIRECTORY
291 default: $WORKSPACE/build_output
292 description: "Directory where the build artifact will be located upon the completion of the build."
294 name: CACHE_DIRECTORY
295 default: '$HOME/opnfv/cache/genesis-{installer}'
298 default: https://gerrit.opnfv.org/gerrit/genesis
299 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
302 default: origin/master
303 description: "Branch to build, deploy and test."
306 default: refs/heads/master
307 description: "Refspec to retrieve."
310 default: 'artifacts.opnfv.org/genesis/{installer}'
311 description: "URL to Google Storage."
313 ########################
315 ########################
326 # get the dependencies - temporary fix for RC0
327 [[ -d $WORKSPACE/$INSTALLER/build ]] || mkdir -p $WORKSPACE/$INSTALLER/build
328 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/$INSTALLER/build/
330 # below lines perhaps need to be enabled in order to fetch images from internet
331 # as we are having disk space issues on ericsson-build slave
332 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
333 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
334 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
337 cd $WORKSPACE/$INSTALLER/ci
338 ./build.sh $BUILD_DIRECTORY
340 # list the build artifacts
341 ls -al $BUILD_DIRECTORY
343 # remove the BUILD_DIRECTORY to reclaim some space
344 /bin/rm -rf $BUILD_DIRECTORY
356 # get the dependencies - temporary fix for RC0
357 [[ -d $WORKSPACE/$INSTALLER/build ]] || mkdir -p $WORKSPACE/$INSTALLER/build
358 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/$INSTALLER/build/
360 # below lines perhaps need to be enabled in order to fetch images from internet
361 # as we are having disk space issues on ericsson-build slave
362 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
363 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
364 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
367 cd $WORKSPACE/$INSTALLER/ci
368 ./build.sh $BUILD_DIRECTORY
370 # list the build artifacts
371 ls -al $BUILD_DIRECTORY
373 # remove the BUILD_DIRECTORY to reclaim some space
374 /bin/rm -rf $BUILD_DIRECTORY
386 # log info to console
387 echo "Starting build of $INSTALLER. This could take some time..."
388 echo "--------------------------------------------------------"
391 # create the cache directory if it doesn't exist
392 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
394 # set ARTIFACT_VERSION
395 export ARTIFACT_VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
398 cd $WORKSPACE/$INSTALLER/ci
399 ./build.sh -v $ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
401 # save information regarding artifact into file
403 echo "OPNFV_ARTIFACT_VERSION=$ARTIFACT_VERSION"
404 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
405 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
406 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$ARTIFACT_VERSION.iso"
407 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum opnfv-$ARTIFACT_VERSION.iso | cut -d' ' -f1)"
408 echo "OPNFV_BUILD_URL=$BUILD_URL"
409 echo "OPNFV_BUILD=OK"
410 ) > $WORKSPACE/opnfv.properties
413 echo "--------------------------------------------------------"
417 name: 'upload-artifact'
426 # log info to console
427 echo "Uploading artifact. This could take some time..."
428 echo "--------------------------------------------------------"
431 # list the build output
432 ls -al $BUILD_DIRECTORY
434 # source the opnfv.properties to get ARTIFACT_VERSION
435 source $WORKSPACE/opnfv.properties
437 # copy artifact property file as latest.properties
438 # so we can directly get info regarding latest artifact
439 /bin/cp -f $WORKSPACE/opnfv.properties $WORKSPACE/latest.properties
441 # upload artifact and additional files to google storage
442 echo "gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$ARTIFACT_VERSION.iso"
443 echo "gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$ARTIFACT_VERSION.properties"
444 echo "gsutil cp $WORKSPACE/latest.properties gs://$GS_URL/latest.properties"
447 echo "--------------------------------------------------------"
461 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
463 # and then initiate deployment
464 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml