Setting the git rev-parse HEAD value as an environ...
# 🌱|help-and-getting-started
l
I've got 3 distinct repositories that make up my project as a whole. I want to have the ability to display the git hash on the dashboards for each of the 3 deployments, by running
git rev-parse HEAD
or equivalent and passing that on to the image being deployed. I'm not seeing a crystal clear path on doing that in just the
garden.yml
files, and wondering if anybody has a method of achieving that you wouldn't mind sharing.
b
@little-army-47606 You can use the template variable
${git.commitHash}
https://docs.garden.io/reference/template-strings/environments#usd-git.commithash Is this what you were looking for?
l
I tried setting an environment variable straight from this template variable and it doesn’t appear to work.
We've got one
project.garden.yml
file that builds out the required cluster specifications, and then 3 linked-repos that each have their own
garden.yml
file for Build and Deploy , specific to the requirements of each deployment's stack. We run the deploy action from the overall product directory, with each of the linked repos nested in
./services/project-name/
, each with their own individual commit hashes. It's those 3 commit hashes that I want to have environment variables for, each on their individual pods. So, for example,
api
has its own commit hash,
frontend
has its own commit hash, and
dashboard
has its own...