I have a project whose Docker image takes a very l...
# general
a
I have a project whose Docker image takes a very long time to build, and is completely irrelevant for local development. Using
pants package ::
means it will always be built. Is it possible to centrally disable this target, such that it is never selected unless explicitly specified? This is to prevent all of my developers from having to use `
Copy code
pants --tag='-annoying_project' package ::
1
n
You can also configure
tag
in your pants.toml if you want
-annoying_project
to be the default, so that’d be one way to do it. Makes using
--tag
in the command line slightly more annoying those since you have to append to the list if you want to keep the defaults.
a
Hmm. Using
tag
in the pants.toml does allow me to avoid it on the command line. However, is it possible to override it on the command line? Using
pants --tag="annoying_project" package /path/to/annoying/project/Dockerfile
does not seem to build it either.
Nonetheless, your solution works as I can discard the tag in the default toml and ensure it is built in the ci-toml!
l
Morten, the docs indicate that supplying the tag arg several time like in
pants --tag='+type_checked,skip_lint' --tag='-integration_test' list ::
will add to the list. I think there will be a way to supply the whole list. Have you tried
--tag="[annoying_project]"
?
Looking in https://www.pantsbuild.org/docs/options#list-values about List options in general:
You can also leave off the
[]
to append elements.
so your cli argument is being added to the
-annoying_project
from pants.toml and the exclude is winning
actually looks like
--tag="['annoying_project']"
should do it
❤️ 1
a
I definitely missed the part about
[]
. That works!
🙌 1