-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eng/common directory with azure-sdk-tools for PR 8015 (#39536)
* Use different service connection and az CLI for ACR auth * displayName --------- Co-authored-by: Daniel Jurek <djurek@microsoft.com>
- Loading branch information
1 parent
e9854e5
commit 83e3c77
Showing
2 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
24 changes: 14 additions & 10 deletions
24
eng/common/pipelines/templates/steps/docker-pull-image.yml
This file contains 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 characters
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 }}' |
This file contains 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 characters