Skip to content

Commit 36bcca3

Browse files
Refactor validation script for ai_prod commit tagging checks (#1566)
* Refactor validation script to enable commit tagging checks for ai_prod branch * Fix image tag format in validation pipeline for consistency --------- Co-authored-by: rambhatt <rambhatt@microsoft.com>
1 parent ec2d8e4 commit 36bcca3

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

.pipelines/azure_pipeline_validation_appmonitoring.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
imageTag: $[ dependencies.common.outputs['setup.imageTag'] ]
9797
testImageTagSuffix: $(imageTag)-$(Build.BuildId)
9898
testImageName: ${{ variables.repoTestImageName }}:${{ variables.testImageTagSuffix }}
99-
fullImageName: ${{ variables.repoImageName }}:$(imageTag)-rc-$(Build.BuildId)
99+
fullImageName: ${{ variables.repoImageName }}:$(imageTag)-rc.$(Build.BuildId)
100100
# This is necessary because of: https://github.com/moby/moby/issues/37965
101101
DOCKER_BUILDKIT: 1
102102

.pipelines/azure_pipeline_validation_appmonitoring_extension.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -469,23 +469,23 @@ jobs:
469469
scriptType: bash
470470
scriptLocation: inlineScript
471471
inlineScript: |
472-
# # Check if current commit is tagged and branch is ai_prod
473-
# CURRENT_BRANCH="$BUILD_SOURCEBRANCHNAME"
474-
# echo "Current branch is: $CURRENT_BRANCH"
475-
# if git describe --exact-match --tags >/dev/null 2>&1 && [ "$CURRENT_BRANCH" = "ai_prod" ]; then
476-
# echo "Current commit is tagged with: $(git describe --exact-match --tags) and branch is ai_prod."
477-
# else
478-
# if [ "$CURRENT_BRANCH" != "ai_prod" ]; then
479-
# echo "Current branch is not ai_prod. Cannot publish from another branch"
480-
# echo "##vso[task.logissue type=warning]Current branch is not ai_prod. YOU CANNOT RELEASE WITH THIS BUILD."
481-
# echo "##vso[task.complete result=SucceededWithIssues;]Cannot Publish with a branch other than ai_prod. Exiting...."
482-
# else
483-
# echo "Current commit is not tagged."
484-
# echo "##vso[task.logissue type=warning]Current commit is not tagged. YOU CANNOT RELEASE WITH THIS BUILD and we also cannot publish images without a tagged commit on ai_prod. Please tag this commit with the appropriate semver value and format."
485-
# echo "##vso[task.complete result=SucceededWithIssues;]Cannot Publish with Untagged Commits. Exiting...."
486-
# fi
487-
# exit 0
488-
# fi
472+
# Check if current commit is tagged and branch is ai_prod
473+
CURRENT_BRANCH="$BUILD_SOURCEBRANCHNAME"
474+
echo "Current branch is: $CURRENT_BRANCH"
475+
if git describe --exact-match --tags >/dev/null 2>&1 && [ "$CURRENT_BRANCH" = "ai_prod" ]; then
476+
echo "Current commit is tagged with: $(git describe --exact-match --tags) and branch is ai_prod."
477+
else
478+
if [ "$CURRENT_BRANCH" != "ai_prod" ]; then
479+
echo "Current branch is not ai_prod. Cannot publish from another branch"
480+
echo "##vso[task.logissue type=warning]Current branch is not ai_prod. YOU CANNOT RELEASE WITH THIS BUILD."
481+
echo "##vso[task.complete result=SucceededWithIssues;]Cannot Publish with a branch other than ai_prod. Exiting...."
482+
else
483+
echo "Current commit is not tagged."
484+
echo "##vso[task.logissue type=warning]Current commit is not tagged. YOU CANNOT RELEASE WITH THIS BUILD and we also cannot publish images without a tagged commit on ai_prod. Please tag this commit with the appropriate semver value and format."
485+
echo "##vso[task.complete result=SucceededWithIssues;]Cannot Publish with Untagged Commits. Exiting...."
486+
fi
487+
exit 0
488+
fi
489489
490490
az --version
491491
az account show

0 commit comments

Comments
 (0)