Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #190 from linc01n/travis/fc113
Browse files Browse the repository at this point in the history
Remove use_inline_resource
  • Loading branch information
linc01n authored Apr 1, 2018
2 parents ed3875d + 15f7190 commit 1fc8c78
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
6 changes: 3 additions & 3 deletions libraries/stash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def handle_old_stash_attributes!
Chef::Log.warn "node['stash']['backup_client']['#{attr}'] has been changed to node['stash']['backup']['#{attr}']"
show_warn = true
end
Chef::Log.warn <<-EOH if show_warn
Chef::Log.warn <<-WARN if show_warn
This renaming introduces the common approach for both of backup strategies:
'backup_client' and 'backup_diy'. Attributes mentioned above will be gracefully
converted for you, but this warning and conversion will be removed in the next
major release of the 'stash' cookbook.
EOH
WARN
end
# rubocop:enable Metrics/AbcSize

Expand All @@ -62,7 +62,7 @@ def settings_from_data_bag
item = data_bag_item(node['stash']['data_bag_name'],
node['stash']['data_bag_item'])['stash']
return item if item.is_a?(Hash)
rescue
rescue StandardError
Chef::Log.info('No stash data bag found')
end
{}
Expand Down
2 changes: 0 additions & 2 deletions providers/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

use_inline_resources

action :deploy do
git new_resource.destination do
repository "ssh://git@#{node['stash']['ssh']['hostname']}:#{node['stash']['ssh']['port']}/#{new_resource.project}/#{new_resource.repository}.git"
Expand Down
2 changes: 0 additions & 2 deletions providers/deploy_key.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

use_inline_resources
action :create do
key_path = "#{node['stash']['install_path']}/#{new_resource.alias}_ssh_key.pem"
wrapper_path = "#{node['stash']['install_path']}/#{new_resource.alias}_ssh_wrapper.sh"
Expand Down Expand Up @@ -28,4 +27,3 @@
variables(:key_path => key_path)
end
end
# rubocop:enable Metrics/BlockLength
4 changes: 2 additions & 2 deletions providers/hook.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

use_inline_resources

# rubocop:disable Style/MixinUsage
include Stash::Helper
# rubocop:enable Style/MixinUsage

def whyrun_supported?
true
Expand Down
4 changes: 2 additions & 2 deletions providers/repo.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

use_inline_resources

# rubocop:disable Style/MixinUsage
include Stash::Helper
# rubocop:enable Style/MixinUsage

def whyrun_supported?
true
Expand Down
4 changes: 2 additions & 2 deletions recipes/backup_client_cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

handle_old_stash_attributes!

Chef::Log.warn <<~EOH
Chef::Log.warn <<~WARN
Recipe 'stash::backup_client_cron' is deprecated. Please, set attrite
`node['stash']['backup']['crone']['enable'] = true` to configure crond to run
Stash backup periodically. This recipe will be removed in the next major release
of the 'stash' cookbook.
EOH
WARN

settings = settings = merge_stash_settings

Expand Down
4 changes: 2 additions & 2 deletions recipes/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
end

bash 'update home path permission' do
code <<-EOH
code <<-SHELL
chown -R #{node['stash']['user']}:#{node['stash']['user']} #{node['stash']['home_path']}
EOH
SHELL
end
else
config_path = '/stash-config.properties'
Expand Down
4 changes: 2 additions & 2 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
end

it 'renders start-webapp' do
chef_run.node.set['stash']['version'] = '5.0.0'
chef_run.node.set['stash']['version'] = '5.9.0'
chef_run.converge(described_recipe)
expect(chef_run).to render_file('/opt/atlassian/bitbucket/bin/_start-webapp.sh')
end

it 'renders set-jre-home' do
chef_run.node.set['stash']['version'] = '5.0.0'
chef_run.node.set['stash']['version'] = '5.9.0'
chef_run.converge(described_recipe)
expect(chef_run).to render_file('/opt/atlassian/bitbucket/bin/set-jre-home.sh')
end
Expand Down

0 comments on commit 1fc8c78

Please sign in to comment.