From 88113bc0f0028f43196c0441e6be4551c025b110 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Tue, 6 Nov 2018 17:36:21 -0600 Subject: [PATCH] Remove use of workspace clean within builds as it is not reliable (#789) --- .vsts-pipelines/jobs/build-images.yml | 2 -- .vsts-pipelines/jobs/build-test-publish-repo.yml | 2 -- .vsts-pipelines/jobs/copy-images.yml | 2 -- .vsts-pipelines/jobs/publish-finalize.yml | 2 -- .vsts-pipelines/jobs/test-images-linux-client.yml | 2 -- .vsts-pipelines/jobs/test-images-windows-client.yml | 2 -- .vsts-pipelines/steps/cleanup-docker-windows.yml | 7 +++++++ .vsts-pipelines/steps/init-docker-windows.yml | 4 ++-- 8 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.vsts-pipelines/jobs/build-images.yml b/.vsts-pipelines/jobs/build-images.yml index f868a9ee21..18eb3dc192 100644 --- a/.vsts-pipelines/jobs/build-images.yml +++ b/.vsts-pipelines/jobs/build-images.yml @@ -12,8 +12,6 @@ jobs: pool: ${{ parameters.pool }} strategy: matrix: ${{ parameters.matrix }} - workspace: - clean: all variables: osVersion: ${{ parameters.osVersion }} steps: diff --git a/.vsts-pipelines/jobs/build-test-publish-repo.yml b/.vsts-pipelines/jobs/build-test-publish-repo.yml index e909c3570c..c82300d794 100644 --- a/.vsts-pipelines/jobs/build-test-publish-repo.yml +++ b/.vsts-pipelines/jobs/build-test-publish-repo.yml @@ -6,8 +6,6 @@ jobs: pool: # linuxAmd64Pool name: DotNet-Build demands: agent.os -equals linux - workspace: - clean: all steps: - template: ../steps/init-docker-linux.yml - script: $(runImageBuilderCmd) generateBuildMatrix --manifest $(manifest) --type build diff --git a/.vsts-pipelines/jobs/copy-images.yml b/.vsts-pipelines/jobs/copy-images.yml index 629ebe1e88..385c631802 100644 --- a/.vsts-pipelines/jobs/copy-images.yml +++ b/.vsts-pipelines/jobs/copy-images.yml @@ -34,8 +34,6 @@ jobs: pool: ${{ parameters.pool }} strategy: matrix: ${{ parameters.matrix }} - workspace: - clean: all variables: osVersion: ${{ parameters.osVersion }} architecture: ${{ parameters.architecture }} diff --git a/.vsts-pipelines/jobs/publish-finalize.yml b/.vsts-pipelines/jobs/publish-finalize.yml index fd78235554..568f919f83 100644 --- a/.vsts-pipelines/jobs/publish-finalize.yml +++ b/.vsts-pipelines/jobs/publish-finalize.yml @@ -18,8 +18,6 @@ jobs: - Copy_Images_NanoServer1709_amd64 - Copy_Images_NanoServer1803_amd64 pool: ${{ parameters.pool }} - workspace: - clean: all variables: imageBuilder.commonCmdArgs: > --manifest $(manifest) diff --git a/.vsts-pipelines/jobs/test-images-linux-client.yml b/.vsts-pipelines/jobs/test-images-linux-client.yml index 2cec7408e4..bf6a70f0f7 100644 --- a/.vsts-pipelines/jobs/test-images-linux-client.yml +++ b/.vsts-pipelines/jobs/test-images-linux-client.yml @@ -21,8 +21,6 @@ jobs: pool: ${{ parameters.pool }} strategy: matrix: ${{ parameters.matrix }} - workspace: - clean: all variables: testRunner.container: testrunner-$(Build.BuildId)-$(System.JobId) architecture: ${{ parameters.architecture }} diff --git a/.vsts-pipelines/jobs/test-images-windows-client.yml b/.vsts-pipelines/jobs/test-images-windows-client.yml index 58746b76ad..451229c4b1 100644 --- a/.vsts-pipelines/jobs/test-images-windows-client.yml +++ b/.vsts-pipelines/jobs/test-images-windows-client.yml @@ -19,8 +19,6 @@ jobs: pool: ${{ parameters.pool }} strategy: matrix: ${{ parameters.matrix }} - workspace: - clean: all steps: - template: ../steps/init-docker-windows.yml parameters: diff --git a/.vsts-pipelines/steps/cleanup-docker-windows.yml b/.vsts-pipelines/steps/cleanup-docker-windows.yml index 9abe7d7e6a..98f00ee52b 100644 --- a/.vsts-pipelines/steps/cleanup-docker-windows.yml +++ b/.vsts-pipelines/steps/cleanup-docker-windows.yml @@ -6,3 +6,10 @@ steps: displayName: Cleanup Docker Images condition: always() continueOnError: true +- powershell: | + if (Test-Path $(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder) { + Remove-Item $(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder -Force -Recurse; + } + displayName: Cleanup Image Builder + condition: always() + continueOnError: true diff --git a/.vsts-pipelines/steps/init-docker-windows.yml b/.vsts-pipelines/steps/init-docker-windows.yml index 2f4c00dd36..1edfc61991 100644 --- a/.vsts-pipelines/steps/init-docker-windows.yml +++ b/.vsts-pipelines/steps/init-docker-windows.yml @@ -22,7 +22,7 @@ steps: - script: > docker cp setupImageBuilder-$(Build.BuildId)-$(System.JobId):/image-builder - $(Build.BinariesDirectory)/Microsoft.DotNet.ImageBuilder + $(Build.BinariesDirectory)/.Microsoft.DotNet.ImageBuilder displayName: Copy Image Builder - script: docker rm -f setupImageBuilder-$(Build.BuildId)-$(System.JobId) displayName: Cleanup Setup Container @@ -30,5 +30,5 @@ steps: continueOnError: true - script: > echo "##vso[task.setvariable variable=runImageBuilderCmd] - $(Build.BinariesDirectory)\Microsoft.DotNet.ImageBuilder\Microsoft.DotNet.ImageBuilder.exe + $(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder\Microsoft.DotNet.ImageBuilder.exe displayName: Define runImageBuilderCmd Variable