One more form me. My understanding of `.pants.boot...
# general
w
One more form me. My understanding of
.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:
Copy code
export ENV_FILE=".env.${ENV_NAME}"
source $FLWLS_ENV_FILE
An example
.env.[name]
file looks like this:
Copy code
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 populated
c
This is just me smashing at bash, but are you missing an
export
here?
Copy code
AWS_DEFAULT_REGION="eu-west-1"
w
No, because it's a .env file being loaded in applications/passed to docker
My confusion is that if I run
source .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 mentioned
I solved this with:
Copy code
set -a;
source .env;
set +a
👍
👍 1