Question

I'm trying to store whole the output of my build, this includes some empty folders. These aren't included by the artefact mechanism in teamcity: What doesn't work:

OAR\=> OAR.zip
OAR->OAR.zip
OAR

Inside of OAR i have a folder structure that needs to be stored. I know i could put a placeholder file in each but that is not the answer i'm after. Otherwise ill have to zip it myself?

Was it helpful?

Solution

Unfortunately TeamCity, by design, searches for files and uploads them as artifacts which means that empty folders are never included. Given the open and very old issue in the TeamCity tracker I doubt they are going to fix it any time soon.

I would recommend zipping the folder yourself, that is the approach we have taken. How you implement that depends on the build technology you are using. For example, if you are building using Nant you could add the zip task to your build, there are similar options for MSBuild and Ant.

If you don't want to rely on the build performing the zip I would recommend installing 7zip on your build agents and using the command line to perform the zip. Just remember if you want 7zip to include empty directories use * as the wildcard rather than *. * like so:

7z a -r OAR.zip *

Technically you could use powershell to do the zipping, which would be better than having to install something on your agents. I haven't tried this option myself.

Apologies for not linking all my references above. Apparently, and understandably so, I need at least 10 reputation to post more than 2 links.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top