How do you handle cases when the Extract files
task does not find files to extract ?
Is it possible to set the Extract files
task to fail if there were no files extracted ?
Here is a sample task
steps:
- task: ExtractFiles@1
displayName: 'Extract files '
inputs:
archiveFilePatterns: '$(System.ArtifactsDirectory)\*.zip'
destinationFolder: '$(System.ArtifactsDirectory)\bin'
it does not fail if no file was found however
2020-10-01T14:25:23.1175947Z Searching for: *.zip under directory: E:\ba\n1_work\r16\a
2020-10-01T14:25:23.1287445Z Found: 0 files to extract:
and then a ftp upload task does nothing
2020-10-01T14:25:36.4142531Z ##[warning]Could not find any files to upload
The release pipeline is simple like
- extract files
- stop azure app service
- upload files by ftp
- start azure app service
I've added the powershell script to check for files were extracted
if (-not (Test-path $(System.ArtifactsDirectory)\bin\*) )
{
Throw New-Object System.ArgumentException("no files were extracted")
}
but would like to know is it possible to make ExtractFiles@1 or FtpUpload@2 tasks to fail if there was nothing extracted or uploaded ?
Regards