Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Automate v2 deploy guard condition #260

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ChefDeprecations/LogResourceNotifications:
Exclude:
# The proposed replacement is available from Chef Infra Client 15.8.
# This cookbook supports 13.0 and up.
- 'test/fixtures/cookbooks/test/recipes/omnibus_service.rb'
2 changes: 1 addition & 1 deletion resources/automatev2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
execute "/usr/local/bin/chef-automate deploy #{Chef::Config[:file_cache_path]}/config.toml#{' --accept-terms-and-mlsa' if new_resource.accept_license}" do
cwd Chef::Config[:file_cache_path]
only_if { FileTest.file?("#{Chef::Config[:file_cache_path]}/config.toml") }
not_if 'chef-automate service-versions'
not_if '/usr/local/bin/chef-automate service-versions'
end

file "#{Chef::Config[:file_cache_path]}/custom_config.toml" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configure a custom repository setup recipe
node.normal['chef-ingredient']['custom-repo-recipe'] = 'custom_repo::awesome_custom_setup'
node.default['chef-ingredient']['custom-repo-recipe'] = 'custom_repo::awesome_custom_setup'

chef_ingredient 'chef-server' do
action :install
Expand Down
8 changes: 8 additions & 0 deletions test/integration/chef_automatev2/test_chef_automatev2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# its('exit_status') { should eq 0 }
# end

describe file('/usr/local/bin/chef-automate') do
it { should_not exist }
end

describe file('/usr/bin/chef-automate') do
it { should exist }
end

describe command('chef-automate version') do
its('exit_status') { should eq 0 }
end
Expand Down