Install nodejs pkg from official repository in MacOs X

Esse commit está contido em:
Angel Abad
2014-04-07 18:50:03 +02:00
commit de Guilhem Lettron
commit 8b0e3629ca
2 arquivos alterados com 33 adições e 0 exclusões
+4
Ver Arquivo
@@ -20,6 +20,8 @@
case node['platform_family']
when 'smartos', 'rhel', 'debian', 'fedora'
default['nodejs']['install_method'] = 'package'
when 'mac_os_x'
default['nodejs']['install_method'] = 'mac_pkg'
else
default['nodejs']['install_method'] = 'source'
end
@@ -37,3 +39,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
+29
Ver Arquivo
@@ -0,0 +1,29 @@
#
# 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.
#
remote_file "#{Chef::Config[:file_cache_path]}/node.pkg" do
source "#{node['nodejs']['src_url']}/v#{node['nodejs']['version']}/node-v#{node['nodejs']['version']}.pkg"
checksum node['nodejs']['checksum_mac_os_x']
action :create
end
execute "installer -pkg #{Chef::Config[:file_cache_path]}/node.pkg -target /" do
action :run
not_if "node --version | grep v#{node['nodejs']['version']}"
end