mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
pipeline file cleanup
This commit is contained in:
parent
7787d2c5b8
commit
6515b994d7
2 changed files with 34 additions and 12 deletions
|
|
@ -16,7 +16,7 @@ parameters:
|
|||
|
||||
stages:
|
||||
- stage: build
|
||||
displayName: Build and Publish
|
||||
displayName: Build and Publish
|
||||
|
||||
jobs:
|
||||
- job: build
|
||||
|
|
@ -24,8 +24,7 @@ stages:
|
|||
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: Clean Agent Folders
|
||||
enabled: true
|
||||
displayName: Clean-up Agent Folders
|
||||
env:
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
BUILD_BINARIESDIRECTORY: $(Build.BinariesDirectory)
|
||||
|
|
@ -35,17 +34,13 @@ stages:
|
|||
targetType: inline
|
||||
script: |
|
||||
if (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||
Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue
|
||||
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
|
||||
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
|
||||
}
|
||||
|
|
@ -53,7 +48,6 @@ stages:
|
|||
|
||||
- task: PowerShell@2
|
||||
displayName: Create AgentCapabilities Environment Variables
|
||||
enabled: true
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
|
|
@ -112,7 +106,7 @@ stages:
|
|||
clean: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Cleanup Published Files
|
||||
displayName: Clean-up Published Files
|
||||
env:
|
||||
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
|
|
@ -258,3 +252,31 @@ stages:
|
|||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: '${{parameters.PublishFolder}}'
|
||||
|
||||
- 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)/${{parameters.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
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ variables:
|
|||
- name: ProjectFile
|
||||
value: 'src/$(ApplicationName)/$(ApplicationName).csproj'
|
||||
- name: PublishFolder
|
||||
value: Publish123
|
||||
value: p
|
||||
|
||||
stages:
|
||||
- template: azure-pipelines-build.yml@self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue