From 14e500c6c332e117a3960462c3b60b1bd7623224 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Fri, 18 Mar 2016 16:07:10 -0700 Subject: [PATCH 1/4] Clean up chef-vault requirements Since chef-vault is no longer used in this cookbook (as of the 2.0 rewrite) it can be removed completely --- Gemfile | 1 - metadata.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/Gemfile b/Gemfile index 7561f5b8..a623db22 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ source 'https://rubygems.org' -gem 'chef-vault', '~> 2.6' gem 'poise', '~> 2.2' gem 'poise-service', '~> 1.0' gem 'poise-boiler' diff --git a/metadata.rb b/metadata.rb index 472fdc5d..91bdf39d 100644 --- a/metadata.rb +++ b/metadata.rb @@ -19,7 +19,6 @@ depends 'build-essential' depends 'chef-sugar' -depends 'chef-vault', '~> 1.3' depends 'nssm' depends 'golang' depends 'firewall', '~> 2.0' From fece6e0b6331e4526f242cf9ad45fc137cb3bc25 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Fri, 18 Mar 2016 16:09:50 -0700 Subject: [PATCH 2/4] Resolve rubocop warnings --- libraries/consul_installation_webui.rb | 2 +- libraries/consul_service_windows.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/consul_installation_webui.rb b/libraries/consul_installation_webui.rb index 01371a5f..8734566b 100644 --- a/libraries/consul_installation_webui.rb +++ b/libraries/consul_installation_webui.rb @@ -79,7 +79,7 @@ def self.default_archive_url "https://releases.hashicorp.com/consul/%{version}/%{basename}" # rubocop:disable Style/StringLiterals end - def self.binary_basename(node, resource) + def self.binary_basename(_node, resource) ['consul', resource.version, 'web_ui'].join('_').concat('.zip') end diff --git a/libraries/consul_service_windows.rb b/libraries/consul_service_windows.rb index 7083bafc..7f2db0c0 100644 --- a/libraries/consul_service_windows.rb +++ b/libraries/consul_service_windows.rb @@ -49,14 +49,14 @@ def action_enable end powershell_script 'Trigger consul restart' do action :nothing - code "restart-service consul" + code 'restart-service consul' end end # Check if the service is running, but don't bother if we're already # changing some nssm parameters unless nssm_service_status?(%w{SERVICE_RUNNING}) && mismatch_params.empty? powershell_script 'Trigger consul restart' do - code "restart-service consul" + code 'restart-service consul' end end end @@ -69,7 +69,7 @@ def action_reload def action_restart powershell_script 'Restart consul' do - code "restart-service consul" + code 'restart-service consul' end end @@ -78,7 +78,7 @@ def action_disable # nssm resource doesn't stop the service before it removes it powershell_script 'Stop consul' do action :run - code "stop-service consul" + code 'stop-service consul' only_if { nssm_service_installed? && nssm_service_status?(%w{SERVICE_RUNNING SERVICE_PAUSED}) } end From 9882abddd25b2fcf3628a0c53c6308ae9542cfef Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Fri, 18 Mar 2016 23:37:02 -0700 Subject: [PATCH 3/4] Partially fix spec tests --- .../recipes/consul_installation_webui.rb | 1 + .../consul_installation_webui_spec.rb | 18 ++++++++++++++++++ test/spec/libraries/consul_ui_spec.rb | 18 ------------------ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 test/cookbooks/consul_spec/recipes/consul_installation_webui.rb create mode 100644 test/spec/libraries/consul_installation_webui_spec.rb delete mode 100644 test/spec/libraries/consul_ui_spec.rb diff --git a/test/cookbooks/consul_spec/recipes/consul_installation_webui.rb b/test/cookbooks/consul_spec/recipes/consul_installation_webui.rb new file mode 100644 index 00000000..b94ad3ed --- /dev/null +++ b/test/cookbooks/consul_spec/recipes/consul_installation_webui.rb @@ -0,0 +1 @@ +consul_installation 'webui' diff --git a/test/spec/libraries/consul_installation_webui_spec.rb b/test/spec/libraries/consul_installation_webui_spec.rb new file mode 100644 index 00000000..2b41f873 --- /dev/null +++ b/test/spec/libraries/consul_installation_webui_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' +require_relative '../../../libraries/consul_installation' + +describe ConsulCookbook::Resource::ConsulInstallation do + step_into(:consul_installation) + let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} } + + context 'consul ui install' do + recipe 'consul_spec::consul_installation_webui' + + it do is_expected.to unzip_zipfile('consul_0.6.4_web_ui.zip') + .with(owner: 'myconsul', + group: 'myconsul', + remote_url: 'https://releases.hashicorp.com/consul/0.5.1/consul_0.5.1_web_ui.zip', + install_path: '/opt') + end + end +end diff --git a/test/spec/libraries/consul_ui_spec.rb b/test/spec/libraries/consul_ui_spec.rb deleted file mode 100644 index 59cc4fdf..00000000 --- a/test/spec/libraries/consul_ui_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' -require_relative '../../../libraries/consul_ui' - -describe ConsulCookbook::Resource::ConsulUI do - step_into(:consul_ui) - let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} } - - context 'consul ui install' do - recipe 'consul_spec::consul_ui' - - it do is_expected.to create_libartifact_file('myconsul-ui-0.5.1') - .with(owner: 'myconsul', - group: 'myconsul', - remote_url: "https://releases.hashicorp.com/consul/0.5.1/consul_0.5.1_web_ui.zip", - install_path: '/opt') - end - end -end From a240d33b97004ec96d195c136cb0c078235ca157 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Fri, 18 Mar 2016 23:37:16 -0700 Subject: [PATCH 4/4] Remove github_changelog_generator due to bug See https://github.com/skywinder/github-changelog-generator/issues/329 --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index a623db22..0c5643b4 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ group :lint do end group :unit, :integration do + gem 'chef-sugar' gem 'chefspec' gem 'berkshelf' gem 'serverspec' @@ -16,7 +17,7 @@ end group :development do gem 'awesome_print' - gem 'github_changelog_generator' +# gem 'github_changelog_generator' gem 'rake' gem 'stove' end