Build Artifact
Artifacts are files produced by a build. After finishing a build, TeamCity searches for artifacts in the build's Build Checkout Directory according to the specified artifact patterns. Matching files are then uploaded to the server, where they become available for download. Artifacts stay on the server and are available for download until the artifacts for the build are Clean-Up. Examples of artifacts are installers, WAR files, reports, log files, etc. Build Configurations can be configured to use artifacts of other builds (refer to Dependent Build for details).
Artifacts of a build are specified on the 1.General Settings using comma-, or newline- separated values of the format:
file_name|directory_name|wildcard [ => target_directory ]
The format contains:
file_name
— to publish the file. The file name should be relative to the build checkout directory.directory_name
— to publish all the files and subdirectories within the directory specified. The directory name should be a path relative to the build checkout directory. The files will be published preserving the directories structure under the directory specified (the directory itself will not be included).wildcard
— to publish files matching Wildcards 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.target_directory
— the directory in the resulting build's artifacts that will contain the files determined by the left part of the pattern.
The names can be paths relative to the Build Checkout Directory or absolute paths. The usage of absolute paths is discouraged, please try to use path relative to the build checkout directory.
An optional part starting with =>
symbols and followed by the target directory name can be used to publish the files into the specified target directory. If target directory is omitted the files are published in the root of the build artifacts. You can use "." (dot) as reference to the build checkout directory.
You can use Properties of a Build Configuration in the artifacts specification. For example, use "mylib-%\system.build.number%.zip
" to refer to a file with the build number in the name.
Examples:
install.zip — publish file named
install.zip
in the build artifactsdist — publish the content of the
dist
directorytarget/*.jar — publish all jar files in the
target
directorytarget/**/*.txt => docs — publish all the txt files found in the
target
directory and its subdirectories. The files will be available in the build artifacts under thedocs
directory.reports => reports, distrib/idea.zip — publish reports directory as
reports
and files matchingidea*.zip
from thedistrib
directory into the artifacts root.
You can download artifacts of a build via the web UI from the Artifacts column of the Projects, from the Overview of the Build Configuration Home Page or from the Artifacts tab of the Build Results Home Page page. Artifacts downloading can be automated as described in the Patterns For Accessing Build Artifacts section.
Build artifacts can also be uploaded to the server while the build is still running. To instruct TeamCity to upload the artifacts, build script should be modified to send Build Script Interaction with TeamCity
Artifacts are stored on the disk on the server, under /artifacts/<project name>/<build configuration name>/<internal_build_id>
directory. The artifacts can be copied directly form the directory on the server (if OS is configured to provide access for it). TeamCity computer's administrator can delete artifacts directly form the disk. In this case, build's artifacts will no longer be available.