diff --git a/.kitchen.yml b/.kitchen.yml index 131a2cc..d5c9786 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -3,28 +3,20 @@ driver_plugin: vagrant driver_config: require_chef_omnibus: true +provisioner: + name: chef_zero + platforms: +- name: ubuntu-16.04 +- name: ubuntu-14.04 - name: ubuntu-12.04 - driver_config: - box: opscode-ubuntu-12.04 - box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box -- name: ubuntu-10.04 - driver_config: - box: opscode-ubuntu-10.04 - box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box -- name: centos-6.4 - driver_config: - box: opscode-centos-6.4 - box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box -- name: centos-5.9 - driver_config: - box: opscode-centos-5.9 - box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box -- name: debian-7 - driver_config: - box: opscode-debian-7.1 - box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-7.1.0_provisionerless.box +- name: centos-6.7 +- name: centos-5.11 +- name: debian-8.2 suites: - name: default run_list: ["recipe[r]"] - attributes: {} + attributes: + chef_client: + config: + log_level: ":debug" diff --git a/.rubocop.yml b/.rubocop.yml index e3d4fb7..d812a0c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,7 +12,7 @@ Style/AlignParameters: Exclude: - '**/metadata.rb' -Style/SingleSpaceBeforeFirstArg: +Style/SpaceBeforeFirstArg: Exclude: - '**/metadata.rb' @@ -32,7 +32,9 @@ MethodLength: Enabled: true SignalException: Enabled: true -TrailingComma: +TrailingCommaInLiteral: + Enabled: true +TrailingCommaInArguments: Enabled: true WordArray: Enabled: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 676fedc..7a15949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ sudo: false rvm: - - 2.0.0 + - 2.3.1 +before_install: + - gem update --system + - gem --version script: - bundle exec foodcritic -f any . - bundle exec rspec --color --format progress diff --git a/Berksfile b/Berksfile index c4bb297..a373a75 100644 --- a/Berksfile +++ b/Berksfile @@ -1,3 +1,4 @@ -site :opscode +source 'https://supermarket.chef.io' metadata +cookbook 'yum-epel', '~> 2.0.0', :supermarket diff --git a/attributes/default.rb b/attributes/default.rb index 94c8627..5aa6b01 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -22,7 +22,7 @@ default['r']['cran_mirror'] = 'http://cran.fhcrc.org/' case node['platform_family'] -when 'debian' +when 'debian', 'rhel' default['r']['install_method'] = 'package' default['r']['install_repo'] = true else @@ -32,4 +32,9 @@ default['r']['config_opts'] = ['--with-x=no'] end -default['r']['install_dev'] = true +default['r']['install_dev'] = case node['platform_family'] + when 'rhel' + false + else + true + end diff --git a/chefignore b/chefignore index a6de142..70cceef 100644 --- a/chefignore +++ b/chefignore @@ -94,3 +94,7 @@ Vagrantfile # Travis # ########## .travis.yml + +# Test-Kitchen # +################ +.kitchen \ No newline at end of file diff --git a/metadata.rb b/metadata.rb index 1fae184..688e3fd 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,6 +10,9 @@ depends 'ark' depends 'build-essential' depends 'readline' +depends 'yum-epel', '>=2.0.0' supports 'ubuntu' supports 'centos' +supports 'amazon' +supports 'debian' diff --git a/recipes/default.rb b/recipes/default.rb index 7ad0dec..0cfd00c 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -19,7 +19,6 @@ # limitations under the License. # - chef_gem 'rinruby' do # ~FC009 compile_time false if respond_to?(:compile_time) end diff --git a/recipes/install_package.rb b/recipes/install_package.rb index a94e853..5a83071 100644 --- a/recipes/install_package.rb +++ b/recipes/install_package.rb @@ -19,7 +19,18 @@ # limitations under the License. # -package 'r-base' do +pkg_name = case node['platform_family'] + when 'rhel' + 'R' + when 'debian' + 'r-base' + else + 'r_base' + end + +include_recipe 'yum-epel::default' if node['platform_family'] == 'rhel' + +package pkg_name do version node['r']['version'] if node['r']['version'] action :install end