Question

I use Teamcity to build different packages and want to save those Packages as Artifacts. My Artifact Path in TeamCity is the following:

%system.teamcity.build.workingDir%\**\Release**/*.wsp => Solution 

Now TeamCity collects all WSP-Files in any Release-Directory after building correctly. But it is saved including all subdirectories like:

How the Files are being offered

I only want the .wsp-File directly under "solution" without the directory tree.

Was it helpful?

Solution

From TeamCity docs:

wildcard — to publish files matching Ant-like wildcard pattern ("" and "*" wildcards are only supported). The wildcard should represent a path relative to the build checkout directory. 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.

http://confluence.jetbrains.net/display/TCD65/Configuring+General+Settings#ConfiguringGeneralSettings-artifactPaths

In your build script ( or additional final build step) you will have to copy the necessary files to a single folder and publish that folder as Artifacts

OTHER TIPS

Instead of copying as @manojlds suggests, you might be able to achieve something by modifying the OutputPath in yout .csproj file, or feeding in an OutDir property override when building a .sln (if you are). Be warned that neither of these approaches are perfect - for example, TeamBuild (the CI server in the Visual Studio ALM Tooling) redirects everything into one directory, which can cause a complete mess and only works for the most simple cases.

I had this issue where I wanted to gather various install files from subdirectories. Adding a PowerShell runner as a build step is quite powerful and solves this nicely...

get-childitem -Recurse -Include *.wsp | Move-Item -destination .

This will move them to the root prior to TeamCity looking at the artifacts, where the basic artifact paths like *.wsp can pick it up for the final output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top