Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove directory structure in Teamcity's artifacts

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.

like image 602
Ole Albers Avatar asked Oct 26 '11 12:10

Ole Albers


People also ask

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.

Where are artifacts stored in TeamCity?

By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed. You can configure an external artifacts storage to replace the built-in one. Build artifacts can also be uploaded to the server while the build is still running.

What is artifact dependency?

The Artifact Dependency Graph (ADG) of an artifact is the recursive DAG (Directed Acyclic Graph) of all the input artifacts that are transformed by a build tool into that artifact. It includes the direct input artifacts, and the recursive set of artifacts to each input artifact, all the way down to source code.

How do you download artifacts on TeamCity?

You can also download artifacts from TeamCity using the Ivy dependency manager. For artifact downloads from outside TeamCity builds, consider using REST API. See also Accessing Server by HTTP on basic rules covering an HTTP access from scripts.


2 Answers

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

like image 63
manojlds Avatar answered Sep 19 '22 21:09

manojlds


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.

like image 41
Ruben Bartelink Avatar answered Sep 20 '22 21:09

Ruben Bartelink