[main] Update common Docker engineering infrastructure with latest (#5570)

This commit is contained in:
dotnet-docker-bot 2024-06-18 09:27:33 -05:00 коммит произвёл GitHub
Родитель 2a9f371c41
Коммит 8e0cd566ea
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -88,23 +88,29 @@ jobs:
condition: eq(variables.imageBuilderBuildArgs, '')
displayName: Initialize Image Builder Build Args
- powershell: |
New-Item -Path $(imageInfoHostDir) -ItemType Directory -Force
# Reference the existing imageBuilderBuildArgs variable as an environment variable rather than injecting it directly
# with the $(imageBuilderBuildArgs) syntax. This is to avoid issues where the string may contain single quotes $ chars
# which really mess up assigning to a variable. It would require assigning the string with single quotes but also needing
# to escape the single quotes that are in the string which would need to be done outside the context of PowerShell. Since
# all we need is for that value to be in a PowerShell variable, we can get that by the fact that AzDO automatically creates
# the environment variable for us.
New-Item -Path $(imageInfoHostDir) -ItemType Directory -Force
$imageBuilderBuildArgs = "$env:IMAGEBUILDERBUILDARGS $(imageBuilder.queueArgs) --image-info-output-path $(imageInfoContainerDir)/$(legName)-image-info.json"
if ($env:SYSTEM_TEAMPROJECT -eq "${{ parameters.internalProjectName }}" -and $env:BUILD_REASON -ne "PullRequest") {
$imageBuilderBuildArgs = "$imageBuilderBuildArgs --registry-override $(acr-staging.server) --repo-prefix $(stagingRepoPrefix) --source-repo-prefix $(mirrorRepoPrefix) --push"
}
if ($env:SYSTEM_TEAMPROJECT -eq "${{ parameters.publicProjectName }}" -and ${env:PUBLIC-MIRROR_SERVER} -ne "") {
$imageBuilderBuildArgs = "$imageBuilderBuildArgs --base-override-regex '^(?!mcr\.microsoft\.com)' --base-override-sub '$(public-mirror.server)/'"
}
# If the pipeline isn't configured to disable the cache and a build variable hasn't been set to disable the cache
if ("$(pipelineDisabledCache)" -ne "true" -and $env:NOCACHE -ne "true") {
$imageBuilderBuildArgs = "$imageBuilderBuildArgs --image-info-source-path $(versionsBasePath)$(imageInfoVersionsPath)"
}
echo "imageBuilderBuildArgs: $imageBuilderBuildArgs"
echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$imageBuilderBuildArgs"
displayName: Set Image Builder Build Args
- template: /eng/common/templates/steps/run-imagebuilder.yml@self

Просмотреть файл

@ -7,6 +7,6 @@ variables:
- name: dockerHubRegistryCreds
value: --registry-creds 'docker.io=$(dotnetDockerHubBot.userName);$(BotAccount-dotnet-dockerhub-bot-PAT)'
- group: DotNet-Docker-Common
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-Docker-Common
- group: DotNet-Docker-Secrets-WIF