Skip to content

Commit 886736a

Browse files
authored
Refactor webhook deployment parameters and update manifest retrieval in pushWebhookToAcr.sh (#1476)
1 parent 87a423a commit 886736a

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

deployment/mergebranch-webhook-deployment/ServiceGroupRoot/Parameters/ApplicationInsights.Parameters.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@
3131
"name": "ACR_NAME",
3232
"value": "__ACR_NAME__"
3333
},
34-
{
35-
"name": "WEBHOOK_RELEASE",
36-
"value": "__WEBHOOK_RELEASE__"
37-
},
3834
{
3935
"name": "WEBHOOK_IMAGE_FULL_PATH",
40-
"value": "public/azuremonitor/applicationinsights/__WEBHOOK_RELEASE__:__SOURCE_IMAGE_TAG__"
36+
"value": "public/azuremonitor/applicationinsights/aiprod:__SOURCE_IMAGE_TAG__"
4137
},
4238
{
4339
"name": "SOURCE_IMAGE_TAG",

deployment/mergebranch-webhook-deployment/ServiceGroupRoot/ScopeBindings/Public.ScopeBindings.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
"find": "__ACR_NAME__",
1010
"replaceWith": "$(ACRName)"
1111
},
12-
{
13-
"find": "__WEBHOOK_RELEASE__",
14-
"replaceWith": "$(WebhookRelease)"
15-
},
1612
{
1713
"find": "__MANAGED_IDENTITY__",
1814
"replaceWith": "$(ManagedIdentity)"

deployment/mergebranch-webhook-deployment/ServiceGroupRoot/Scripts/pushWebhookToAcr.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ set -e
33

44
# Note - This script used in the pipeline as inline script
55

6-
if [ -z $WEBHOOK_RELEASE ]; then
7-
echo "-e error WEBHOOK_RELEASE shouldnt be empty. check release variables"
8-
exit 1
9-
fi
10-
116
#Make sure that tag being pushed will not overwrite an existing tag in mcr
127
echo "Reading existing tags from MCR..."
138
#MCR_TAG_RESULT="{\"name\": \"azuremonitor/applicationinsights/aiprod\", \"tags\": []}"
@@ -75,8 +70,10 @@ else
7570
fi
7671

7772
# Get manifest details
78-
echo "Getting manifest details for source image: $SOURCE_IMAGE_FULL_PATH"
79-
MANIFEST_JSON=$(docker manifest inspect $SOURCE_IMAGE_FULL_PATH)
73+
MANIFEST_PATH="https://mcr.microsoft.com/v2/azuremonitor/applicationinsights/aidev/manifests/$TAG"
74+
echo "Getting manifest details for source image: $SOURCE_IMAGE_FULL_PATH from $MANIFEST_PATH"
75+
76+
MANIFEST_JSON=$(curl -H "Accept: application/vnd.docker.distribution.manifest.list.v2+json" $MANIFEST_PATH)
8077
echo "Manifest: $MANIFEST_JSON"
8178

8279
# Extract the mediaType
@@ -86,7 +83,7 @@ echo "Media Type: $MEDIA_TYPE"
8683
if [[ "$MEDIA_TYPE" == "application/vnd.docker.distribution.manifest.list.v2+json" ]]; then
8784
echo "The image is multi-architecture, continuing with retagging and pushing..."
8885
else
89-
echo "The image is single-architecture, something has to be wrong. Exiting..."
86+
echo "The image is single-architecture or could not be checked, something has to be wrong. Exiting..."
9087
exit 1
9188
fi
9289

0 commit comments

Comments
 (0)