Skip to content

Environment configuration management #927

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

Closed
jbouzekri opened this issue May 26, 2016 · 8 comments
Closed

Environment configuration management #927

jbouzekri opened this issue May 26, 2016 · 8 comments
Assignees

Comments

@jbouzekri
Copy link

It would be nice to have a way to manage different configuration parameters based on environment. It could allow to store things like api endpoints, ...

For example angular-cli override a environment.ts file based on the target environment.

@mgechev
Copy link
Owner

mgechev commented May 26, 2016

I am already doing this in a project where I am using the seed. I will try to push this feature upstream early next week.

@mgechev mgechev self-assigned this May 30, 2016
@btrajkovski
Copy link

Also it would be nice if we could dynamically add environments, and not be limited to just development and production.
I don't know your concrete implementation if you have this that is great, if not maybe this could a feature for some future release?

@mgechev
Copy link
Owner

mgechev commented Jun 2, 2016

I am thinking of only two build configurations - dev and prod like what we have now.

On top of that, we can have multiple configuration variables loaded dynamically from a JSON config files, located somewhere in the root. So npm run build.prod --env-config staging will run the prod build but set end points, settings, etc for the staging environment.

// cc @NathanWalker @d3viant0ne @ludohenin @TheDonDope

@TheDonDope
Copy link
Contributor

Hi,

@mgechev has a point; from a build technical perspective, a "development" build and a "production" build should be sufficient. But i agree too, any further environment specific environments (e.g. staging, integration ) could be provided for / configured through JSON config files. IMHO we should rough out a more specific concept for this (in the likes of #913), and then tacle it. Yet, i guess it would be preferable if we first finish up with the works on #913 (respectively #926) before we add / enhance on the environment configuration.

@mgechev
Copy link
Owner

mgechev commented Jun 5, 2016

@TheDonDope makes sense, lets hold it until #913 is resolved.

@mgechev
Copy link
Owner

mgechev commented Jun 22, 2016

Actually looking at my current solution I don't think we should add this to the seed at this point.

@jbouzekri my suggestion for managing configurations for different environments is to add plugin/task specific config in your project.config.ts file.

Let you can require this config using this call. You can store the entire configuration for all the different environments in JSON files, if you prefer.

Finally in your config.ts (or whatever you name it) which is part of your project, you can just insert the correct configuration based on the user choice using a template <%= CHOSEN_CONFIG %>. This is also supported by the seed.

@mgechev mgechev closed this as completed Jun 22, 2016
@jbouzekri
Copy link
Author

@mgechev : thanks. Too bad you won't add it to seed. I think it would be useful in a professional job environment to be able to manage this.

I have already implemented my own solution inspired by angular-cli where I deploy in dev or tmp folder an environment.ts file containing the configuration for my current environment target.

@mgechev
Copy link
Owner

mgechev commented Jun 22, 2016

Just for the record - the feature is implemented and waiting to be merged here #1026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants