Empty folders excluded when copying artifacts
I've just hit the problem that TeamCity excludes empty folders when copying artifacts.
I thought I'd be able to work round this by compressing the overall directory tree using the "dirname/** => zname.zip" notation, but this also fails to include any empty sub-folders.
This fault was fixed in stand-alone zip tools over 10 years ago, so I'd say this is a bug report not a feature request.
From our point of view this means either a chunk of extra work or finding something else instead of TeamCity to replace our existing cross-platform build system which is 15 years old and has never had this problem. *mutter*
For anyone interested, the problematic component of the software we're building is a read-write data "repository", essentially a directory tree containing ~150 sub-folders and ~900 files (when installed but before use). The actual contents varies according to how the product is configured when built.
Please sign in to leave a comment.
Actually the fix in this specific case is simply to add another build step to compress the problematic directory using an external zip tool and then copy the zipped file around using the artifact rules
- not ideal as it causes hassle later in our build process, but its just software so there is (nearly) always a way.
I still think the underlying issue ( TW-11382 ) is a bear trap waiting to bite someone a posteriori.
Hi,
Unfortunately we do not have plans to fix this problem in the nearest future as there is a simple workaround to publish artifacts archived in the build step of dependent build configuration and then unpack them in the build that uses these artifacts. Please vote for these two related issues: https://youtrack.jetbrains.com/issue/TW-5895, https://youtrack.jetbrains.com/issue/TW-11382.
Just hit this one again with TeamCity 10.0.1 . Looking at it again I don't understand the above reply; if empty folders are excluded from published artifacts then the dependent builds will fail if they require the presence of those folders - in our case it would not be possible to run tests on the built artifacts because such folders are absent.
If we didn't want the empty folders included in the published artifacts then either we wouldn't create them as part of the build or we would explicitly exclude them ( which we can do now with the enhanced artifacts path support ).
Hello,
The suggested workaround is to create the archive inside the build script (e.g. as a last step of the build) and not rely on TeamCity artifact archiving functionality, just publish the prepared file as artifact. Download this archive in the dependent build configuration and unpack it. Empty folder will be preserved in this case.
As I say above, that is what we're doing now - using a 10-year old copy of a zip tool that we can run on our various build platforms.
It just seems a shame that we cannot rely on using the (improved) TC artifact archiving because it will fail silently in this case.
Here we are almost 10 years later and this bug has not been addressed. in my particular use case, we have NuGet packages that are already zipped, and if we have an empty packages folder it does break the next step in the chain. Gonna see what I can do to create a junk text file so the folder is created in the artifact collection. This Technical Debt should be addressed at some point, yes there are work arounds, but this is creating extra work for your consumers.
I have tested on the newest version of TeamCity, and, as per https://youtrack.jetbrains.com/issue/TW-11382, when packaging a folder with artifacts, empty subfolders are getting packaged too.
Best regards,
Anton