Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
Commits on Jul 22, 2014
@henrikhodne henrikhodne Add a Vagrantfile
This makes it easier to run the tests locally inside of a virtual
machine.
81fcef8
@joshk joshk Merge pull request #271 from travis-ci/hh-vagrant
Add a Vagrantfile
33f8bf9
Showing with 50 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +8 −3 README.md
  3. +41 −0 Vagrantfile
View
1 .gitignore
@@ -7,3 +7,4 @@ tmp
play/*.sh
examples
rspec.log
+.vagrant
View
11 README.md
@@ -12,12 +12,17 @@ form.
## Running test suites
-### Note
-Currently, the specs actually runs generated build scripts. We recommend
-running them inside a virtual machine.
+Since the specs runs the generated build script, we recommend running it in a
+virtual machine to contain the changes. There's a Vagrantfile in this
+repository, so you can use [Vagrant](http://www.vagrantup.com) for this:
+ vagrant up
+ vagrant ssh
+ cd /vagrant
bundle exec rspec spec
+If you wish to just run the specs, you can just run `bundle exec rspec spec`.
+
## Use as addon for CLI
You can set travis-build up as a plugin for the [command line client](https://github.com/travis-ci/travis):
View
41 Vagrantfile
@@ -0,0 +1,41 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+ config.vm.box = "ubuntu/precise64"
+
+ config.vm.provision "shell", privileged: true, inline: <<-EOF
+ if ! [[ -f /usr/local/share/chruby/chruby.sh ]]; then
+ mkdir /tmp/chruby
+ cd /tmp/chruby
+ wget -qO chruby-0.3.8.tar.gz https://github.com/postmodern/chruby/archive/v0.3.8.tar.gz
+ tar -xzvf chruby-0.3.8.tar.gz
+ cd chruby-0.3.8/
+ make install
+ fi
+
+ apt-get update
+ apt-get install -y git libssl-dev
+ EOF
+
+ config.vm.provision "shell", privileged: false, inline: <<-EOF
+ if ! [[ -d ~/.rubies/ruby-2.0.0-p481 ]]; then
+ echo "Installing Ruby 2.0.0 (this might take a while depending on your network connection)"
+ mkdir ~/.rubies
+ wget -qO- http://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.0.0-p481.tar.bz2 | tar -jx -C ~/.rubies
+ RUBIES=(~/.rubies/*)
+ fi
+
+ echo 'source /usr/local/share/chruby/chruby.sh' >> ~/.bashrc
+ echo 'chruby ruby-2.0' >> ~/.bashrc
+
+ source /usr/local/share/chruby/chruby.sh
+ chruby ruby-2.0
+
+ gem install bundler
+ bundle install --gemfile=/vagrant/Gemfile
+ EOF
+end

No commit comments for this range

Something went wrong with that request. Please try again.