Skip to content

Instantly share code, notes, and snippets.

@kei2100
Created December 21, 2013 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kei2100/8069494 to your computer and use it in GitHub Desktop.
Save kei2100/8069494 to your computer and use it in GitHub Desktop.
chef recipe nodebrew
#
# Cookbook Name:: base-vagrant
# Recipe:: nodebrew
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
# install nodebrew
template "/etc/profile.d/nodebrew.sh" do
source "etc/profile.d/nodebrew.sh"
owner "root"
group "root"
mode "0644"
end
bash "install nodebrew" do
code <<-EOS
. /etc/profile.d/nodebrew.sh
which nodebrew > /dev/null || curl -L git.io/nodebrew | perl - setup
EOS
end
# install node
version = "v0.10.23"
bash "install node" do
code <<-EOS
. /etc/profile.d/nodebrew.sh
nodebrew ls | grep "#{version}" > /dev/null || nodebrew install-binary #{version}
EOS
end
bash "use node #{version}" do
code <<-EOS
. /etc/profile.d/nodebrew.sh
nodebrew use #{version}
EOS
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment