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

environment specific configuration #40

Closed
morenoh149 opened this issue Apr 7, 2014 · 10 comments
Closed

environment specific configuration #40

morenoh149 opened this issue Apr 7, 2014 · 10 comments

Comments

@morenoh149
Copy link

vote for adding support for environment configurations. Serious applications usually have development, staging and production environments to roll out new features.
http://newtriks.com/2013/11/29/environment-specific-configuration-in-angularjs-using-grunt/

@didlich
Copy link

didlich commented Apr 8, 2014

+1

@jimthedev
Copy link
Contributor

Can you go into some detail on what kind of things in the project you'd like to see happening in prod vs development environments? I like this but the environments are very specific to the environments of the generating user. At best we could have, say, prod and dev to start, then have instructions for adding/modifying environments if someone wants to add another environment (staging). I'm just trying to judge exactly what use case these environment variables should serve vs the environment hook mentioned in Issue #72. I feel like if this is implemented then there'd need to be some cohesion between cordova hooks and the build tool config.

@diegonetto
Copy link
Owner

I've given this some thought, and since Ionic uses angular, it might make sense to have an app/scripts/config.js file that gets automatically built by Grunt. This would eliminate the need for the after_prepare hook described in #72 that replaces tokens in files. It would also be a more automated solution.

I am experimenting with grunt-ng-constant for this feature.

@diegonetto
Copy link
Owner

@morenoh149 @jimthedev I finally ran into the need for this on my latest Ionic project, so I've gone ahead and added this feature to the generator. See the docs here - https://github.com/diegonetto/generator-ionic#environment-specific-configuration

Thanks, and happy coding :)

@chandramuralis
Copy link
Contributor

Hi @diegonetto,
This link https://github.com/diegonetto/generator-ionic#environment-specific-configuration doesn't seems to be active now, could you please point to the latest url?

@jimthedev
Copy link
Contributor

@chandramuralis
Copy link
Contributor

@jimthedev thanks. If possible please update this URL in the gruntfile.

@jimthedev
Copy link
Contributor

@chandramuralis Would you be willing to make this change via a pull request? It is pretty easy, you can just follow these steps.

  1. Go to https://github.com/diegonetto/generator-ionic/blob/master/templates/common/Gruntfile.js
  2. Click the little pencil icon at the top of the file to bring you to the propose changes screen.
  3. Change line 32 to the correct url: https://github.com/diegonetto/generator-ionic/blob/master/docs/FAQ.md#how-do-i-add-constants

This will fork the repo and put in a pull request so that Diego can accept it.

Thanks!

@chandramuralis
Copy link
Contributor

@jimthedev Done and submitted pull request #155
Thanks for the steps, otherwise I would've asked another question.

@jimthedev
Copy link
Contributor

@chandramuralis My pleasure. Thanks for being an open source contributor!

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

No branches or pull requests

5 participants