Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 8015 (#39536)
Browse files Browse the repository at this point in the history
* Use different service connection and az CLI for ACR auth

* displayName

---------

Co-authored-by: Daniel Jurek <djurek@microsoft.com>
  • Loading branch information
azure-sdk and danieljurek authored Apr 4, 2024
1 parent e9854e5 commit 83e3c77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 14 additions & 10 deletions eng/common/pipelines/templates/steps/docker-pull-image.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
parameters:
- name: ContainerRegistryClientId
type: string
- name: ContainerRegistryClientSecret
- name: ServiceConnectionName
type: string
default: azuresdkimages_container-registry
- name: ImageId
type: string
steps:
- pwsh: |
$containerRegistry = ("${{parameters.ImageId}}" -split "\/")[0]
docker login $containerRegistry -u "${{ parameters.ContainerRegistryClientId }}" -p "${{ parameters.ContainerRegistryClientSecret }}"
displayName: Login container registry
- pwsh: |
docker pull '${{ parameters.ImageId}}'
displayName: Pull docker image ${{ parameters.ImageId }}
- task: AzureCLI@2
displayName: Docker Auth and Pull
inputs:
azureSubscription: ${{ parameters.ServiceConnectionName }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
# azuresdkimages.azurecr.io/pyrefautocr:latest -> azuresdkimages
$containerRegistryName = ("${{ parameters.ImageId }}" -split "\/")[0].Replace(".azurecr.io", "")
az acr login --name $containerRegistryName
docker pull '${{ parameters.ImageId }}'
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ steps:
- ${{ if ne(parameters.DocValidationImageId, '') }}:
- template: /eng/common/pipelines/templates/steps/docker-pull-image.yml
parameters:
ContainerRegistryClientId: $(azuresdkimages-cr-clientid)
ContainerRegistryClientSecret: $(azuresdkimages-cr-clientsecret)
ImageId: '${{ parameters.DocValidationImageId }}'
- pwsh: |
$packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"').Replace("\\", "/")
Expand Down

0 comments on commit 83e3c77

Please sign in to comment.