Skip to content

Commit

Permalink
Manage database.yml/memcached.yml when a host is given.
Browse files Browse the repository at this point in the history
  • Loading branch information
githuesch committed Feb 4, 2014
1 parent 729aa19 commit 9e25ba1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deploy/definitions/opsworks_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
)

only_if do
node[:opsworks][:layers].has_key?('db-master')
deploy[:database][:host].present?
end
end.run_action(:create)
elsif deploy[:application_type] == 'php'
Expand Down
2 changes: 1 addition & 1 deletion deploy/definitions/opsworks_rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
variables(:memcached => (deploy[:memcached] || {}), :environment => deploy[:rails_env])

only_if do
node[:opsworks][:layers].has_key?('memcached')
deploy[:memcached][:host].present?
end
end

Expand Down
4 changes: 2 additions & 2 deletions rails/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
notifies :run, "execute[restart Rails app #{application}]"

only_if do
node[:opsworks][:layers].has_key?('db-master') && File.exists?("#{deploy[:deploy_to]}") && File.exists?("#{deploy[:deploy_to]}/shared/config/")
deploy[:database][:host].present? && File.exists?("#{deploy[:deploy_to]}") && File.exists?("#{deploy[:deploy_to]}/shared/config/")
end
end

Expand All @@ -41,7 +41,7 @@
notifies :run, "execute[restart Rails app #{application}]"

only_if do
node[:opsworks][:layers].has_key?('memcached') && File.exists?("#{deploy[:deploy_to]}") && File.exists?("#{deploy[:deploy_to]}/shared/config/")
deploy[:memcached][:host].present? && File.exists?("#{deploy[:deploy_to]}") && File.exists?("#{deploy[:deploy_to]}/shared/config/")
end
end
end

0 comments on commit 9e25ba1

Please sign in to comment.