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

允我心安 提交于 2019-12-09 08:44:18

问题


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?


回答1:


  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



回答2:


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




回答3:


You can use the following thing when you are using octopack with msbuild to create the nuget package.

The command line parameter /p:OctoPackAppendToPackageId=foo adds foo to your nuget package name. Docs (under publishing)

Example:

Without parameter: abc.nupkg

With parameter: abc.foo.nupkg



来源:https://stackoverflow.com/questions/26280244/is-it-possible-to-output-and-rename-build-artifacts-from-the-teamcity-checkout-d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!