Skip to content

Commit

Permalink
rubocop -a; updating .kitchen.cloud.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean OMeara committed Apr 14, 2015
1 parent cc1ece7 commit 7b9396a
Show file tree
Hide file tree
Showing 16 changed files with 164 additions and 125 deletions.
123 changes: 68 additions & 55 deletions .kitchen.cloud.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,93 @@
#<% require 'kitchen-sync' %>
---
driver_config:
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
digitalocean_api_token: <%= ENV['DIGITALOCEAN_API_TOKEN'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
flavor_id: <%= ENV['EC2_FLAVOR_ID'] %>
availability_zone: <%= ENV['AWS_AVAILABILITY_ZONE'] %>

provisioner:
name: chef_zero
require_chef_omnibus: latest

platforms:
- name: centos-5.8
driver_plugin: digitalocean
driver_plugin: digital_ocean
driver_config:
image_id: 1601
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: centos-5-8-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[yum-epel]

- name: centos-6.5
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: centos-6-5-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>

- name: centos-6.4
driver_plugin: digitalocean
- name: centos-7.0
driver_plugin: digital_ocean
driver_config:
image_id: 562354
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: centos-7-0-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>

- name: amazon-2013.09
- name: amazon-2014.09
driver_plugin: ec2
driver_config:
image_id: ami-3be4bc52
image_id: ami-9a6ed3f2
username: ec2-user
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>

- name: fedora-19
driver_plugin: digitalocean
- name: fedora-21
driver_plugin: digital_ocean
driver_config:
image_id: 696598
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: fedora-21-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>

- name: ubuntu-1004
driver_plugin: digitalocean
- name: debian-7.0
driver_plugin: digital_ocean
driver_config:
image_id: 14097
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: debian-7-0-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]

- name: ubuntu-1204
driver_plugin: digitalocean
- name: ubuntu-12.04
driver_plugin: digital_ocean
driver_config:
image_id: 1505447
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: ubuntu-12-04-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]

- name: ubuntu-1310
driver_plugin: digitalocean
- name: ubuntu-14.04
driver_plugin: digital_ocean
driver_config:
image_id: 1505699
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
size: 2gb
image: ubuntu-14-04-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]

Expand All @@ -84,13 +97,13 @@ suites:
- recipe[git]
attributes: {}

- name: source
excludes: ["ubuntu-12.04", "ubuntu-10.04"]
run_list:
- recipe[git::source]
attributes: {}
# - name: source
# excludes: ["ubuntu-12.04", "ubuntu-10.04"]
# run_list:
# - recipe[git::source]
# attributes: {}

- name: server
run_list:
- recipe[git::server]
attributes: {}
# - name: server
# run_list:
# - recipe[git::server]
# attributes: {}
34 changes: 31 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,36 @@ AlignParameters:
Encoding:
Enabled: false

ClassLength:
Enabled: false

MethodLength:
Enabled: false

LineLength:
Max: 200
Enabled: false

# HashSyntax:
# EnforcedStyle: hash_rockets

Documentation:
Enabled: false

PerceivedComplexity:
Enabled: false

CyclomaticComplexity:
Enabled: false

Style/FileName:
Enabled: false

HashSyntax:
EnforcedStyle: hash_rockets
Metrics/AbcSize:
Enabled: false

AllCops:
Exclude:
- 'Guardfile'

Style/GuardClause:
Enabled: false
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ group :integration do
cookbook 'apt'
cookbook 'freebsd'
cookbook 'windows'
cookbook 'git_test', :path => './test/fixtures/cookbooks/git_test'
cookbook 'git_test', path: './test/fixtures/cookbooks/git_test'
end
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ desc 'Run all style checks'
task style: ['style:chef', 'style:ruby']

# Rspec and ChefSpec
desc "Run ChefSpec examples"
desc 'Run ChefSpec examples'
RSpec::Core::RakeTask.new(:spec)

# Integration tests. Kitchen.ci
Expand All @@ -33,21 +33,21 @@ namespace :integration do
instance.test(:always)
end
end

desc 'Run Test Kitchen with cloud plugins'
task :cloud do
run_kitchen = true
if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false'
run_kitchen = false
end

