File tree Expand file tree Collapse file tree 6 files changed +20
-15
lines changed Expand file tree Collapse file tree 6 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 1+ ## v1.0.1:
2+
3+ * fixed bug that prevented overwritting the node/npm versions (moved the ` src_url ` s as local variables instead of attributes) - thanks @johannesbecker
4+ * updated the default versions to the latest node/npm
5+
16## v1.0.0:
27
38* added packages installation support thanks to Nathan L Smith
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ REQUIREMENTS
1111
1212## Platform
1313
14- * Tested on Debian 5+ and Ubuntu 10.04
14+ * Tested on Debian 6 and Ubuntu 10.04
1515* Should work fine on Centos, RHEL, etc.
1616
1717## Cookbooks:
Original file line number Diff line number Diff line change 1818#
1919
2020default [ 'nodejs' ] [ 'install_method' ] = 'source'
21- default [ 'nodejs' ] [ 'version' ] = '0.8.2 '
22- default [ 'nodejs' ] [ 'checksum' ] = '94bbdb2d62645fd2ad5b96e41cfec68abf004fd03fabaaf7d71c48b39013cbd1 '
21+ default [ 'nodejs' ] [ 'version' ] = '0.8.6 '
22+ default [ 'nodejs' ] [ 'checksum' ] = 'dbd42800e69644beff5c2cf11a9d4cf6dfbd644a9a36ffdd5e8c6b8db9240854 '
2323default [ 'nodejs' ] [ 'dir' ] = '/usr/local'
24- default [ 'nodejs' ] [ 'npm' ] = '1.1.39'
25-
26- nodejs_tar_path = "node-v#{ node [ 'nodejs' ] [ 'version' ] } .tar.gz"
27- if node [ 'nodejs' ] [ 'version' ] . split ( '.' ) [ 1 ] . to_i >= 5
28- nodejs_tar_path = "v#{ node [ 'nodejs' ] [ 'version' ] } /#{ nodejs_tar_path } "
29- end
30-
31- default [ 'nodejs' ] [ 'src_url' ] = "http://nodejs.org/dist/#{ nodejs_tar_path } "
32- default [ 'nodejs' ] [ 'npm_src_url' ] = "http://registry.npmjs.org/npm/-/npm-#{ node [ 'nodejs' ] [ 'npm' ] } .tgz"
24+ default [ 'nodejs' ] [ 'npm' ] = '1.1.48'
Original file line number Diff line number Diff line change 33license "Apache 2.0"
44description "Installs/Configures nodejs"
55long_description IO . read ( File . join ( File . dirname ( __FILE__ ) , 'README.md' ) )
6- version "1.0.0 "
6+ version "1.0.1 "
77
88recipe "nodejs" , "Installs Node.JS based on the default installation method"
99recipe "nodejs::install_from_source" , "Installs Node.JS from source"
Original file line number Diff line number Diff line change 2828end
2929
3030nodejs_tar = "node-v#{ node [ 'nodejs' ] [ 'version' ] } .tar.gz"
31+ nodejs_tar_path = nodejs_tar
32+ if node [ 'nodejs' ] [ 'version' ] . split ( '.' ) [ 1 ] . to_i >= 5
33+ nodejs_tar_path = "v#{ node [ 'nodejs' ] [ 'version' ] } /#{ nodejs_tar_path } "
34+ end
35+ nodejs_src_url = "http://nodejs.org/dist/#{ nodejs_tar_path } "
3136
3237remote_file "/usr/local/src/#{ nodejs_tar } " do
33- source node [ 'nodejs' ] [ 'src_url' ]
38+ source nodejs_src_url
3439 checksum node [ 'nodejs' ] [ 'checksum' ]
3540 mode 0644
41+ action :create_if_missing
3642end
3743
3844# --no-same-owner required overcome "Cannot change ownership" bug
Original file line number Diff line number Diff line change 2222
2323package "curl"
2424
25+ npm_src_url = "http://registry.npmjs.org/npm/-/npm-#{ node [ 'nodejs' ] [ 'npm' ] } .tgz"
26+
2527bash "install npm - package manager for node" do
2628 cwd "/usr/local/src"
2729 user "root"
2830 code <<-EOH
2931 mkdir -p npm-v#{ node [ 'nodejs' ] [ 'npm' ] } && \
3032 cd npm-v#{ node [ 'nodejs' ] [ 'npm' ] }
31- curl -L #{ node [ 'nodejs' ] [ ' npm_src_url' ] } | tar xzf - --strip-components=1 && \
33+ curl -L #{ npm_src_url } | tar xzf - --strip-components=1 && \
3234 make uninstall dev
3335 EOH
3436 not_if "#{ node [ 'nodejs' ] [ 'dir' ] } /bin/npm -v 2>&1 | grep '#{ node [ 'nodejs' ] [ 'npm' ] } '"
You can’t perform that action at this time.
0 commit comments