Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding conditional docker restart #2219

Merged
5 commits merged into from
Nov 6, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions eng/common/testproxy/test-proxy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ steps:
$(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1
displayName: 'Language Specific Certificate Trust'

# windows has a startup bug where the service is unavailable. See Azure/azure-sdk-tools#2122
- pwsh: |
docker info

# if info failed, we need to restart the service and start docker desktop
if($LASTEXITCODE -ne 0)
{
# Ensure the service is running
Get-Service com.docker.service | Restart-Service

# Start docker desktop
$dockerExeLocation = (Get-Command docker).Source

# on windows, docker.exe is shipped here:
# C:\Program Files\Docker\Docker\resources\bin\docker.exe
# Docker desktop lives in the same base path, just up a couple levels:
# C:\Program Files\Docker\Docker\Docker Desktop.exe
$dockerDesktopLocation = Resolve-Path (Join-Path -Path $dockerExeLocation -ChildPath "../../../Docker Desktop.exe")
&$dockerDesktopLocation
}
condition: and(succeededOrFailed(), eq(variables['Agent.OS'],'Windows_NT'))

- pwsh: |
$(Build.SourcesDirectory)/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}"
displayName: 'Run the docker container'
Expand Down