Search code examples
zipteamcityteamcity-10

TeamCity: Adding additional logs to artifacts zip file


In TeamCity, it is possible to specify the 'Artifact Paths' so that all files and folders from a directory can be added to a Zip file:

E:\Logs\**\* => Logs.zip

However, I would like to add additional log files to a sub folder within the zip file. Is it possible to do this without an additional build step to move/copy the files? For example:

E:\Logs\**\* => Logs.zip
D:\ThirdParty\Logs\*.txt => Logs.zip\ThirdParty\ 

Solution

  • It is possible to specify the path inside a zip when you are creating an artefact

    You just need to set a ! after the extension, in order to indicate that the content will be put inside.

    /logs/*.log => Logs.zip
    /out/*.txt => Logs.zip!/ThirdParty