azure-pipelines-tasks: After upgrade for version 4.0.0 of dependencie azure-pipelines-task, Archive2 does not work anymore
Yesterday after the commit for upgrade, it started to not work anymore, right after this https://github.com/microsoft/azure-pipelines-tasks/commit/e526642ad239018a1227109d12d93a182405a6fc :
Error logs
Found 0 files
/usr/bin/zip -r /home/vsts/work/1/a/6256.zip
zip error: Nothing to do! (/home/vsts/work/1/a/6256.zip)
##[error]Error: Archive creation failed for archive file: /home/vsts/work/1/a/6256.zip
code: 12
stdout:
zip error: Nothing to do! (/home/vsts/work/1/a/6256.zip)
stderr:
error: undefined;
##[error]Archive creation failed for archive file: /home/vsts/work/1/a/6256.zip
code: 12
stdout:
zip error: Nothing to do! (/home/vsts/work/1/a/6256.zip)
stderr:
error: undefined;
My yml
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 22
I’ve same issue…
Logs:
Task implementation:
This was the answer for us; works perfectly. Our task after changes:
This was after a day working on custom zip/Compress-Archive solutions and running into the symlinking issues described above in our NextJS app.
EDIT: To add, thank you @mattford for this solution. I wasn’t aware until this that you could refer to tasks by minor version.
I was able to work around this by specifying the pre-upgrade version of the task:
Upgrade appears to be in https://github.com/microsoft/azure-pipelines-tasks/commit/178868ef50485c827548770e207c2d8cf251f62f
@liester I dont know of a way other than converting the entire pipeline to yaml 😕
Give this one a try as it zips symlinks also
@dcarnelossi @leni-msft I solved this problem by generating the zip file by the powershell core!
My old zip file generation task:
I replaced it with:
@ryan-bunkr We have several other steps to clear caches and install node and packages from scratch. I don’t know if it helps you but here is the build stage for our node + nextJS deploy pipeline.
Another workaround is to use bash, and run a manual zip inline. This seems to avoid the issue around node