From 430d36e84bd55d6c6d9e2380dfe4c75256e36d31 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Mon, 1 Nov 2021 16:31:20 -0700 Subject: [PATCH] Use docker to do package validation. --- .../templates/steps/docker-pull-image.yml | 15 +++++++++++++++ eng/common/scripts/Update-DocsMsPackages.ps1 | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 eng/common/pipelines/templates/steps/docker-pull-image.yml diff --git a/eng/common/pipelines/templates/steps/docker-pull-image.yml b/eng/common/pipelines/templates/steps/docker-pull-image.yml new file mode 100644 index 000000000000..fa22df31974b --- /dev/null +++ b/eng/common/pipelines/templates/steps/docker-pull-image.yml @@ -0,0 +1,15 @@ +parameters: + - name: ContainerRegistryClientId + type: string + - name: ContainerRegistryClientSecret + type: string + - 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 }} diff --git a/eng/common/scripts/Update-DocsMsPackages.ps1 b/eng/common/scripts/Update-DocsMsPackages.ps1 index 7b957c884765..e9ede6161be6 100644 --- a/eng/common/scripts/Update-DocsMsPackages.ps1 +++ b/eng/common/scripts/Update-DocsMsPackages.ps1 @@ -24,13 +24,20 @@ docs generation from pacakges which are not published to the default feed). This variable is meant to be used in the domain-specific business logic in &$UpdateDocsMsPackagesFn +.PARAMETER ImageId +Optional The docker image for package validation in format of '$containerRegistry/$imageName:$tag'. +e.g. azuresdkimages.azurecr.io/jsrefautocr:latest + #> param ( [Parameter(Mandatory = $true)] [string] $DocRepoLocation, # the location of the cloned doc repo [Parameter(Mandatory = $false)] - [string] $PackageSourceOverride + [string] $PackageSourceOverride, + + [Parameter(Mandatory = $false)] + [string] $ImageId ) . (Join-Path $PSScriptRoot common.ps1)