本文介绍了是否可以从 TeamCity 签出目录(不是存档)输出和重命名构建工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了 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

然而,这只是简单地将可执行安装程序文件压缩为带有我重命名规范的 zip 文件,我实际上只是希望它保留为 .exe 文件.我可以看到的问题是,根据上述 TeamCity 链接文档,此重命名约定仅适用于存档文件类型.

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. 添加将重命名工件的命令行步骤
ren Release\oldname.exe newname_%build.number%.exe
  1. 将工件定义为重命名文件的路径.
newname_%build.number%.exe

这篇关于是否可以从 TeamCity 签出目录(不是存档)输出和重命名构建工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 02:28