I have a release-pipeline that deploys builds. It's set to run after the build finishes. Builds have a BuildNumber that includes the product version number. I want to only deploy zero builds that have a version number ending with .0
I tried adding a Stage with a Powershell task that checks the version number and fails if it's not a zero build. I also tried to add a gate to the deployment stage that also checks the version number.
Both of these ways of checking result in the release-pipeline failing, and I get an email telling me it's failed.
How can I make the release-pipeline succeed, but do nothing for non-zero builds?
The powershell was:
if ( "$(Release.Artifacts._TheBuild.BuildNumber)" -like ".0 " )
{
exit 0
}
else
{
exit 1
}
The gate calls out to an azure function and passes $(Release.Artifacts._TheBuild.BuildNumber) as an argument. The azure function returns json with a status of true or false depending on whether the version number ends with zero. The gate evaluates this immediately, has the minimum retry and timeout of 5 and 6 minutes respectively.
.0
as per your conditions this will satisfy and fails the release. Also could you please share the powershell scripts, and gate deployment you tried so far – Jayendran