Switch to using a .env file for setting environment variables #107
Conversation
Codecov Report
@@ Coverage Diff @@
## master #107 +/- ##
=======================================
Coverage 46.29% 46.29%
=======================================
Files 13 13
Lines 270 270
Branches 30 30
=======================================
Hits 125 125
Misses 143 143
Partials 2 2 Continue to review full report at Codecov.
|
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.
Using a .env file seems to be almost equivalent to using the docker-compose environment directive. Am I missing something?
@maurodoglio it's equivalent, it's just easier to modify an .env file without worrying about accidentally committing stuff. |
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.
The approach seems fine in that ATMO is doing this, but see comment.
bin/build
Outdated
@@ -10,6 +10,8 @@ printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build | |||
"$CIRCLE_BUILD_URL" \ | |||
> version.json | |||
|
|||
cp .env-dist .env |
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.
This should probably be [ ! -f .env ] && cp .env-dist .env
. Additionally I don't think this needs to be part of the build step. ATMO has it as an instruction in the README (not ideal because it requires another manual step) and also in bin/test
but as I understand it this file is meant to be used by docker-compose and not as an artifact in the container. We should exclude it from being copied to the container if we want to keep it in the build script.
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.
@whd just to confirm, none of the variables in .env-dist would be applicable for a production deployment?
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.
Correct.
I noticed that @jezdez wants to move away from .env files in mozilla/telemetry-analysis-service#225. Maybe we should hold on on this? |
@maurodoglio As @whd pointed out above, we don't actually use the .env file in production so I don't see the issue here. In fact I would think that modifying the docker-compose file would be more of a security risk (since there's a chance of accidentally checking in aws credentials) |
I removed the changes to |
This allows us to modify variables for our development instance (e.g. to use production presto)
This allows us to modify variables for our development instance
(e.g. to use production presto)