1

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?

James Woolfenden
  • 6,498
  • 33
  • 53

1 Answers1

6

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.

Community
  • 1
  • 1
Andrew Fraser
  • 388
  • 1
  • 9
  • That's what i did. I'm in the brownest of brownfield development sites so powershell it wont be unfortunately. Im just checking/hoping that there isn't some fancy TC syntax to include them. – James Woolfenden Aug 06 '13 at 11:44
  • i used an extra step in ant and the ant zip task (this was already being used by the build) – James Woolfenden Aug 06 '13 at 11:46
  • @JamesWoolfenden I did try different syntax in TC but couldn't get anything to include empty directories. Good solution but wish JetBrains would fix the issue. – Andrew Fraser Aug 07 '13 at 10:50
  • @JamesWoolfenden Please mark this as a correct answer if you think it was correct. – Andrew Fraser Aug 12 '13 at 09:46