I just worked through this on CircleCI. The vast m...
# general
c
I just worked through this on CircleCI. The vast majority of the problem is working with your specific CI/CD platform, since pants seems to handle all of what needs to be done with a single command--at least in my simple case 🙂 For me that command was:
./pants bundle setup-py docker-publish --setup-py-run="bdist_wheel" --changed-parent=HEAD~1
I believe the bundle goals is implied by the latter, but it works. The trick I needed was adding the
--changed-parent=HEAD~1
flag to build only those targets that changed since the last commit. Before I run the command above, I run
printf "Targets: %s\n" "$(./pants list --changed-parent=HEAD~1 2>&1)"
so that I can visually log the targets that will run. I have an open question about the use of
--changed-parent=HEAD~1
, whereby if a team member pushes an unsquashed/unrebased set of commits, it seems that it might not pick up all the changes. I might look into enforcing this on the git side.