Forum: Rails deployment authentic staging environment

Posted by Zac Zheng (zaczheng)
on 2009-12-09 14:14
I want to create an authentic staging environment where it will function
precisely as it does in the production environment.

Given some plugins, e.g. asset packager, will behave differently if it's
not in 'production' environment, I figure it's best to run the staging
server in 'production' as well, rather than creating a new 'staging'
environment. Is this the correct way of doing this?

If so however, the staging server does need a slightly different
configuration in order to communicate differently to the email server. I
am having difficulty thinking of a way of doing this if they are both in
'production' environment.

I thought perhaps I could set another variable in mod_rails which can be
picked up in Rails. Though having scanned the documentation nothing
obvious sticks out.

Any advice is greatly appreciated.
Posted by Max Williams (max-williams)
on 2009-12-18 17:43
A staging site is a very good idea: however you should have it on a 
different server with the same setup as your production server, since 
you're inevitable going to be stopping and restarting it a lot and this 
will affect the performance of your live site (not to mention make it 
break completely when you restart nginx/apache/whatever) if they're 
sitting on the same box.  It should run in production as you say.
Posted by Zac Zheng (zaczheng)
on 2009-12-19 16:30
Thanks for the reply. They are indeed on separate servers.

I ended using these environment names:
development_server - to differentiate from 'development' which is used 
locally
staging
production

I added 'staging' to merged_environments for asset_packager so that it 
merges asset files(js/css) on 'staging', using this:

Synthesis::AssetPackage.merge_environments = ["staging", "production"]


Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.