What’s the best way to do a post-deploy action? Sp...
# general
r
What’s the best way to do a post-deploy action? Specifically, I’ve got some docker containers I build. For some of them I’d want to also trigger a kubernetes restart for some test pods that I have on ‘latest’ and would like to see pick up the newly-deployed image. As I do partial builds using --changed-since, I never know what, if any, docker files will be touched in a given PR. I suspect the answer lies in making a new kind of target like a
kube_test_environment
that depends on the
docker_image
, or extending the
docker_image
target with a new field. But I’m so new to extending Pants that I’m kinda at a loss for how best to build this. Any hints would be much appreciated. (I’m quite comfortable writing the plugin and making a PR to get it into the official repo if this is a generally useful thing.)
h
Hmm, I don't think we have something out of the box right now, but this kind of use case comes up from time to time, and we really should have a good solution for it. A similar use case people ask about is pre-test actions, such as setting up a database.
As is often the case with Pants, the challenge is mostly how to model this, the implementation might not be hard.
I think a github discussion might be a good next step
For example, if
kube_test_environment
depends on
docker_image
then which of them do you run
deploy
on?
I think we can leverage the adhoc_tool work here