Skip to content

Latest commit

 

History

History
46 lines (40 loc) · 2.14 KB

vagrant_setup.md

File metadata and controls

46 lines (40 loc) · 2.14 KB

Setting up a vagrant box

Travis CI is used to build resembleio & there might be occasion when, due to a failing build, the developer needs to exactly replicate the Travis build environment. Travis uses Ubuntu Precise at time of writing, which might be different from your own OS. The most convenient way to do this is probably to use a Vagrant VM. A high level outline of the setup steps is as below.

Geting a vagrant VM

  1. download vagrant
  2. download virtualbox
  3. In your user home dir: vagrant init hashicorp/precise32 # This creates a 'Vagrantfile' in your home directory
  4. vagrant up # this starts the VM
  5. vagrant list # this should show you have a single VM named 'default' in the running state
  6. vagrant ssh default

Installing the required binaries

  1. sudo apt-get install git
  2. git config --global user.name "YourName"
  3. git config --global user.email "YourEmail"
  4. sudo apt-get install curl
  5. Download go from https://golang.org/doc/install?download=go1.4.3.linux-386.tar.gz. Stuck on 1.4 until the make.bash fix gets put live and a new binary release is made
  6. On your desktop: vagrant scp go1.4.3.linux-386.tar.gz default:/home/vagrant/go1.4.3.linux-386.tar.gz
  7. On the vagrant VM: sudo tar -C /usr/local -xzvf go1.5.1.linux-386.tar.gz
  8. bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
  9. source $HOME/.gvm/scripts/gvm
  10. Add to ~/.profile: export GOPATH=$HOME/gopath
  11. source ~/.profile
  12. command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
  13. \curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles
  14. rvm install 2.1.7 # should install ruby v2.1.7
  15. rvm list # should show ruby2.1.7 under the list of installed ruby versions
  16. gem install bundler

Setup working area

  1. cd
  2. mkdir gopath
  3. go get github.com/dhrapson/resembleio/resemble
  4. cd gopath/src/github.com/dhrapson/resembleio
  5. go get -t -v ./...
  6. go test -v ./...
  7. chmod +x run_specs.sh
  8. ./run_specs.sh

Check the travis yaml file for cross-platform build instructions

When finished

  1. vagrant suspend default