From 7881199ec15d3a1c20952f488e7435122db6e36d Mon Sep 17 00:00:00 2001 From: Brett Hewitson Date: Fri, 23 Dec 2022 00:27:25 +1000 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- .azure/pipelines/azure-pipelines.yml | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.azure/pipelines/azure-pipelines.yml b/.azure/pipelines/azure-pipelines.yml index 15d27850..e757b82c 100644 --- a/.azure/pipelines/azure-pipelines.yml +++ b/.azure/pipelines/azure-pipelines.yml @@ -56,6 +56,42 @@ stages: steps: - checkout: GitHubRepo + - task: PowerShell@2 + displayName: Output Environment Variables + condition: contains(variables['system.debug'], 'true') + inputs: + targetType: inline + script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' + pwsh: true + + - task: PowerShell@2 + displayName: Clean-up Agent Folders + condition: always() + env: + BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory) + BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory) + BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory) + BUILD_PUBLISHDIRECTORY: "$(Build.BuildDirectory)/$(PublishFolder)" + inputs: + targetType: inline + script: | + if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) { + Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_BINARIESDIRECTORY) { + Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_SOURCESDIRECTORY) { + Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_PUBLISHDIRECTORY) { + Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + pwsh: true + - stage: deployRelease displayName: Production lockBehavior: runLatest @@ -73,3 +109,39 @@ stages: deploy: steps: - checkout: GitHubRepo + + - task: PowerShell@2 + displayName: Output Environment Variables + condition: contains(variables['system.debug'], 'true') + inputs: + targetType: inline + script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' + pwsh: true + + - task: PowerShell@2 + displayName: Clean-up Agent Folders + condition: always() + env: + BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory) + BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory) + BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory) + BUILD_PUBLISHDIRECTORY: "$(Build.BuildDirectory)/$(PublishFolder)" + inputs: + targetType: inline + script: | + if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) { + Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_BINARIESDIRECTORY) { + Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_SOURCESDIRECTORY) { + Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + + if (Test-Path $env:BUILD_PUBLISHDIRECTORY) { + Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue + } + pwsh: true