diff options
author | Dave Whiteland <dave@mysociety.org> | 2014-06-10 16:08:11 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2014-06-10 16:08:11 +0100 |
commit | bae62db32ea92c535c4649630f07113c47206c8c (patch) | |
tree | 243493c6276bccf1c11256ad572fd5b600196b4a | |
parent | 02e9e6bb5f7fc73d30cbf8af5952be774d34cf3e (diff) |
add setting STAGING_SITE to dev/staging/production defs
this sets the production environment in Rails, nice to have this documented now :-)
-rw-r--r-- | customising/config.md | 22 | ||||
-rw-r--r-- | glossary.md | 14 |
2 files changed, 31 insertions, 5 deletions
diff --git a/customising/config.md b/customising/config.md index 259ba7f00..92eaf8bb6 100644 --- a/customising/config.md +++ b/customising/config.md @@ -637,15 +637,27 @@ THEME_URLS: <a name="staging_site"><code>STAGING_SITE</code></a> </dt> <dd> - Is this a staging or development site (1) or a live (production) site (0)? - This controls whether or not the <code>rails-post-deploy</code> script - will create the file <code>config/rails_env.rb</code> file to force + Is this a + <a href="{{site.baseurl}}glossary/#staging" class="glossary">staging</a> or + <a href="{{site.baseurl}}glossary/#development" class="glossary">development</a> site? + If not, it's a live <a href="{{site.baseurl}}glossary/#development" class="glossary">production</a> + site. This setting controls whether or not the <code>rails-post-deploy</code> + script will create the file <code>config/rails_env.rb</code> file to force Rails into production environment. <div class="more-info"> - <p>Example:</p> + <p>Examples:</p> <ul class="examples"> <li> - <code>STAGING_SITE: 1</code> + For staging or development: + <p> + <code>STAGING_SITE: 1</code> + </p> + </li> + <li> + For production: + <p> + <code>STAGING_SITE: 0</code> + </p> </li> </ul> </div> diff --git a/glossary.md b/glossary.md index e65586427..dbe6b8f71 100644 --- a/glossary.md +++ b/glossary.md @@ -121,6 +121,11 @@ Definitions users actually visit running with live data, or a <a href="#staging" class="glossary">staging server</a>, which is used for testing code before it goes live. + <p> + On your dev server, you should set + <code><a href="{{site.baseurl}}customising/config/#staging_site">STAGING_SITE</a></code> + to <code>1</code>. + </p> </dd> <dt> @@ -232,6 +237,10 @@ Definitions <p> Your production site should be configured to run as efficiently as possible: for example, caching is enabled, and debugging switched off. + <a href="#rails" class="glossary">Rails</a> has a "production mode" which does + this for you: set + <code><a href="{{site.baseurl}}customising/config/#staging_site">STAGING_SITE</a></code> + to <code>0</code>. <p> If you have a staging server, the system environment of your staging and production servers should be identical. @@ -338,6 +347,11 @@ Definitions <a href="#production" class="glossary">production server</a>, which is the site your users visit running with live data. <p> + On your staging server, you should set + <code><a href="{{site.baseurl}}customising/config/#staging_site">STAGING_SITE</a></code> + to <code>1</code>. + </p> + <p> If you have a staging server, the system environment of your staging and production servers should be identical. </p> |