From: Daniel Stone Date: Mon, 24 Aug 2020 19:40:49 +0000 (+0100) Subject: CI: Windows: Use separate config file for Docker X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2808108e8052efc7c51236117155e7478464c8b;p=mesa.git CI: Windows: Use separate config file for Docker Rather than relying on global state for 'docker login' credentials, use a local file so we don't collide with other simultaneous builds. Signed-off-by: Daniel Stone Reviewed-by: Erik Faye-Lund Part-of: --- diff --git a/.gitlab-ci/windows/mesa_container.ps1 b/.gitlab-ci/windows/mesa_container.ps1 index c688451983f..7a2f6c2378b 100644 --- a/.gitlab-ci/windows/mesa_container.ps1 +++ b/.gitlab-ci/windows/mesa_container.ps1 @@ -9,28 +9,28 @@ $registry_central_image = $args[4] Set-Location -Path ".\.gitlab-ci\windows" -docker login -u "$registry_username" -p "$registry_password" "$registry_uri" +docker --config "windows-docker.conf" login -u "$registry_username" -p "$registry_password" "$registry_uri" if (!$?) { Write-Host "docker login failed to $registry_uri" Exit 1 } # if the image already exists, don't rebuild it -docker pull "$registry_user_image" +docker --config "windows-docker.conf" pull "$registry_user_image" if ($?) { Write-Host "User image $registry_user_image already exists; not rebuilding" - docker logout "$registry_uri" + docker --config "windows-docker.conf" logout "$registry_uri" Exit 0 } # if the image already exists upstream, copy it -docker pull "$registry_central_image" +docker --config "windows-docker.conf" pull "$registry_central_image" if ($?) { Write-Host "Copying central image $registry_central_image to user image $registry_user_image" - docker tag "$registry_central_image" "$registry_user_image" - docker push "$registry_user_image" + docker --config "windows-docker.conf" tag "$registry_central_image" "$registry_user_image" + docker --config "windows-docker.conf" push "$registry_user_image" $pushstatus = $? - docker logout "$registry_uri" + docker --config "windows-docker.conf" logout "$registry_uri" if (!$pushstatus) { Write-Host "Pushing image to $registry_user_image failed" Exit 1 @@ -39,17 +39,17 @@ if ($?) { } Write-Host "No image found at $registry_user_image or $registry_central_image; rebuilding" -docker build --no-cache -t "$registry_user_image" . +docker --config "windows-docker.conf" build --no-cache -t "$registry_user_image" . if (!$?) { Write-Host "Container build failed" - docker logout "$registry_uri" + docker --config "windows-docker.conf" logout "$registry_uri" Exit 1 } Get-Date -docker push "$registry_user_image" +docker --config "windows-docker.conf" push "$registry_user_image" $pushstatus = $? -docker logout "$registry_uri" +docker --config "windows-docker.conf" logout "$registry_uri" if (!$pushstatus) { Write-Host "Pushing image to $registry_user_image failed" Exit 1