-
Notifications
You must be signed in to change notification settings - Fork 56
Use .env file for local setup #505
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
Conversation
@vikasrohit could you please, have a quick look at this PR before merging it. In case you see any downsides and just FYI as you are also running Project Service locally. |
@maxceem I am bit reluctant to have .env committed to the repo even though we have it excluded in .gitignore. I am kind of occupied with P0 things right now, so it might take few days to me to visit this again. |
# Conflicts: # package-lock.json
@vikasrohit I slightly changed README and removed I propose to merge this PR and give it a try unit someone commits Auth0 values. If we found that someone does it due to using Btw, even without this approach, we had Auth0 values committed a few times before. Maybe if we explicitly provide a place where to define them, i. e. |
# Conflicts: # package-lock.json
@vikasrohit could you, please, consider merging this PR again? I'd like to combine it with new demo data script #542 and update README to simplify local setup guide. |
@maxceem I don't see that .env is ignored in gitignore any more, I think we still need that so that accidentally people don't commit that file. |
@vikasrohit it has been already ignored since long time ago https://github.com/topcoder-platform/tc-project-service/blob/develop/.gitignore#L5. As I've been using such a file locally since long time ago. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is another step in making the local setup easier and reduce the mistakes which happen during local setup.
When we run Project Service locally we have to set environment variables for Auth0 two times:
docker-compose
npm run start:dev
It's very easy to forget to set them when restarting any of these commands.
docker-compose
with env variables may be time-consumingTo reduce the chances of such mistake, this PR introduces using
.env
file so the workflow of working locally would be like this:.env
file in the project root directory (once)docker-compose
ornpm run start:dev
values from.env
file would be always used. So even if we restart any of these commands in a new terminal window the values would be automatically used..env
file is ignored by Git