Last active
October 25, 2015 13:26
-
-
Save kenji0x02/8787990 to your computer and use it in GitHub Desktop.
node.jsをnvmでChefる ref: http://qiita.com/kenji0x02/items/8b01d65608aa4ac30e09
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
git "/usr/local/nvm" do | |
repository "git://github.com/creationix/nvm.git" | |
reference "master" | |
action :sync | |
end | |
template "/etc/profile.d/nvm.sh" do | |
source "nvm.sh.erb" | |
mode 00644 | |
end | |
# nvm listしたときにalias/ディレクトリがないとおこられるので、、 | |
directory '/usr/local/nvm/alias' do | |
action :create | |
end | |
bash "install nodejs" do | |
code <<-EOC | |
source /usr/local/nvm/nvm.sh | |
nvm install #{node['nodejs']['version']} | |
EOC | |
# ここにnodeの本体がいる | |
creates "/usr/local/nvm/#{node['nodejs']['version']}" | |
end |
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
source /usr/local/nvm/nvm.sh | |
nvm use <%= node['nodejs']['version'] %> >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment