Is there a way within `pants.toml` to specify a de...
# general
h
Is there a way within
pants.toml
to specify a default for an env var if it's not set in the caller's environment?
It seems like I could potentially get this with interpolation, but I'm not sure how powerful that syntax is.
a
It depends on which env variable you are looking at here. As for
GLOBAL
scope, you can get a list of variables available to set by running
./pants help-advanced global
h
Actually, turns out it doesn't matter for the specific case I was trying to do! I'm using the
[docker].env_vars
and that doesn't care whether env vars are set in the user environment or not.
a
For Docker, you can set the env variables in Dockerfile itself.
h
That's not what I'm trying to do.
I need the
[docker].env_vars
so that the docker invocation is modified with the env vars I want.
This allows me to use the same pants command to push images into my minikube cluster using this method
r
w
I think a
pants.ci.toml
with overrides is what you'd use for CI, a
.pantsrc
for local overrides of the "main"
pants.toml
I.e instead of providing default env values, you create a separate override config that requires those env values, and write the defaults in
pants.toml
h
Yeah, makes sense for that use case. Turns out for what I was doing, it's fine if the variables aren't set in the environment with the
env_vars
option.