diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 2148824..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,21 +0,0 @@ -engines: - rubocop: - enabled: true - #checks: - # Rubocop/Metrics/ClassLength: - # enabled: false - duplication: - enabled: true - config: - languages: - - ruby: - mass_threshold: 30 -ratings: - paths: - - app/** - - lib/** - - "**.rb" - - "**.go" -exclude_paths: -- spec/**/* -- "**/vendor/**/*" \ No newline at end of file diff --git a/.rspec b/.rspec deleted file mode 100755 index 16f9cdb..0000000 --- a/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---format documentation diff --git a/CHANGELOG.md b/CHANGELOG.md index a2487b9..5943e7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ##CHANGE LOG --- +##1.0.6 - 03/17/2017 - Levon Becker +* Moved attributes out of default to own matching attributes file. Easier to add/remove functions and find attributes I'm looking for. +* Added Sendmail recipe call, but nothing in it yet. +* Removed Code Climate. Really that's good for like a Ruby Gem. Not so much for a cookbook. Especially because I'm not going to write rspec tests. + ##1.0.5 - 03/16/2017 - Levon Becker * Added cfn-init.log and cfn-init-cmd.log to Cloudwatch Logs Stream diff --git a/README.md b/README.md index b2e146c..78bb55b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Bonusbits Mediawiki on Nginx in AWS Chef Cookbook and CloudFormation Template [![CircleCI](https://circleci.com/gh/bonusbits/bonusbits_mediawiki_nginx.svg?style=shield)](https://circleci.com/gh/bonusbits/bonusbits_mediawiki_nginx) -[![Code Climate](https://codeclimate.com/github/bonusbits/bonusbits_mediawiki_nginx/badges/gpa.svg)](https://codeclimate.com/github/bonusbits/bonusbits_mediawiki_nginx) [![Join the chat at https://gitter.im/bonusbits/bonusbits_mediawiki_nginx](https://badges.gitter.im/bonusbits/bonusbits_mediawiki_nginx.svg)](https://gitter.im/bonusbits/bonusbits_mediawiki_nginx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) # Purpose diff --git a/attributes/adsense.rb b/attributes/adsense.rb new file mode 100644 index 0000000..5274c1e --- /dev/null +++ b/attributes/adsense.rb @@ -0,0 +1 @@ +default['bonusbits_mediawiki_nginx']['adsense']['configure'] = true diff --git a/attributes/cloudwatch_logs.rb b/attributes/cloudwatch_logs.rb new file mode 100644 index 0000000..27881d1 --- /dev/null +++ b/attributes/cloudwatch_logs.rb @@ -0,0 +1 @@ +default['bonusbits_mediawiki_nginx']['cloudwatch_logs']['configure'] = true diff --git a/attributes/default.rb b/attributes/default.rb index aaff634..7221cb0 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -7,20 +7,6 @@ 'dev' end -default['bonusbits_mediawiki_nginx'].tap do |root| - # CloudWatch Logs - root['cloudwatch_logs']['configure'] = true - - # Data Bag - root['data_bag'] = 'bonusbits_mediawiki_nginx' - root['data_bag_item'] = 'example_databag_item' - - # EFS - root['efs']['configure'] = true - - # Log Rotate - root['logrotate']['configure'] = true - - # Google AdSense - root['adsense']['configure'] = false -end +# Data Bags +default['bonusbits_mediawiki_nginx']['data_bag'] = 'bonusbits_mediawiki_nginx' +default['bonusbits_mediawiki_nginx']['data_bag_item'] = 'example_databag_item' diff --git a/attributes/efs.rb b/attributes/efs.rb new file mode 100644 index 0000000..06b5268 --- /dev/null +++ b/attributes/efs.rb @@ -0,0 +1 @@ +default['bonusbits_mediawiki_nginx']['efs']['configure'] = true diff --git a/attributes/logrotate.rb b/attributes/logrotate.rb new file mode 100644 index 0000000..5626303 --- /dev/null +++ b/attributes/logrotate.rb @@ -0,0 +1 @@ +default['bonusbits_mediawiki_nginx']['logrotate']['configure'] = true diff --git a/attributes/sendmail.rb b/attributes/sendmail.rb new file mode 100644 index 0000000..c5b2fb8 --- /dev/null +++ b/attributes/sendmail.rb @@ -0,0 +1 @@ +default['bonusbits_mediawiki_nginx']['sendmail']['configure'] = true diff --git a/circle.yml b/circle.yml index dbc0ae2..4aba7af 100644 --- a/circle.yml +++ b/circle.yml @@ -3,8 +3,6 @@ machine: version: '2.3.1' timezone: America/Los_Angeles - environment: - CODECLIMATE_REPO_TOKEN: bc471ba6d3548276f87ec72cafbd264a119b84bb161371569296dec7a330f8b0 dependencies: override: diff --git a/cloudformation/bonusbits-mediawiki-nginx.yml b/cloudformation/bonusbits-mediawiki-nginx.yml index 9847dd9..8a419d7 100644 --- a/cloudformation/bonusbits-mediawiki-nginx.yml +++ b/cloudformation/bonusbits-mediawiki-nginx.yml @@ -610,9 +610,6 @@ Resources: "configure": ${UpdateDNS}, "hosted_zone_id": "${HostedZoneId}", "record_name": "${RecordName}" - }, - "adsense": { - "configure": true } } } diff --git a/metadata.rb b/metadata.rb index 4ca4312..a80f7cc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'MIT' description 'Deploy Mediawiki on Amazon Linux running Nginx and Php-fpm' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.0.5' +version '1.0.6' issues_url 'https://github.com/bonusbits/bonusbits_mediawiki_nginx/issues' source_url 'https://github.com/bonusbits/bonusbits_mediawiki_nginx' diff --git a/recipes/default.rb b/recipes/default.rb index 547c318..ce7b09f 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -39,7 +39,7 @@ include_recipe 'bonusbits_mediawiki_nginx::mediawiki' # Setup Sendmail -# include_recipe 'bonusbits_mediawiki_nginx::sendmail' if node['bonusbits_mediawiki_nginx']['sendmail']['configure'] +include_recipe 'bonusbits_mediawiki_nginx::sendmail' if node['bonusbits_mediawiki_nginx']['sendmail']['configure'] # Deploy Node Info Script include_recipe 'bonusbits_mediawiki_nginx::node_info' if node['bonusbits_mediawiki_nginx']['node_info']['deploy'] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index d8d4c7c..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'chefspec' -require 'chefspec/berkshelf' - -require 'simplecov' -require 'codeclimate-test-reporter' - -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - CodeClimate::TestReporter::Formatter -] - -if ENV['CIRCLE_ARTIFACTS'] - dir = File.join('..', '..', '..', ENV['CIRCLE_ARTIFACTS'], 'coverage') - SimpleCov.coverage_dir(dir) -end diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb deleted file mode 100644 index d0e2410..0000000 --- a/spec/unit/recipes/default_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe 'bonusbits_mediawiki_nginx::default' do - linux_platform_list = { - Amazon: '2016.03' - } - - linux_platform_list.each do |platform, version| - plat = platform.to_s - context "#{plat} #{version}" do - let(:chef_run) do - runner = ChefSpec::ServerRunner.new( - platform: plat.downcase, - version: version - ) - runner.converge(described_recipe) - end - - it 'should include bonusbits_mediawiki_nginx::packages recipe' do - expect(chef_run).to include_recipe('bonusbits_mediawiki_nginx::packages') - end - end - end -end diff --git a/test/environments/example_environment.json b/test/environments/example_environment.json index a684786..dd1b53a 100644 --- a/test/environments/example_environment.json +++ b/test/environments/example_environment.json @@ -30,9 +30,6 @@ "configure": true, "hosted_zone_id": "V2UYT8USYGG8F8", "record_name": "www.example.com" - }, - "adsense": { - "configure": true } } } diff --git a/test/integration/default/inspec/cloudwatch_logs_spec.rb b/test/integration/default/inspec/cloudwatch_logs_spec.rb index 61cda5d..5e7f756 100755 --- a/test/integration/default/inspec/cloudwatch_logs_spec.rb +++ b/test/integration/default/inspec/cloudwatch_logs_spec.rb @@ -10,15 +10,6 @@ it 'Deploy awslogs.conf' do expect(file('/etc/awslogs/awslogs.conf')).to exist end - it 'Deploy publish-squid-metrics' do - expect(file('/usr/sbin/publish-squid-metrics')).to exist - end - it 'Rotate Squid Logs Cron Job' do - have_entry(cron('0 0 * * * squid -k rotate')).with_user('root') - end - it 'Publish Metrics Cron Job' do - have_entry(cron('*/5 * * * * bash /usr/sbin/publish-squid-metrics')).with_user('root') - end it 'AWS LOGS Service Enabled' do expect(service('awslogs')).to be_enabled end diff --git a/test/integration/default/inspec/default_spec.rb b/test/integration/default/inspec/default_spec.rb index 85f78d0..b95df3d 100755 --- a/test/integration/default/inspec/default_spec.rb +++ b/test/integration/default/inspec/default_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'bonusbits_mediawiki_nginx::default' do - it 'Security Patch Cron Job Created' do + it 'Include CloudWatch Logs Recipe' do have_entry(cron('0 0 * * * yum -y update --security')).with_user('root') end end diff --git a/test/integration/default/inspec/packages_spec.rb b/test/integration/default/inspec/packages_spec.rb new file mode 100755 index 0000000..4f25724 --- /dev/null +++ b/test/integration/default/inspec/packages_spec.rb @@ -0,0 +1,53 @@ +require 'spec_helper' + +web_package_list = %w( + apr + apr-util + enchant + git + ImageMagick + json-c + mysql56 + nginx + openssl + openssl-devel + pcre + perl-core perl-CPAN + perl-Crypt-SSLeay + perl-DateTime + perl-libwww-perl + perl-Sys-Syslog + php70-cli + php70-common + php70-enchant + php70-fpm + php70-intl + php70-mbstring + php70-mcrypt + php70-mysqlnd + php70-pdo + php70-pecl-apcu + php70-pecl-imagick + php70-process + php70-xml + texlive +) + +other_package_list = %w( + htop + mlocate + vim +) + +describe 'bonusbits_mediawiki_nginx::packages' do + it 'Web Packages Installed' do + web_package_list.each do |package| + expect(package(package)).to be_installed + end + end + it 'Other Packages Installed' do + other_package_list.each do |package| + expect(package(package)).to be_installed + end + end +end