Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AWS Linux and Debian #29

Merged
merged 11 commits into from
Mar 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 4 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Style/AlignParameters:
Exclude:
- '**/metadata.rb'

Style/SingleSpaceBeforeFirstArg:
Style/SpaceBeforeFirstArg:
Exclude:
- '**/metadata.rb'

Expand All @@ -32,7 +32,9 @@ MethodLength:
Enabled: true
SignalException:
Enabled: true
TrailingComma:
TrailingCommaInLiteral:
Enabled: true
TrailingCommaInArguments:
Enabled: true
WordArray:
Enabled: true
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
site :opscode
source 'https://supermarket.chef.io'

metadata
cookbook 'yum-epel', '~> 2.0.0', :supermarket
9 changes: 7 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 4 additions & 0 deletions chefignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ Vagrantfile
# Travis #
##########
.travis.yml

# Test-Kitchen #
################
.kitchen
3 changes: 3 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
1 change: 0 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# limitations under the License.
#


chef_gem 'rinruby' do # ~FC009
compile_time false if respond_to?(:compile_time)
end
Expand Down
13 changes: 12 additions & 1 deletion recipes/install_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline after the end

version node['r']['version'] if node['r']['version']
action :install
end
Expand Down