Skip to content

Commit

Permalink
Merge pull request #29 from davidski/aws_linux
Browse files Browse the repository at this point in the history
Add support for AWS Linux and Debian
  • Loading branch information
stevendanna authored Mar 4, 2017
2 parents 23ec9d1 + a35413c commit 5603349
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 28 deletions.
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
version node['r']['version'] if node['r']['version']
action :install
end
Expand Down

0 comments on commit 5603349

Please sign in to comment.