Artifact packaging with TeamCity
In the upcoming TeamCity 5.1 we’ve added an often requested feature – artifact packaging.
As you probably already know, in TeamCity you can easily configure artifact upload to the server. Later, from a build page, you can download all artifacts of the build. You can specify both directories and individual files as artifacts. The syntax for this is rather simple.
Build artifacts enable another really popular feature – custom reports. The essence of the feature is that if your build produces a report, viewable in a browser (any HTML/Text/Image/PDF), you can integrate this build report into the TeamCity interface. Report files are sent to TeamCity as artifacts, and you configure the report view in the TeamCity UI. One of the interesting things about custom reporting is that TeamCity can extract individual report files from ZIP-packaged archives. So if your report is a big directory with hundreds of files, you better zip them first before sending (to speedup the upload process).
Before TeamCity 5.1, you needed to zip the files in your build script. This required writing an Ant or NAnt task which prepared corresponding archive file. Unfortunately, not all build runners allow creating zip files.
In TeamCity 5.1, artifacts can be packed without modification of your build scripts. Just use archive suffix in your target path, and that’s it:
testng-report => testng.zip **/src/**/*.java => sources/all-java-files.tgz
You can use suffixes zip, jar, war, tgz, tar.gz to specify type of the archive. For jar and war archives, the file format is just zip.
And as you would have expected, if you use tar/gz packaging on a UNIX system, TeamCity preserves file mode of the files, username, and group.
You can try artifact packaging in the just opened TeamCity 5.1 EAP builds.
Hope you’ll like these bits of syntax-sugar, and please share your feedback!
Subscribe to Blog updates
Thanks, we've got you!
Introducing AWS Connection: A New Approach for Working With AWS in TeamCity
We’ve introduced a new feature called the AWS Connection, which makes it possible to work with AWS credentials more flexibly and safely.
TeamCity 2022.10: Sakura UI, Improved Integration With Amazon AWS, Out-of-the-Box HTTPS Support, Google OAuth Authentication, and More.
TeamCity 2022.10 comes with the Sakura UI enabled by default, introduces many cloud-related features including the AWS credentials management system and out-of-the-box terminal access to AWS EC2-based build agents, and adds important improvements to VCS integrations. Server administrators will love the new streamlined way to implement HTTPS for on-premises TeamCity installations. Also, a new authentication module for using Google accounts and a number of long-requested features have been implemented.
Transition to native Git in TeamCity 2022.04 brings 10x fetch time reduction to IntelliJ Platform
Starting from version 2022.04, TeamCity switched to native Git on the server side for Git VCS connections. The switch should positively impact both performance and overall experience of working with Git repositories on the TeamCity server side.In this blog post, we’ll talk about the reasons for the …
TeamCity 2022.04: Parallel Tests, Improved Integration with Amazon AWS, Built-in Code Quality Analysis, Updated VCS Integrations, and more
TeamCity 2022.04 introduces the new Parallel Tests feature that delivers an extraordinary speed boost when testing your projects. New powerful code analysis features will cut the time you spend on code reviews and increase the maintainability of your projects. Users who run their builds in the cloud…