Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpeabody committed Mar 19, 2014
0 parents commit 5ff027c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Agilion Development Environment (alpha)

Super simple bash based Vagrant provisioning for Rails development environments.
22 changes: 22 additions & 0 deletions Vagrantfile.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- 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 = 'hashicorp/precise64'

config.vm.network 'forwarded_port', guest: 3000, host: 3050

config.vm.synced_folder '.', '/vagrant', type: 'rsync',
rsync__exclude: '.git/'

config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--memory', '512']
end

config.vm.provision 'shell', path: 'base.sh'
config.vm.provision 'shell', path: 'ruby-2.1.sh', privileged: false, keep_color: true
config.vm.provision 'shell', path: 'postgresql.sh'
end
5 changes: 5 additions & 0 deletions scripts/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apt-get update -y

# Common Packages
# memcached and redis will be running on their standard ports.
apt-get install -y curl redis-server memcached libcurl3 libcurl3-gnutls libcurl4-openssl-dev
15 changes: 15 additions & 0 deletions scripts/postgresql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Install postgres
apt-get install -y postgresql libpq-dev postgresql-contrib

# Create DB
if [ ! -d '/usr/local/pgsql/data' ]; then
mkdir -p /usr/local/pgsql/data
chown postgres:postgres /usr/local/pgsql/data
su - postgres -l -c '/usr/lib/postgresql/9.1/bin/initdb -D /usr/local/pgsql/data'

# Setup hstor
su - postgres -l -c 'psql -d template1 -c "create extension hstore;"'
fi

# Create vagrant user
su - postgres -l -c 'createuser vagrant -s'
22 changes: 22 additions & 0 deletions scripts/ruby-2.1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Installs RVM & Ruby 2.1 on 12.04 LTS Ubuntu
# add to Vagrantfile:
# config.vm.provision 'shell', path: 'ruby-2.1.sh', privileged: false, keep_color: true

if [[ -s "/home/vagrant/.rvm/scripts/rvm" ]] ; then
echo 'RVM installed, skipping RVM install'
else
curl -sSL https://get.rvm.io | bash -s stable
fi

source '/home/vagrant/.rvm/scripts/rvm'

if rvm list strings | grep -lq ruby-2.1.0 ; then
echo 'Ruby 2.1.0 installed. Skipping installed.'
else
rvm autolibs packages
rvm requirements
rvm mount https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-2.1.0.tar.bz2
rvm use 2.1.0 --default
fi

echo 'Setting Ruby 2.1 as default'

0 comments on commit 5ff027c

Please sign in to comment.