What's the correct wildcard syntax to copy TeamCity artifacts to the root of a destination path?
Asked Answered
C

2

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?

Chenab answered 4/3, 2011 at 23:14 Comment(0)
F
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.

Frediafredie answered 5/3, 2011 at 7:6 Comment(1)
Whilst it's not the answer I would have liked, it does unfortunately seem to be the correct one.Chenab
C
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.

Chirrup answered 4/3, 2011 at 23:32 Comment(2)
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.Chenab
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.Chenab

© 2022 - 2024 — McMap. All rights reserved.