Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Run migrations on deploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Mar 29, 2015
1 parent 5fa98f5 commit 3e58ed1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
module ApiUmbrella
class Application < Rails::Application
config.before_configuration do
default_config = "/opt/api-umbrella/var/run/runtime_config.yml"
if(ENV["API_UMBRELLA_CONFIG"].blank? && File.exist?(default_config) && File.readable?(default_config))
ENV["API_UMBRELLA_CONFIG"] = default_config
end

if(ENV["API_UMBRELLA_CONFIG"])
ApiUmbrellaConfig.add_source!(ENV["API_UMBRELLA_CONFIG"])
ApiUmbrellaConfig.reload!
Expand Down
2 changes: 1 addition & 1 deletion config/deploy/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

role :app, servers
role :web, servers
role :db, []
role :db, servers.first
2 changes: 1 addition & 1 deletion config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

role :app, servers
role :web, servers
role :db, []
role :db, servers.first
2 changes: 1 addition & 1 deletion config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

role :app, servers
role :web, servers
role :db, []
role :db, servers.first

0 comments on commit 3e58ed1

Please sign in to comment.