Created
December 21, 2013 13:49
-
-
Save kei2100/8069494 to your computer and use it in GitHub Desktop.
chef recipe nodebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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