witty-agent-59418
07/30/2024, 5:55 PM.pants.bootstrap
is that if it exists then pants will `source` it before running, and any env var exports from the bootstrap are available to running code.
I have .pants.bootstrap
that looks basically like this:
export ENV_FILE=".env.${ENV_NAME}"
source $FLWLS_ENV_FILE
An example .env.[name]
file looks like this:
AWS_DEFAULT_REGION="eu-west-1"
If I run pants it picks up .pants.bootstrap
and ENV_FILE
is populated (eg, usable with env.FOO
in pants but are populated, but AWS_DEFAULT_REGION
is not available with env.FOO
, nor in a target (python) application when run.
If I source `.pants.bootstrap`from my terminal, then both ENV_FILE
and AWS_DEFAULT_REGION
are populatedcurved-manchester-66006
07/30/2024, 9:54 PMexport
here?
AWS_DEFAULT_REGION="eu-west-1"
witty-agent-59418
07/31/2024, 9:00 AMwitty-agent-59418
07/31/2024, 9:57 AMsource .pants.bootstrap
from a terminal then the variables from the env file do get populated (eg .pants.bootstrap
), which is honestly a little surprising, for the same reason you mentionedwitty-agent-59418
07/31/2024, 11:50 AMset -a;
source .env;
set +a
👍