From 7cf5294b092432a14e5ff7e84219cd58102da14f Mon Sep 17 00:00:00 2001 From: John Brooker Date: Fri, 20 Mar 2015 16:55:30 -0700 Subject: [PATCH] Vagrant: Build checked out Rocket Previously the vagrant configuration would grab the last release of Rocket to build. Now Rocket will be built on whatever is in the checked out git repository (/vagrant inside the VM) This will allow testing of changes to Rocket using the "vagrant provision" command. It will also automatically use the latest rocket version. Assumes ./build script handles cleanup. Go and APPC versions still manually configured in provisioning scripts --- Vagrantfile | 2 -- scripts/vagrant/install-go.sh | 2 +- scripts/vagrant/install-rocket.sh | 24 ++++++------------------ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 5923756..483275f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,7 +11,5 @@ Vagrant.configure('2') do |config| config.vm.provision :shell, :privileged => false, :path => "scripts/vagrant/install-go.sh" # Install Rocket - # FIXME: changing the versions recorded in this file and re-run "vagrant provision" wont - # upgrade your VM instance. you need to destroy and start from scratch config.vm.provision :shell, :privileged => false, :path => "scripts/vagrant/install-rocket.sh" end diff --git a/scripts/vagrant/install-go.sh b/scripts/vagrant/install-go.sh index 87e2021..83df383 100644 --- a/scripts/vagrant/install-go.sh +++ b/scripts/vagrant/install-go.sh @@ -17,7 +17,7 @@ if ! [ -e $prefix/go ]; then fi # setup user environment variables -echo "export GOROOT=$prefix/go" |sudo tee /etc/profile.d/go.sh +echo "export GOROOT=$prefix/go" |sudo tee /etc/profile.d/01go.sh cat << 'EOF' |sudo tee -a /etc/profile.d/go.sh export GOPATH=$HOME/.gopath diff --git a/scripts/vagrant/install-rocket.sh b/scripts/vagrant/install-rocket.sh index b8ba458..46ab91e 100644 --- a/scripts/vagrant/install-rocket.sh +++ b/scripts/vagrant/install-rocket.sh @@ -3,7 +3,6 @@ set -xe export DEBIAN_FRONTEND=noninteractive -ROCKET_VERSION=0.4.2 APP_SPEC_VERSION=0.4.1 if ! [ -d app-spec ]; then @@ -17,21 +16,10 @@ if ! [ -d app-spec ]; then popd fi -if ! [ -d rocket ]; then - echo "Install rocket ${ROCKET_VERSION}" - mkdir rocket - - # install deps - which unsquashfs || sudo apt-get install -y squashfs-tools - - # grab rocket - wget -q -O rocket.tar.gz https://github.com/coreos/rocket/archive/v${ROCKET_VERSION}.tar.gz - tar xzvf rocket.tar.gz -C rocket --strip-components=1 - - # build/install rocket - pushd rocket - ./build - sudo cp -v bin/* /usr/local/bin - popd -fi +pushd /vagrant +./build +cat << EOF | sudo tee /etc/profile.d/99rkt.sh + export PATH=$PWD/bin:\$PATH + export GOPATH=$PWD/gopath:\$GOPATH +EOF