Open cburroughs opened 10 months ago
Is your feature request related to a problem? Please describe.
As described in https://www.pantsbuild.org/docs/tagging-docker-images#using-env-vars-to-include-dynamic-data-in-tags I'd like common dynamic git data like the sha or branch name to be available in BUILD files so they can be used to construct docker tags and other versioned fields.
Describe the solution you'd like
An object (git?) available with properties like commit_id or branch_name.
git
commit_id
branch_name
Describe alternatives you've considered Fork off a bunch of processes in a shell as described in https://github.com/pantsbuild/pants/discussions/17633
Additional context
src/python/pants/vcs/git.py
we can expose symbols in BUILD files with def build_file_aliases(): in a register.py. I'm not sure if we can invoke rules within that context, though.
def build_file_aliases():
register.py
Is your feature request related to a problem? Please describe.
As described in https://www.pantsbuild.org/docs/tagging-docker-images#using-env-vars-to-include-dynamic-data-in-tags I'd like common dynamic git data like the sha or branch name to be available in BUILD files so they can be used to construct docker tags and other versioned fields.
Describe the solution you'd like
An object (
git
?) available with properties likecommit_id
orbranch_name
.Describe alternatives you've considered Fork off a bunch of processes in a shell as described in https://github.com/pantsbuild/pants/discussions/17633
Additional context
src/python/pants/vcs/git.py
, but I couldn't figure out anyway to make that available in build files