cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject git commit: Patch from Adam Grochowski: errorchecking for basebox build
Date Mon, 20 Aug 2012 19:11:01 GMT
Updated Branches:
  refs/heads/master ad2b8d757 -> b77e26a9b


Patch from Adam Grochowski: errorchecking for basebox build


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b77e26a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b77e26a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b77e26a9

Branch: refs/heads/master
Commit: b77e26a9b10d07120266864d9fd503dd9ba2969c
Parents: ad2b8d7
Author: Chip Childers <chip.childers@gmail.com>
Authored: Mon Aug 20 15:10:08 2012 -0400
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Mon Aug 20 15:10:08 2012 -0400

----------------------------------------------------------------------
 tools/devcloud/build_vagrant_basebox.sh |  110 ++++++++++++++++----------
 1 files changed, 69 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b77e26a9/tools/devcloud/build_vagrant_basebox.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/build_vagrant_basebox.sh b/tools/devcloud/build_vagrant_basebox.sh
index 83429a1..621f141 100755
--- a/tools/devcloud/build_vagrant_basebox.sh
+++ b/tools/devcloud/build_vagrant_basebox.sh
@@ -19,51 +19,79 @@
 # Assumes that rvm is installed and you have ruby 1.9.2 installed
 # Assumes that you have virtual box installed
 # Assumes that you have wget installed
+set -x
+PROGNAME=$(basename $0)
+function error_exit {
 
-mkdir ~/builddevcloud
-cd ~/builddevcloud
-git clone https://github.com/jedi4ever/veewee.git
+   # Display error message and exit
+   echo "${PROGNAME}:  $*" 1>&2
+   exit 1
+}
+
+
+# Load RVM into a shell session *as a function*
+if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
+# First try to load from a user install
+  source "$HOME/.rvm/scripts/rvm"
+
+elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
+
+# Then try to load from a root install
+  source "/usr/local/rvm/scripts/rvm"
+
+else
+
+  printf "ERROR: An RVM installation was not found.\n"
+
+fi
+
+mkdir  ~/builddevcloud || error_exit
+cd ~/builddevcloud || error_exit
+git clone https://github.com/jedi4ever/veewee.git || error_exit
 #TODO: We need to get this patched version of Vagrant to the upstream project
 #      or implement the desired changes to Vagrant as plugin modules and
 #      host it within the ASF git repo
-git clone https://github.com/chipchilders/vagrant.git
-export rvm_trust_rvmrcs_flag=1
-cd vagrant
-bundle install
-rake install
-cd ~/builddevcloud/veewee
-bundle install
-rake install
-bundle exec vagrant basebox define 'devcloudbase' 'ubuntu-12.04-server-i386'
-wget --no-check-certificate -O ./definitions/devcloudbase/definition.rb "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/veewee/definition.rb;hb=HEAD"
-wget --no-check-certificate -O ./definitions/devcloudbase/postinstall.sh "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/veewee/postinstall.sh;hb=HEAD"
-wget --no-check-certificate -O ./definitions/devcloudbase/preseed.cfg "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/veewee/preseed.cfg;hb=HEAD"
-bundle exec vagrant basebox build 'devcloudbase' -f -a -n
+git clone https://github.com/chipchilders/vagrant.git || error_exit
+export rvm_trust_rvmrcs_flag=1 || error_exit
+cd vagrant || error_exit
+bundle install || error_exit "could not bundle install vagrant"
+rake install  || error_exit "could not rake vagrant"
+cd ~/builddevcloud/veewee || error_exit
+bundle install || error_exit
+rake install || error_exit
+bundle exec vagrant basebox define 'devcloudbase' 'ubuntu-12.04-server-i386' || error_exit
"couldn't basebox define"
+wget --no-check-certificate -O ./definitions/devcloudbase/definition.rb https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/definition.rb\;hb\=HEAD
|| error_exit "couldn't get file"
+wget --no-check-certificate -O ./definitions/devcloudbase/postinstall.sh https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/postinstall.sh\;hb\=HEAD
|| error_exit "couldn't get file"
+wget --no-check-certificate -O ./definitions/devcloudbase/preseed.cfg https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/preseed.cfg\;hb\=HEAD
|| error_exit "couldn't get file"
+bundle exec vagrant basebox build 'devcloudbase' -f -a -n || error_exit "couldn't basebox
build"
 # possibly use -r here too ^
-bundle exec vagrant basebox export 'devcloudbase' -f
-bundle exec vagrant basebox destroy 'devcloudbase' -f
-bundle exec vagrant box add 'devcloudbase' 'devcloudbase.box' -f
-rm -f devcloudbase.box
-cd ~/builddevcloud/vagrant
-mkdir devcloudbase
-cd devcloudbase
-mkdir puppet-devcloudinitial
-mkdir puppet-devcloudinitial/files
-mkdir puppet-devcloudinitial/manifests
-wget --no-check-certificate -O Vagrantfile "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/Vagrantfile;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/init.pp "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/init.pp;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/Modulefile "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/files/grub "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/grub;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/files/interfaces "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/files/network.conf "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/files/xen-defaults "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/files/xend "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/xend;hb=HEAD"
-wget --no-check-certificate -O puppet-devcloudinitial/manifests/init.pp "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp;hb=HEAD"
-
-vagrant up
-vagrant halt
-vagrant package default --output ~/devcloud.box
-vagrant destroy -f
-vagrant box remove devcloudbase virtualbox
+bundle exec vagrant basebox export 'devcloudbase' -f || error_exit "couldn't basebox export"
+bundle exec vagrant basebox destroy 'devcloudbase' -f || error_exit "couldn't basebox destroy"
+bundle exec vagrant box add 'devcloudbase' 'devcloudbase.box' -f || error_exit "couldn't
basebox add"
+rm -f devcloudbase.box || error_exit
+cd ~/builddevcloud/vagrant || error_exit
+mkdir devcloudbase || error_exit
+cd devcloudbase || error_exit
+mkdir puppet-devcloudinitial || error_exit
+mkdir puppet-devcloudinitial/files || error_exit
+mkdir puppet-devcloudinitial/manifests || error_exit
+wget --no-check-certificate -O Vagrantfile "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/Vagrantfile;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/init.pp "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/init.pp;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/Modulefile "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/files/grub "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/grub;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/files/interfaces "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/files/network.conf "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/files/xen-defaults "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/files/xend "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/files/xend;hb=HEAD"
|| error_exit
+wget --no-check-certificate -O puppet-devcloudinitial/manifests/init.pp "https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp;hb=HEAD"
|| error_exit
+cd ~/builddevcloud/vagrant/
+bundle install || error_exit
+rake install || error_exit
+cd ~/builddevcloud/vagrant/devcloudbase/
+bundle exec vagrant up || error_exit "vagrant up failed"
+bundle exec vagrant halt || error_exit "vagrant halt failed"
+bundle exec vagrant package default --output ~/devcloud.box || error_exit "vagrant package
failed"
+bundle exec vagrant destroy -f || error_exit "vagrant destroy failed"
+bundle exec vagrant box remove devcloudbase virtualbox || error_exit "vagrant box remove
failed"
 
 echo "Your new devcloud base box is stored in ~/devcloud.box"


Mime
View raw message