TeamCity 压缩工件依赖项
在 TeamCity 的工件页面上,可以选择将所有工件下载为 zip 文件。
我想知道您是否可以设置依赖的构建配置来实际获取工件的压缩版本?
我意识到我可以压缩最初创建它们的项目配置中的所有工件,但我宁愿不这样做。
或者,我可以使用 Nant 之类的东西在它们被带过来后对其进行压缩,但我想如果首先对发送的文件进行压缩,那么这些工件的传输可能会更快一些。
有人知道从其他每个项目传输压缩工件的方法吗?或者 TeamCity 是否支持这种方法?
When on the artifacts page in TeamCity, there is an option to download all the artifacts as a zip file.
I was wondering if you can set up dependent build configurations to actually grab the zipped version of the artifacts?
I realize I could zip all the artifacts in the project configuration that initially creates them, but I'd rather not do that.
Alternatively, I could use something like Nant to zip them once they are brought over, but I would imagine that the transfer of these artifacts could probably go a bit faster if the files being sent were zipped in the first place.
Is anyone aware of a way to transfer the zipped artifacts from each of the other projects or if this is supported by TeamCity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。这非常简单,至少对于当前版本的 TeamCity (6.5.3) 来说是这样。在您的“主”项目中,创建压缩工件:
构建后,您将在压缩工件中看到所有文件。然后创建一个新的构建配置。您将需要编辑此构建的依赖项并添加新的“工件依赖项”。像这样编辑其属性:
*.zip
。如果您希望 TeamCity 为您解压 zip 文件,请使用*.zip!**
。现在,当依赖构建的运行程序启动时,它将从您的主项目中获取最新的 zip 存档并将其解压到您的依赖中构建的目标文件夹。
Yep. This is pretty straightforward, at least with the current version of TeamCity (6.5.3). In your "main" project, create the zipped artifact:
After your build, you will see all of your files in the zip artifact. Then create a new build configuration. You will want to edit the dependencies of this build and add a new "artifact dependency". Edit its properties like so:
*.zip
. If you want TeamCity to unpack the zip file for you, use*.zip!**
.Now when the runner for the dependent build is kicked off, it will grab the latest zip archive from your main project and unpack it into your dependent build's destination folder.
也许,您可以在第一个构建步骤中通过构造依赖配置的 URL 来手动获取压缩的工件。在构建中,您可以获取依赖构建的参数,这可以帮助您构建 URL。
网址看起来像:
http://your.server/(guestAuth| httpAuth)/repository/downloadAll/bt457/12345:id/artifacts.zip
其中 bt457 - 您的构建配置的 id
12345 - 依赖构建的构建 ID,您应该能够在构建中作为系统属性 dep.bt457.teamcity.build.id 获取该 ID
,在此处阅读更多信息:http://confluence.jetbrains.net/display/TCD6/Predefined+Build+Parameters#PredefinedBuildParameters-DependencyProperties
所有这些不是很优雅,但应该可以
Probably, you could obtain zipped artifacts manually, in your first build step, by constructing URL to the dependent configuration. In the build, you can get parameters of your dependent builds, which can help you to build the URL.
URL looks like:
http://your.server/(guestAuth|httpAuth)/repository/downloadAll/bt457/12345:id/artifacts.zip
where bt457 - id of your build configuration
12345 - build id of the dependent build, which you should be able to obtain in your build as system property dep.bt457.teamcity.build.id
read more here: http://confluence.jetbrains.net/display/TCD6/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties
All of this not very elegant, but it should work