Search code examples
teamcityteamcity-9.0

TeamCity Build Artifacts - Prevent overwriting of identically named files


In the 'General Settings' of my build configuration, I specify three different .html files in the 'Artifact Paths' text field, all with the same name. Each .html file is located in a separate directory, for example:

Specifying artifact paths

However, this presents an issue. When I run my build which generated these files, only one report.html is present in the 'Artifacts' tab when the build has completed.

My presumption is that due to the fact that all three of these files are named report.html, it is overwriting the file two times. How do I prevent this from happening?


Solution

  • Answering my own question.

    Adding => newDirectoryNameGoesHere to the end of every line will prevent this overwriting issue. It lets you specify a new location for your file. It is recommended to add the .zip extension so it can easily interact with other TeamCity functions such as Reports.

    For example:

    directory1/report.html => newDirectory1.zip
    directory2/report.html => newDirectory2.zip
    directory3/report.html => newDirectory3.zip
    

    Now when viewing artifacts in a build you will be presented with three separate directories each containing their appropriate file, regardless of whether all your files have the same name.