4 Commits

Autor SHA1 Mensagem Data
Guilhem Lettron 9a0ef56a79 Refactor some mac_pkg parts 2014-04-10 15:32:09 +02:00
Angel Abad 8b0e3629ca Install nodejs pkg from official repository in MacOs X 2014-04-10 15:18:17 +02:00
Angel Abad a1c94e6dae Add mac_os_x platform to metadata 2014-04-10 15:15:44 +02:00
Angel Abad 50839ca168 Add recipe description in metadata 2014-04-10 15:15:03 +02:00
3 arquivos alterados com 39 adições e 1 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'
+2 -1
Ver Arquivo
@@ -11,6 +11,7 @@ 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'
@@ -18,6 +19,6 @@ depends 'build-essential'
depends 'ark'
depends 'apt'
%w(debian ubuntu centos redhat smartos).each do |os|
%w(debian ubuntu centos redhat smartos mac_os_x).each do |os|
supports os
end
+33
Ver Arquivo
@@ -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