Created
November 12, 2012 17:46
-
-
Save tizzo/4060801 to your computer and use it in GitHub Desktop.
Jenkins Veewee Build Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION=`VBoxManage -v | sed 's/\(.*\)r\([0-9]*\)/\1/'` | |
if [ $RELEASE = "precise" ]; then | |
TEMPLATE="ubuntu-12.04.1-server-i386" | |
fi | |
if [ $RELEASE = "lucid" ]; then | |
TEMPLATE="ubuntu-10.04.4-server-i386" | |
fi | |
BOX_NAME="$RELEASE-vbox-$VERSION" | |
BOX_PATH="boxes/$RELEASE-vbox-$VERSION.box" | |
if [ `VBoxManage list runningvms | grep -c $BOX_NAME` -eq 1 ]; then | |
VBoxManage controlvm $BOX_NAME poweroff | |
fi | |
if [ `VBoxManage list vms | grep -c $BOX_NAME` -eq 1 ]; then | |
VBoxManage unregistervm $BOX_NAME --delete | |
fi | |
if [ `vagrant box list | grep -c $BOX_NAME` -eq 1 ]; then | |
vagrant box remove $BOX_NAME | |
fi | |
if [ -e $BOX_PATH ]; then | |
rm $BOX_PATH | |
fi | |
bundle install | |
bundle exec veewee vbox define $BOX_NAME $TEMPLATE | |
bundle exec veewee vbox build -n -a $BOX_NAME | |
VBoxManage controlvm $BOX_NAME poweroff | |
VBoxManage startvm $BOX_NAME -type headless | |
bundle exec veewee vbox validate $BOX_NAME | |
VBoxManage controlvm $BOX_NAME poweroff | |
vagrant package --base $BOX_NAME --output $BOX_PATH | |
vagrant box add $BOX_NAME $BOX_PATH | |
VBoxManage unregistervm $BOX_NAME --delete |
Updated to allow multiple runs with the same release.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added parameters to build lucid as well as precise.