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

red-ghost-2220

07/07/2022, 9:33 PM
Hey, i've been using pants for a while and i'd like to use spring boot actuator for environment infos, in particular also the git commit hash of the build. i really don't want to use git hooks for this to avoid ongoing merge conflicts and also would like to avoid fishy scripts in my CI pipeline that do some arbitrary bash magic. my preferred solution would be to include this somehow in the pants package goal, where the commit hash is automatically derived during packaging and that's it. my idea would be to use a resource as a dependency of my pex target, generated by a dependency on experimental_shell_command that pushes the commit hash in the resource file. Not entirely sure whether this actually works, but was wondering if someone can suggest a better solution or if there's some out of the box solution i'm not aware of yet. cheers!
w

witty-crayon-22786

07/07/2022, 9:40 PM
@happy-kitchen-89482 added https://github.com/pantsbuild/pants/pull/15374 recently… the vast majority of it is not python specific, so further adapting it to this usecase might be a path forward
experimental_shell_command
wouldn’t have access to the
git
working copy, since it is run in a sandbox
h

happy-kitchen-89482

07/08/2022, 2:21 AM
I've written up some docs for that feature: https://github.com/pantsbuild/pants/pull/16092
This was a good reminder
r

red-ghost-2220

07/08/2022, 8:44 AM
awesome. basically that's exactly what i was looking for 😄 thx!
5 Views