Comparar commits
5 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| ea88bfaa67 | |||
| 9a0ef56a79 | |||
| 8b0e3629ca | |||
| a1c94e6dae | |||
| 50839ca168 |
@@ -18,7 +18,7 @@
|
||||
#
|
||||
|
||||
case node['platform_family']
|
||||
when 'smartos', 'rhel', 'debian', 'fedora'
|
||||
when 'smartos', 'rhel', 'debian', 'fedora', 'mac_os_x'
|
||||
default['nodejs']['install_method'] = 'package'
|
||||
else
|
||||
default['nodejs']['install_method'] = 'source'
|
||||
@@ -28,7 +28,7 @@ default['nodejs']['version'] = '0.10.26'
|
||||
|
||||
default['nodejs']['prefix_url'] = ::URI.join('http://nodejs.org/dist', "v#{node['nodejs']['version']}").to_s
|
||||
|
||||
default['nodejs']['install_repo'] = true
|
||||
default['nodejs']['install_repo'] = true # Only if available, ie rhel / debian
|
||||
|
||||
default['nodejs']['source']['url'] = nil # Auto generated
|
||||
default['nodejs']['source']['checksum'] = 'ef5e4ea6f2689ed7f781355012b942a2347e0299da0804a58de8e6281c4b1daa'
|
||||
@@ -37,3 +37,5 @@ default['nodejs']['binary']['url'] = nil # Auto generated
|
||||
default['nodejs']['binary']['checksum']['linux_x64'] = '305bf2983c65edea6dd2c9f3669b956251af03523d31cf0a0471504fd5920aac'
|
||||
default['nodejs']['binary']['checksum']['linux_x86'] = '8fa2d952556c8b5aa37c077e2735c972c522510facaa4df76d4244be88f4dc0f'
|
||||
default['nodejs']['binary']['checksum']['linux_arm-pi'] = '561ec2ebfe963be8d6129f82a7d1bc112fb8fbfc0a1323ebe38ef55850f25517'
|
||||
|
||||
default['nodejs']['mac_pkg']['checksum'] = '99b718692a77195e3aafab819b42ad7dba7e90e05a9b6f078bc5171c041331f8'
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
case node['platform_family']
|
||||
when 'debian'
|
||||
default['nodejs']['repo'] = 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu'
|
||||
default['nodejs']['packages'] = node['nodejs']['install_repo'] ? %w(nodejs) : %w(nodejs npm nodejs-dev)
|
||||
default['nodejs']['packages'] = node['nodejs']['install_repo'] ? 'nodejs' : %w(nodejs npm nodejs-dev)
|
||||
when 'rhel', 'fedora'
|
||||
default['nodejs']['packages'] = %w(nodejs nodejs-devel npm)
|
||||
when 'smartos'
|
||||
default['nodejs']['packages'] = %w(nodejs)
|
||||
default['nodejs']['packages'] = 'nodejs'
|
||||
when 'mac_os_x'
|
||||
default['nodejs']['packages'] = 'node'
|
||||
else
|
||||
Chef::Log.error 'There are no nodejs packages for this platform; please use the source or binary method to install node'
|
||||
return
|
||||
Chef::Log.info 'There are no nodejs packages for this platform; please use the source or binary method to install node'
|
||||
end
|
||||
|
||||
+3
-1
@@ -11,13 +11,15 @@ recipe 'nodejs', 'Installs Node.JS based on the default installation method'
|
||||
recipe 'nodejs::install_from_source', 'Installs Node.JS from source'
|
||||
recipe 'nodejs::install_from_binary', 'Installs Node.JS from official binaries'
|
||||
recipe 'nodejs::install_from_package', 'Installs Node.JS from packages'
|
||||
recipe 'nodejs::install_from_mac_pkg', 'Installs Node.JS from MacOs X .pkg file'
|
||||
recipe 'nodejs::npm', 'Installs npm from source - a package manager for node'
|
||||
|
||||
depends 'yum-epel'
|
||||
depends 'build-essential'
|
||||
depends 'ark'
|
||||
depends 'apt'
|
||||
depends 'homebrew', '~> 1.5.5'
|
||||
|
||||
%w(debian ubuntu centos redhat smartos).each do |os|
|
||||
%w(debian ubuntu centos redhat smartos mac_os_x).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Author:: Angel Abad <angelabad@gmail.com>
|
||||
# Cookbook Name:: nodejs
|
||||
# Recipe:: install_from_mac_pkg
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
filename = "node-v#{node['nodejs']['version']}.pkg"
|
||||
url = node['nodejs']['mac_os_x']['url']
|
||||
nodejs_mac_os_x_url = url ? url : ::URI.join(node['nodejs']['prefix_url'], filename).to_s
|
||||
|
||||
remote_file ::File.join(Chef::Config[:file_cache_path], 'node.pkg') do
|
||||
source nodejs_mac_os_x_url
|
||||
checksum node['nodejs']['mac_pkg']['checksum']
|
||||
notifies :run, 'execute[install nodejs on mac]', :immediately
|
||||
end
|
||||
|
||||
execute 'install nodejs with mac_pkg' do
|
||||
command "installer -pkg #{Chef::Config[:file_cache_path]}/node.pkg -target /"
|
||||
action :nothing
|
||||
not_if "node --version | grep v#{node['nodejs']['version']}"
|
||||
end
|
||||
Referência em uma Nova Issue
Bloquear um usuário