From 4408ed5eb9f48b4dbcaf491eaf96d1458070c8be Mon Sep 17 00:00:00 2001 From: Vasily Mikhaylichenko Date: Sun, 16 Jun 2013 08:50:03 +1000 Subject: [PATCH] Implement installation from package on RedHat Now that EPEL includes the packages http://dl.fedoraproject.org/pub/epel/6/x86_64/ --- CHANGELOG.md | 4 ++++ Gemfile | 6 +++--- Rakefile | 6 +++--- metadata.rb | 7 ++++--- recipes/install_from_package.rb | 3 +++ test/integration/package/bats/package.bats | 4 ++++ test/integration/source/bats/source.bats | 4 ++++ 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637c6f2..6516206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.2.0 + * implement installation from package on RedHat - ([@vaskas][]) + ## v1.1.2: * update default version of node to 0.10.2 - ([@bakins][]) * fully migrated to test-kitchen 1.alpha and vagrant 1.1.x/berkshelf 1.3.1 @@ -40,3 +43,4 @@ [@johannesbecker]: https://github.com/johannesbecker [@smith]: https://github.com/smith [@bakins]: https://github.com/bakins +[@vaskas]: https://github.com/vaskas diff --git a/Gemfile b/Gemfile index e6c3a6a..74ad40a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'foodcritic' gem 'thor-foodcritic' group :integration do - gem 'berkshelf', '~> 1.3.1' - gem 'test-kitchen', '~> 1.0.0.alpha.1' - gem 'kitchen-vagrant', '~> 0.7.2' + gem 'berkshelf' + gem 'test-kitchen', '~> 1.0.0.alpha' + gem 'kitchen-vagrant', '~> 0.10.0' end diff --git a/Rakefile b/Rakefile index 4c357c8..f42f584 100644 --- a/Rakefile +++ b/Rakefile @@ -29,8 +29,8 @@ recipes resources templates} end begin - require 'jamie/rake_tasks' - Jamie::RakeTasks.new + require 'kitchen/rake_tasks' + Kitchen::RakeTasks.new rescue LoadError - puts ">>>>> Jamie gem not loaded, omitting tasks" unless ENV['CI'] + puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI'] end diff --git a/metadata.rb b/metadata.rb index 507eda5..d00eff9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ license "Apache 2.0" description "Installs/Configures nodejs" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "1.1.2" +version "1.2.0" name "nodejs" provides "nodejs" @@ -13,8 +13,9 @@ recipe "nodejs::install_from_package", "Installs Node.JS from packages" recipe "nodejs::npm", "Installs npm from source - a package manager for node" -depends "build-essential" -depends "apt" +%w{ apt yum build-essential }.each do |c| + depends c +end %w{ debian ubuntu centos redhat smartos }.each do |os| supports os diff --git a/recipes/install_from_package.rb b/recipes/install_from_package.rb index 658e3fe..2736bfb 100644 --- a/recipes/install_from_package.rb +++ b/recipes/install_from_package.rb @@ -37,6 +37,9 @@ key "C7917B12" action :add end + when 'rhel' + include_recipe 'yum::epel' + packages = %w{ nodejs nodejs-devel npm } when 'smartos' packages = %w{ nodejs } else diff --git a/test/integration/package/bats/package.bats b/test/integration/package/bats/package.bats index a9be561..508b9ca 100644 --- a/test/integration/package/bats/package.bats +++ b/test/integration/package/bats/package.bats @@ -3,3 +3,7 @@ @test "node should be in the path" { [ "$(command -v node)" ] } + +@test "npm should be in the path" { + [ "$(command -v npm)" ] +} diff --git a/test/integration/source/bats/source.bats b/test/integration/source/bats/source.bats index a9be561..508b9ca 100644 --- a/test/integration/source/bats/source.bats +++ b/test/integration/source/bats/source.bats @@ -3,3 +3,7 @@ @test "node should be in the path" { [ "$(command -v node)" ] } + +@test "npm should be in the path" { + [ "$(command -v npm)" ] +}