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

narrow-activity-17405

09/15/2022, 5:57 AM
Is there a way how, within a CI, to trigger a build of docker images whose dependencies have changed? I mean - I would like my CI to build an image if Python sources that are going to be copied into it (as a PEX file) or a Dockerfile were changed. Something like
./pants --changed-since=origin/master --changed-dependees=transitive test
but for building images 🙂
2
b

bitter-ability-32190

09/15/2022, 6:32 AM
You're almost there! Instead of
test
use
build
. And then you also need a
--filter-target-type=docker_image
and I think that ought to do it!
n

narrow-activity-17405

09/15/2022, 6:40 AM
Ok, that was easier than expected, thanks for the hint 😄 It seems that
./pants --filter-target-type=docker_image --changed-since=origin/master --changed-dependees=transitive package
works...
💯 1
h

hundreds-father-404

09/15/2022, 3:18 PM
yay! that's new to 2.13 that you can use
--filter
from anywhere, that makes me happy
👍 1
b

bitter-ability-32190

09/15/2022, 3:19 PM
FWIW those are "global" flags, so valid for almost every goal.