https://pantsbuild.org/ logo
#general
Title
# general
s

silly-queen-7197

02/14/2023, 11:53 PM
Can I expect the syntax
extra_build_args=['FURY_AUTH=%(env.FURY_AUTH)s']
to work in a
BUILD
file, I'm trying to create a Docker image target. I can do
Copy code
[docker]
build_args = ['FURY_AUTH=%(env.FURY_AUTH)s']
in
pants.toml
but I haven't had any luck figuring out the corresponding syntax in a
BUILD
file.
b

broad-processor-92400

02/15/2023, 12:06 AM
On new-enough versions (>= 2.16.0dev5), I think you can do something like
extra_build_args=[f"FURY_AUTH='{env('FURY_AUTH')}']
using the new
env()
build-file function. https://github.com/pantsbuild/pants/blob/main/docs/markdown/Using%20Pants/concepts/targets.md#environment-variables That's not too helpful for earlier versions, though
👍 1
s

silly-queen-7197

02/15/2023, 12:09 AM
Thanks! That's good to know
t

thousands-plumber-33255

02/15/2023, 6:46 AM
Is this example what you are looking for?
👍 1
2 Views