-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feature Request - ng deploy to read firebaseProject from .env vars #2482
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
Comments
Would this already help you? In my project I am having a npm command like |
Of course, the above method would work, although this is more about consistency and working in teams. If large teams are working on the same monorepo, they may want to use multiple different development server environments (think building a branch or unreleased version). Currently, each team or member would have to make their own edits to package.json or angular.json to specify which development env they want to use. If this change was accidentally committed to git, wouldn't be great. Hence the preference for files ( In NRWL NX monorepo, for example, whenever you use You may be able to achieve something like this with NPM scripts as well, but some may prefer to use the For these reasons, I think it would be beneficial to allow some kind of config to be read that isn't checked into version control, which is usually the |
project is now an option in angular.json for the schematic |
So this is related to a PR I submitted recently, #2366 - I realised that there's a further feature possibly needed - let me know what you think.
I've realised that as well as being able to specify a firebaseProject, it should also be possible to configure it via environment. You might have several deploy configurations, one for development, one for staging, one for production. Although the firebaseProject for production will likely be the same between different environments, the development firebaseProject may differ between different internal teams. This can be problematic because atm, you'd have to change the firebaseProject target in angular.json which is usually checked into version control.
One way I thought about doing it was as follows:
"firebaseProject": "$staging_env"
<-- if a$
is detected as the first char, the builder knows that its a shell variable namedotenv
sconfig()
first to read any.env
found intoprocess.env
.process.env.staging_env
as thefirebaseProject
.Although this method seems simple, I'm not overly fond of it because it feels like a hack.
Another way would be to make it an object, like this
"firebaseProject": { "environmentVariable": "$staging_env"}
That seems annoyingly verbose, but a much more robust and clean way of doing it.
The text was updated successfully, but these errors were encountered: