Server - VSTS or TFS on-premises?
VSTS
Agent - Hosted or Private:
private, 2012r2, agentversion=2.136.1
In a build a webApp is zipped into "$(build.binariesdirectory)\webApp.zip". The task has the "Replace"-option set but still the files get added to the existing zip instead of replacing the zip.
One of the assemblies of the webApp changed its extension from dll to exe and the zip then contained the dll from last week. The app couldn't startup anymore so when i investigated i found some contents in the zip that should't be there if the "Replace"-option would have replaced the zip.
The clean-option of the definition was set to "sources".
In my case i simple updated the clean-option to "sources and output" to force that the $(build.binariesdirectory) gets recreated, but still an issue in some other build and release definitions.
Can confirm this issue. Creating a zip archive with option "Replace existing archive" does not replace the the zip file in the destination.
Confirming this issue. My pipeline runs on Windows latest and has the following tasks:
The result is that the old .zip file has been "merged" with the new .zip file. All .dll files and .config files that were deleted persisted, along with the .config files that were added.
Ran a test to save the archive as a different name and confirmed that the old .zip had only the old files. The new .zip had only the new files that were copied, none of the old files that were deleted.
Extract files task:
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(build.artifactStagingDirectory)/DevOpsTest.zip'
destinationFolder: '$(working_dir)'
cleanDestinationFolder: true
Archive files task:
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(working_dir)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(build.artifactStagingDirectory)/DevOpsTest.zip'
replaceExistingArchive: true
Will "work around" this issue by using a Delete Files task to delete the old .zip file right after the Extract Files task.
This was opened in august 2018. Now is june 2020 and still open. i am closing this now as i am not expecting any fix for this in the near feature
I have this issue also, using macos-latest agent
Most helpful comment
Can confirm this issue. Creating a zip archive with option "Replace existing archive" does not replace the the zip file in the destination.