if run_kitchen
Kitchen.logger = Kitchen.default_file_logger
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml')
config = Kitchen::Config.new( loader: @loader)
config = Kitchen::Config.new(loader: @loader)
config.instances.each do |instance|
instance.test(:always)
end
instance.test(:always)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion bin/kitchen
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

require 'rubygems'
Expand Down
2 changes: 1 addition & 1 deletion bin/rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

require 'rubygems'
Expand Down
2 changes: 1 addition & 1 deletion bin/rspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

require 'rubygems'
Expand Down
38 changes: 19 additions & 19 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email '[email protected]'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.1.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email '[email protected]'
license 'Apache 2.0'
description 'Installs git and/or sets up a Git server daemon'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.1.0'
recipe 'git', 'Installs git'
recipe 'git::server', 'Sets up a runit_service for git daemon'
recipe 'git::source', 'Installs git from source'

supports 'amazon'
supports 'arch'
Expand All @@ -32,17 +32,17 @@
depends 'yum-epel'

attribute 'git/server/base_path',
:display_name => 'Git Daemon Base Path',
:description => 'A directory containing git repositories to be ' \
display_name: 'Git Daemon Base Path',
description: 'A directory containing git repositories to be ' \
'exposed by the git-daemon',
:default => '/srv/git',
:recipes => ['git::server']
default: '/srv/git',
recipes: ['git::server']

attribute 'git/server/export_all',
:display_name => 'Git Daemon Export All',
:description => 'Adds the --export-all option to the git-daemon ' \
display_name: 'Git Daemon Export All',
description: 'Adds the --export-all option to the git-daemon ' \
'parameters, making all repositories publicly readable even if ' \
'they lack the \'git-daemon-export-ok\' file',
:choice => %w{ true false },
:default => 'true',
:recipes => ['git::server']
choice: %w(true false),
default: 'true',
recipes: ['git::server']
2 changes: 1 addition & 1 deletion providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def cmd_env

def config
cmd = [config_cmd, new_resource.key].join(' ')
git_config = Mixlib::ShellOut.new(cmd, :user => new_resource.user, :group => new_resource.user, :cwd => new_resource.path, :env => cmd_env)
git_config = Mixlib::ShellOut.new(cmd, user: new_resource.user, group: new_resource.user, cwd: new_resource.path, env: cmd_env)
Chef::Log.debug("Current config cmd: #{git_config.inspect}")
git_config.run_command.stdout.chomp
end
4 changes: 2 additions & 2 deletions recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
group 'root'
mode '0644'
variables(
:git_daemon_binary => value_for_platform_family(
git_daemon_binary: value_for_platform_family(
'debian' => '/usr/lib/git-core/git-daemon',
'rhel' => '/usr/libexec/git-core/git-daemon'
)
)
)
end

service 'xinetd' do
Expand Down
16 changes: 8 additions & 8 deletions recipes/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
# move this to attributes.
case node['platform_family']
when 'fedora'
pkgs = %w{ openssl-devel libcurl-devel expat-devel perl-ExtUtils-MakeMaker }
pkgs = %w(openssl-devel libcurl-devel expat-devel perl-ExtUtils-MakeMaker)
when 'rhel'
case node['platform_version'].to_i
when 5
pkgs = %w{ expat-devel gettext-devel curl-devel openssl-devel zlib-devel }
pkgs = %w(expat-devel gettext-devel curl-devel openssl-devel zlib-devel)
when 6, 7
pkgs = %w{ expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel }
pkgs = %w(expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel)
else
pkgs = %w{ expat-devel gettext-devel curl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel } if node['platform'] == 'amazon'
pkgs = %w(expat-devel gettext-devel curl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel) if node['platform'] == 'amazon'
end
when 'debian'
pkgs = %w{ libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev }
pkgs = %w(libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev)
end

pkgs.each do |pkg|
Expand All @@ -44,9 +44,9 @@

# reduce line-noise-eyness
remote_file "#{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz" do
source node['git']['url']
checksum node['git']['checksum']
mode '0644'
source node['git']['url']
checksum node['git']['checksum']
mode '0644'
not_if "test -f #{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz"
end

Expand Down
Loading

0 comments on commit 7b9396a

Please sign in to comment.