15

I'm having a small drama with the wildcard syntax in my TeamCity artifact configuration. I want to grab every file matching the pattern myproject.*.dll from any folder and place each DLL in the root of the artifacts path.

Here's what I've got at present:

**/obj/Debug/myproject.*.dll => /

This is grabbing all the DLLs but it's putting them inside the same folder structure as the source so rather than ending up with "myproject.web.dll" in the artifacts I get "Web/obj/debug/myproject.web.dll".

What am I missing here?

Troy Hunt
  • 20,345
  • 13
  • 96
  • 151

2 Answers2

16

I'm afraid you cannot do this in an easy way. You should collect your *.dll locally to a single place, and than use TeamCity's artifacts rule to copy all of them to root directory.

Or, you can enter all paths manually (without ** part)

This is how it works in TC.

KIR
  • 5,614
  • 1
  • 31
  • 23
4

I am not sure you can use the artifact root without it copying the structure. The docs specify

If target directory is omitted the files are published in the root of the build artifacts.

Can you not just use a designated folder name say dist, would this cause issues? If so what are they!

e.g

**/obj/Debug/myproject.*.dll => dist

Update - found some more info in the docs

The files will be published preserving the structure of the directories matched by the wildcard (directories matched by "static" text will not be created). That is, TeamCity will create directories starting from the first occurrence of the wildcard in the pattern.

So if you can be more explicit it may lead to a flatter structure.

redsquare
  • 78,161
  • 20
  • 151
  • 159
  • Same deal, you just end up with the entire directory structure in the "dist" folder. In fact, I really don't need the "=> /" syntax if I want the files in the root anyway. – Troy Hunt Mar 04 '11 at 23:42
  • In terms of why this causes issues, it's simply that it's a large solution with many projects and once the DLLs get captured way down within the folder structure it's a bit harder to easily identify what you have. You need to go traversing down folder trees rather than just being able to see all artifacts at a glance. – Troy Hunt Mar 04 '11 at 23:44