Skip to content

Commit 3124037

Browse files
Zane/windows 2019 pipeline fix 4 (#1456)
* propagate docker build failure to azure cli * back to windows 1es hosted pool * throw docker build failure * use powershell * remove azure context setup * delete folder if exists * set up acr account for 2019 build * clean up and add AcceptableOutdatedSignatureInHours * switch pool
1 parent c802862 commit 3124037

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.pipelines/azure_pipeline_mergedbranches.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,20 +360,31 @@ extends:
360360
exit /B %ERRORLEVEL%
361361
displayName: 'build base'
362362
- task: AzureCLI@2
363-
displayName: "Docker windows build for ltsc2019"
363+
displayName: "Set up acr for windows ltsc2019 build"
364364
inputs:
365365
azureSubscription: ${{ variables.armServiceConnectionName }}
366366
scriptType: ps
367367
scriptLocation: inlineScript
368368
retryCountOnTaskFailure: 2
369369
inlineScript: |
370-
mkdir -p $(Build.ArtifactStagingDirectory)/windows
371-
cd kubernetes/windows
372370
az --version
373371
az account show
374372
az account set -s ${{ variables.subscription }}
375373
az acr login -n ${{ variables.containerRegistry }}
374+
- task: PowerShell@2
375+
inputs:
376+
targetType: 'inline'
377+
script: |
378+
# Check if directory exists and remove it before creating it to handle retry scenarios
379+
if (Test-Path -Path "$(Build.ArtifactStagingDirectory)/windows") {
380+
Remove-Item -Path "$(Build.ArtifactStagingDirectory)/windows" -Recurse -Force
381+
}
382+
New-Item -Path "$(Build.ArtifactStagingDirectory)/windows" -ItemType Directory -Force
383+
cd kubernetes/windows
384+
# Build the Docker image
376385
docker build --isolation=hyperv --tag ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2019BaseImageVersion)-unsigned --build-arg WINDOWS_VERSION=$(windows2019BaseImageVersion) --build-arg IMAGE_TAG=$(windowsTelemetryTag) --build-arg WINDOWS_AMA_URL=$(windowsAMAUrl) .
386+
displayName: "Docker windows build for ltsc2019"
387+
retryCountOnTaskFailure: 2
377388
- task: PowerShell@2
378389
displayName: Extract files to sign
379390
inputs:

0 commit comments

Comments
 (0)