Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new environment property to Plek #39

Closed
wants to merge 4 commits into from

Conversation

boffbowsh
Copy link
Contributor

Provides an easy way to identify the environment we’re currently
running under.

For backward compatibility purposes, what used to be “preview” (i.e.
preview.alphagov.co.uk) is now referred to as “integration” using
this API. This provides a stable value for any applications using this
new API without needing to be concerned about distinctions between
preview and the new integration environment.

/cc @alexmuller

Also included, making tests pass in Jenkins. Seems it's been a while since Plek development occurred.

Provides an easy way to identify the environment we’re currently
running under.

For backward compatibility purposes, what used to be “preview” (i.e.
`preview.alphagov.co.uk`) is now referred to as “integration” using
this API. This provides a stable value for any applications using this
new API without needing to be concerned about distinctions between
preview and the new integration environment.
@boffbowsh boffbowsh force-pushed the add-environment-property branch 4 times, most recently from f6ac729 to cafa85b Compare November 18, 2015 11:03
Use ClimateControl to stub the environment instead of directly
modifying the ENV hash. This allows the tests to be run in a random
order.
@mattbostock
Copy link
Contributor

I don't have strong opinions on this. We do however have an environment variable, ERRBIT_ENVIRONMENT_NAME, which is set in each environment appropriately. I wonder if we should create an environment variable for each piece of functionality that relies on the environment name, rather than have a generic variable, which can become difficult to manage.

@boffbowsh
Copy link
Contributor Author

I think managing and maintaining multiple vars per app might be worse, personally. Open to opinions from others.

@mattbostock
Copy link
Contributor

The reason being that if we have implicit dependencies on one environment variable, it can create additional complexity if the use case changes later. We've actively tried to reduce the use of such variables in our Puppet code base, for example.

@mattbostock
Copy link
Contributor

This better explains what I'm referring to:

http://12factor.net/config

Another aspect of config management is grouping. Sometimes apps batch config into named groups (often called “environments”) named after specific deploys, such as the development, test, and production environments in Rails. This method does not scale cleanly: as more deploys of the app are created, new environment names are necessary, such as staging or qa. As the project grows further, developers may add their own special environments like joes-staging, resulting in a combinatorial explosion of config which makes managing deploys of the app very brittle.

In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.

@boffbowsh
Copy link
Contributor Author

Closing in favour of a behaviour-specific variable.

@boffbowsh boffbowsh closed this Nov 18, 2015
@boffbowsh boffbowsh deleted the add-environment-property branch November 18, 2015 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants