Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to output and rename build artifacts from the TeamCity checkout directory (that are not archives)?

Tags:

teamcity

I have gone through the documentation for TeamCity on build artifact outputs

(https://confluence.jetbrains.com/display/TCD8/Configuring+General+Settings#ConfiguringGeneralSettings-ArtifactPaths)

However, it doesn't seem clear to me as to how I can output a standard file from the build checkout directory, AND rename it when placing it into the build's artifacts.

I can do this pretty easily using archive file designations. For example:

%system.teamcity.build.checkoutDir%\TestProject.Installer\DiskImages\*.exe => setup-1.0.%build.counter%.zip

However, this would just simply zip up the executable installer file as a zip file with my renamed specification, where I actually just want it to stay as an .exe file. The problem I can see is that this rename convention only works on archive file types according to the above TeamCity linked documentation.

So is it possible to rename an executable file that is fetched from the build checkout directory and place it into the build artifacts?

like image 542
Shogan Avatar asked Oct 09 '14 13:10

Shogan


People also ask

Where are TeamCity artifacts stored?

The artifacts are stored on the server "as is" without additional compression. 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.

What is checkout directory in TeamCity?

The build checkout directory is a directory on the TeamCity agent machine where all the sources of all builds are checked out into. If you use the agent-side checkout mode, the build agent checks out the sources into this directory before the build.

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.


2 Answers

  1. Add command line step which will rename the artifact
ren Release\oldname.exe newname_%build.number%.exe
  1. Define artifact as path to the renamed file.
newname_%build.number%.exe
like image 66
Tomas Kubes Avatar answered Sep 21 '22 18:09

Tomas Kubes


It is not possible to rename build artifacts using TeamCity. The needed .exe file name should be configured inside your build script.

like image 39
Alina Mishina Avatar answered Sep 20 '22 18:09

Alina Mishina