Forum Discussion
Dashers
Oct 07, 2024Copper Contributor
Azure DevOps git tag release pipeline
I'm wanting to get an Azure DevOps Pipeline (Classic) to run on a schedule against a Git Tag. This tag is set by a CD pipeline to mark when it has been deployed in the live environment. The scenari...
balasubramanim
Oct 07, 2024Iron Contributor
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. Build GitHub repositories - Azure Pipelines | Microsoft Learn