TeamCity 压缩工件依赖项

发布于 2024-10-10 18:35:55 字数 260 浏览 5 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

空心↖ 2024-10-17 18:35:55

是的。这非常简单,至少对于当前版本的 TeamCity (6.5.3) 来说是这样。在您的“主”项目中,创建压缩工件:

MyProjectBuildFolder\** => mybuild-%system.build.number%.zip

构建后,您将在压缩工件中看到所有文件。然后创建一个新的构建配置。您将需要编辑此构建的依赖项并添加新的“工件依赖项”。像这样编辑其属性:

  1. 取决于:上面主项目的构建配置。
  2. 获取工件:上次成功构建
  3. 工件路径:如果您只想复制 zip 文件,则为 *.zip。如果您希望 TeamCity 为您解压 zip 文件,请使用 *.zip!**
  4. 目标路径: %some.parameter.representing.your.path%

现在,当依赖构建的运行程序启动时,它将从您的主项目中获取最新的 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:

MyProjectBuildFolder\** => mybuild-%system.build.number%.zip

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:

  1. Depend on: The build configuration from your main project from above.
  2. Get artifacts from: Last successful build
  3. Artifacts paths: If you want to just copy the zip file, this will be *.zip. If you want TeamCity to unpack the zip file for you, use *.zip!**.
  4. Destination path: %some.parameter.representing.your.path%

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.

執念 2024-10-17 18:35:55

也许,您可以在第一个构建步骤中通过构造依赖配置的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文