Problems deploying Sinatra app to staging environment
- by chris
I have a small Sinatra app with both a staging and production environment on a single server with running Nginx. To deploy I am using Capistrano and capistrano-ext to easily deploy to different locations.
The problem that the staging environment always runs with the production configuration specified within the app.rb file.
configure :staging do
# staging settings
set :foo, "bar"
end
configure :production do
# prod settings
set :foo, "rab"
end
I have come to the conclusion that the capistrano :environment variable within the deploy.rb file doesn't config Sinatra in any way. I have also tried setting the ENV["RACK_ENV"] to "staging" to no avail.
config/deploy/staging.rb
server "10.10.100.16", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/staging.my_app"
set :environment, "staging"
set :env, "staging"
ENV["RACK_ENV"] = "staging"
Any ideas?