Forum Discussion
Azure DevOps git tag release pipeline
Please try these steps.
1. Create a Build Pipeline:
Set up a build pipeline that runs on a schedule (daily, weekly, etc.).
In this pipeline, add a script to check if the specific Git tag exists.
2. Script to Check for the Git Tag:
Use a script task like this (for example, in Bash):
git fetch --tags
if git rev-parse "refs/tags/mytag" >/dev/null 2>&1; then
echo "Tag found, proceed with release."
exit 0
else
echo "Tag not found, stop pipeline."
exit 1
fi
3. Trigger a Release Pipeline:
In the release pipeline, use the output of the build pipeline (when the tag is found) as the trigger.
This release pipeline will redeploy the ARM templates or perform cleanup tasks.
4. Schedule the Pipeline:
Configure the build pipeline to run on a schedule, ensuring it checks for the tag regularly.
With this setup, the pipeline will only trigger the release if the specific Git tag is found during the scheduled run.
Reference URL:
1. https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#use-a-specific-checkout
2. https://learn.microsoft.com/en-us/azure/devops/pipelines/build/build-tag?view=azure-devops&tabs=azure-pipelines-ui