Permalink
Browse files

Wrap up initial

  • Loading branch information...
1 parent 7bbfc22 commit e89b63e5a5400c125830b0617fc3c81a8c1bd231 @joshuaclayton committed Feb 26, 2012
Showing with 89 additions and 0 deletions.
  1. +6 −0 Vagrantfile
  2. +22 −0 cookbooks/dotfiles/recipes/default.rb
  3. +49 −0 cookbooks/rbenv/recipes/default.rb
  4. +12 −0 cookbooks/vagrant/recipes/default.rb
View
6 Vagrantfile
@@ -69,6 +69,12 @@ Vagrant::Config.run do |config|
# chef.json = { :mysql_password => "foo" }
end
+
+ config.vm.customize [
+ "modifyvm", :id,
+ "--memory", "4096"
+ ]
+
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
View
22 cookbooks/dotfiles/recipes/default.rb
@@ -0,0 +1,22 @@
+default_user = ENV["SUDO_USER"]
+vagrant_home = "/home/#{default_user}"
+
+bash "clone dotfiles" do
+ user default_user
+ group default_user
+
+ code "git clone git://github.com/joshuaclayton/dotfiles.git #{vagrant_home}/.dotfiles"
+ not_if "dir #{vagrant_home}/.dotfiles"
+end
+
+# bash "install dotfiles" do
+# user default_user
+# group default_user
+#
+# cwd "#{vagrant_home}/.dotfiles"
+# code <<-EOF
+# rake install
+# EOF
+#
+# not_if "[[ -h #{vagrant_home}/.irbrc ]]"
+# end
View
49 cookbooks/rbenv/recipes/default.rb
@@ -0,0 +1,49 @@
+default_user = ENV["SUDO_USER"]
+home = "/home/#{default_user}"
+rbenv_path = "#{home}/.rbenv"
+profile_path = "#{home}/.profile"
+
+%w[libreadline5-dev libssl-dev libxml2-dev].each do |pkg|
+ package pkg do
+ action :install
+ end
+end
+
+bash "load rbenv" do
+ user default_user
+ group default_user
+ code <<-EOF
+ rm -f #{profile_path}
+ echo 'export PATH="#{rbenv_path}/bin:$PATH"' >> #{profile_path}
+ echo 'eval "$(rbenv init -)"' >> #{profile_path}
+ source #{profile_path}
+ EOF
+end
+
+bash "prep rbenv" do
+ user default_user
+ group default_user
+
+ code <<-EOF
+ rm -rf #{rbenv_path}
+ git clone git://github.com/sstephenson/rbenv.git #{rbenv_path}
+ mkdir -p #{rbenv_path}/plugins
+ cd #{rbenv_path}/plugins
+ git clone git://github.com/sstephenson/ruby-build.git
+ cd ruby-build
+ PREFIX=#{rbenv_path} ./install.sh
+ EOF
+
+ not_if "dir #{rbenv_path}/plugins/ruby-build"
+end
+
+bash "install rbenv" do
+ code <<-EOF
+ source #{profile_path}
+ rbenv install 1.9.3-p125
+ rbenv hashes
+ rbenv global 1.9.3-p125
+ EOF
+
+ not_if "rbenv version | grep 1.9.3-p125"
+end
View
12 cookbooks/vagrant/recipes/default.rb
@@ -1,4 +1,16 @@
+execute "apt-get update" do
+ user "root"
+end
+
+%w[curl wget tree].each do |pkg|
+ package pkg do
+ action :install
+ end
+end
+
require_recipe "git"
require_recipe "tmux"
require_recipe "zsh"
require_recipe "vim"
+require_recipe "rbenv"
+require_recipe "dotfiles"

0 comments on commit e89b63e

Please sign in to comment.