Is it possible to list all docker_image targets th...
# general
g
Is it possible to list all docker_image targets that would be impacted in change? In other words I want something like this:
Copy code
pants list --filter-target-type=docker_image --changed-since=origin/main ::
Is there any native functionality out of the box for selecting targets using this criteria?
I'm trying to guard against building a docker image if the files haven't changed.
This worked... Not sure why I was struggling.
Copy code
pants --changed-since=origin/main --filter-target-type=docker_image list
This actually doesn't work how I want it do... bummer.
My goal is that I want to determine if any direct or transitive first party dependency has changed so that I can trigger a docker container build. In other words, something like... pants dependencies --transitive //apps/my-api:docker and if any files changed
I think I want the intersection of
Copy code
pants --changed-since=origin/main list $target
and
Copy code
pants dependencies --transitive $target
but for every single docker_image target. Is this possible?
I found it...
Copy code
pants --changed-since=origin/main --changed-dependents=transitive --filter-target-type=docker_image list
b
I think people sometimes use two invocations too: e.g.
pants list ... | xargs pants list ...
or similar. (Although seems like you've found one that works for this. 👍 )