Skip to content

Commit

Permalink
Merge pull request resque#347 from meatballhat/vagrantizing
Browse files Browse the repository at this point in the history
Vagrant setup at last!
  • Loading branch information
ksinkar committed Feb 18, 2014
2 parents 2f208d0 + 90426bd commit d37a9f7
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Gemfile.lock
*.swp

/coverage/
/.vagrant/
/dump.rdb
15 changes: 15 additions & 0 deletions .vagrant-provision-as-vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e
set -x

ln -svf /vagrant/.vagrant-skel/bashrc ~/.bashrc
ln -svf /vagrant/.vagrant-skel/bash_profile ~/.bash_profile

source ~/.bashrc

set +x
curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0 --auto-dotfiles

source ~/.rvm/scripts/rvm
gem install --no-ri --no-rdoc bundler foreman
23 changes: 23 additions & 0 deletions .vagrant-provision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive

umask 022

set -e
set -x

apt-get update -yq
apt-get install --no-install-suggests -yq python-software-properties
add-apt-repository -y ppa:chris-lea/redis-server
apt-get update -yq
apt-get install --no-install-suggests -yq \
build-essential \
byobu \
curl \
git \
make \
redis-server \
screen

su - vagrant -c /vagrant/.vagrant-provision-as-vagrant.sh
7 changes: 7 additions & 0 deletions .vagrant-skel/bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!bash

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

if [[ "$PS1" ]] ; then
cd /vagrant
fi
7 changes: 7 additions & 0 deletions .vagrant-skel/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!bash

export LANG='en_US.UTF-8'
export LANGUAGE='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'

export PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,33 @@ of the code looking very similar to resque, particularly in resque-web
and the views. I wanted it to be similar enough that someone familiar
with resque could easily work on resque-scheduler.

### Development

Working on resque-scheduler requires the following:

* A relatively modern Ruby interpreter (MRI 1.9+ is what's tested)
* bundler

The development setup looks like this, which is roughly the same thing
that happens on Travis CI:

``` bash
# Install everything
bundle install
# Make sure tests are green before you change stuff
bundle exec rake
# Change stuff
# Repeat
```

If you have [vagrant](http://www.vagrantup.com) installed, there is a
development box available that requires no plugins or external
provisioners:

``` bash
vagrant up
```

### Contributing

Expand Down
14 changes: 14 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# vim:filetype=ruby

Vagrant.configure('2') do |config|
config.vm.hostname = 'resque-scheduler'
config.vm.box = 'precise64'
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/precise/' <<
'current/precise-server-cloudimg-amd64-vagrant-disk1.box'

config.vm.network :private_network, ip: '33.33.33.10', auto_correct: true
config.vm.network :forwarded_port, guest: 5678, host: 15678,
auto_correct: true

config.vm.provision :shell, path: '.vagrant-provision.sh'
end

0 comments on commit d37a9f7

Please sign in to comment.