Created
September 24, 2024 17:11
-
-
Save dcasati/35bbd47f9879c5a8c9345323e02bb876 to your computer and use it in GitHub Desktop.
Revisions
-
dcasati created this gist
Sep 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/bin/bash set -x # Set your ACR name and resource variables ACR_NAME="" SOURCE_RG_C1="<source-resource-group>" MyRegC1="<my-registry>" MyPipelineC1="<my-pipeline>" MyPipelineC1Run="<my-pipeline-run>" MyBlob="<my-storage-blob>" # Get all repositories (images) repositories=$(az acr repository list --name $ACR_NAME --output tsv) # Loop through each repository and list its tags for repo in $repositories; do tags=$(az acr repository show-tags --name $ACR_NAME --repository $repo --output tsv) for tag in $tags; do image_tag="$repo:$tag" printf "Running pipeline for Image: %-30s Tag: %-10s\n" "$repo" "$tag" # Run the pipeline with the specific artifact (image:tag) echo az acr pipeline-run create --resource-group $SOURCE_RG_C1 \ --registry $MyRegC1 \ --pipeline $MyPipelineC1 \ --name $MyPipelineC1Run \ --pipeline-type export \ --storage-blob $MyBlob \ --artifacts $image_tag \ --force-redeploy done done