aztfmod / rover

The rover is a docker container in charge of the deployment of the Terraform platform engineering for Azure
MIT License
175 stars 147 forks source link

CAF variables in resource tags #99

Closed LaurentLesle closed 3 years ago

LaurentLesle commented 3 years ago

When deploying a landing zone with the rover, the rover injects it docker tag. This issue add the following variables to be added as tags on the resource groups

caf_environment  # Define the CAF environment of the launchpad
caf_landingzone # Define the name of the landingzone
caf_level               # Define the level of the deployment
caf_rover_verion  # Version of the rover
caf_landingzone_version  # set the repo and tag of the landingzones             
caf_configuration_version # set the repo and tag pf the configuration repository

Proposed implementation

tag, branch names can be retrieved from - looks like cover all scenarios

TAG_BRANCH=$(git describe --all --exact-match 2>/dev/null | sed 's=.*/==')
LOCAL_BRANCH=master
TRACKING_REMOTE=$(git config branch.$LOCAL_BRANCH.remote)
REMOTE_URL=$(git config remote.$TRACKING_REMOTE.url)

caf_landingzone_version="${TAG_BRANCH}@${REMOTE_URL}"
echo $caf_landingzone_version

image

Cross-ref #89

LaurentLesle commented 3 years ago

Next rover release to support rover images in private registry with vscode