从 TeamCity 下载构建版本

发布于 2024-11-19 18:29:16 字数 34 浏览 1 评论 0原文

有没有办法在 TeamCity 中下载项目的特定版本?

Is there a way to download specific builds of a project in TeamCity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

左秋 2024-11-26 18:29:17

您可以使用构建 ID、构建编号或静态构建标识符之一:

http://{TeamCity-Server}/repository/download/{BUILD_TYPE_ID}/{BUILD_NUMBER}/{ARTIFACT_PATH}

http://confluence.jetbrains.net/display/TCD65/Patterns+For+Accessing+Build+Artifacts

You can use the build id, build number or one of the static build identifiers:

http://{TeamCity-Server}/repository/download/{BUILD_TYPE_ID}/{BUILD_NUMBER}/{ARTIFACT_PATH}

http://confluence.jetbrains.net/display/TCD65/Patterns+For+Accessing+Build+Artifacts

请叫√我孤独 2024-11-26 18:29:17

您实际上想要做的是在 TeamCity 中创建工件。工件通常是构建输出,然后附加到各个构建运行,以便您可以在以后下载和查看它们。有一个演练,包括在 You 中创建构建工件部署错误了! TeamCity、Subversion 和Web 部署第 5 部分:使用 TeamCity 进行 Web 部署

What you're actually looking to do is create artifacts in TeamCity. Artifacts are normally a build output which are then attached to the individual build runs so that you can download and review them at a later date. There's a walk through including the creation of build artifacts in You're deploying it wrong! TeamCity, Subversion & Web Deploy part 5: Web Deploy with TeamCity.

筑梦 2024-11-26 18:29:17

我们将从构建生成的 .msi 文件附加为包含构建号的工件(您可以使用 %env.BUILD_NUMBER% 来查找工件路径)。

we attach the .msi file generated from the build as an artifact containing the build number (you can use %env.BUILD_NUMBER% to find the artifact path).

剩一世无双 2024-11-26 18:29:17

如上所述,可以使用 REST API 下载。也可以使用带有 Fluent api 的 FluentTc 库:

下载最新成功构建的工件:

IConnectedTc connectedTc = new RemoteTc().Connect(a => a.ToHost("tc")
       .AsUser("MYUSERNAME", "MYPASSWORD"))

IBuild lastSuccessfulBuild = connectedTc.GetLastBuild(having => 
    having.BuildConfiguration(with => with.Id("FluentTc"))
    .Status(BuildStatus.Success));

IList<string> downloadedFiles = connectedTc.DownloadArtifacts(lastSuccessfulBuild.Id, 
            @"C:\DownloadedArtifacts");

下载来自特定构建工件的特定文件(按构建 ID):

string downloadedFile = connectedTc.DownloadArtifacts(
    buildId, 
    @"C:\DownloadedArtifacts", 
    "binaries.zip");

As mentioned above, one can download using REST API. It is also possible using FluentTc library with fluent api:

Download artifacts of the latest successful build:

IConnectedTc connectedTc = new RemoteTc().Connect(a => a.ToHost("tc")
       .AsUser("MYUSERNAME", "MYPASSWORD"))

IBuild lastSuccessfulBuild = connectedTc.GetLastBuild(having => 
    having.BuildConfiguration(with => with.Id("FluentTc"))
    .Status(BuildStatus.Success));

IList<string> downloadedFiles = connectedTc.DownloadArtifacts(lastSuccessfulBuild.Id, 
            @"C:\DownloadedArtifacts");

Download specific file from artifacts of specific build by build Id:

string downloadedFile = connectedTc.DownloadArtifacts(
    buildId, 
    @"C:\DownloadedArtifacts", 
    "binaries.zip");
弥繁 2024-11-26 18:29:17

要从 Team City 获取最新的成功构建工件,您可以使用以下链接模板:

  • 使用访客身份验证:http:///guestAuth/downloadArtifacts.html?buildTypeId=& 使用访客身份验证的buildId=lastSuccessful

  • 使用您的凭据:http://;/repository/downloadAll//.lastSuccessful/artifacts.zip

  • 具有特定工件:http:/// httpAuth/repository/download//.lastSuccessful/

To get latest successful build artifacts from Team City you can use the following link templates:

  • with guest authentication: http://<buildServer>/guestAuth/downloadArtifacts.html?buildTypeId=<buildTypeId>&buildId=lastSuccessful

  • with your credentials: http://<buildServer>/repository/downloadAll/<buildTypeId>/.lastSuccessful/artifacts.zip

  • with specific artifact: http://<buildServer>/httpAuth/repository/download/<buildTypeId>/.lastSuccessful/<some file.ext>

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