mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
move cleanup to separate file
This commit is contained in:
parent
355df71a6a
commit
b4c21a583c
2 changed files with 28 additions and 3 deletions
|
|
@ -23,8 +23,17 @@ stages:
|
|||
displayName: Build and Publish
|
||||
|
||||
steps:
|
||||
- template: azure-pipelines-clean-agent.yml@self
|
||||
parameters:
|
||||
CleanArtifactsFolder: true
|
||||
CleanBinariesFolder: true
|
||||
CleanSourcesFolder: false
|
||||
CleanPublishFolder: true
|
||||
PublishFolder: ${{parameters.PublishFolder}}
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Pre Clean-up Agent Folders
|
||||
enabled: false
|
||||
env:
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
||||
|
|
@ -254,7 +263,8 @@ stages:
|
|||
|
||||
- task: PowerShell@2
|
||||
displayName: Post Clean-up Agent Folders
|
||||
condition: always()
|
||||
enabled: false
|
||||
#condition: always()
|
||||
env:
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
||||
|
|
@ -279,3 +289,11 @@ stages:
|
|||
Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
pwsh: true
|
||||
|
||||
- template: azure-pipelines-clean-agent.yml@self
|
||||
parameters:
|
||||
CleanArtifactsFolder: true
|
||||
CleanBinariesFolder: true
|
||||
CleanSourcesFolder: true
|
||||
CleanPublishFolder: true
|
||||
PublishFolder: ${{parameters.PublishFolder}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
parameters:
|
||||
- name: CleanArtifactsFolder
|
||||
type: bool
|
||||
default: true
|
||||
- name: CleanBinariesFolder
|
||||
type: bool
|
||||
default: true
|
||||
- name: CleanSourcesFolder
|
||||
type: bool
|
||||
default: false
|
||||
|
|
@ -21,6 +27,7 @@ stages:
|
|||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: Clean-up Agent Folders
|
||||
condition: always()
|
||||
env:
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
||||
|
|
@ -29,12 +36,12 @@ stages:
|
|||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||
if (${{parameters.CleanArtifactsFolder}} -and Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||
Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_ARTIFACTSTAGINGDIRECTORY"
|
||||
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
if (Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
||||
if (${{parameters.CleanBinariesFolder}} -and Test-Path $env:BUILD_BINARIESDIRECTORY) {
|
||||
Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_BINARIESDIRECTORY"
|
||||
Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue