我可以使用Bamboo Rest-API下载Bamboo构建的工件吗? [英] Can I download Bamboo built artifacts using Bamboo Rest - API?

查看:319
本文介绍了我可以使用Bamboo Rest-API下载Bamboo构建的工件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

页面指出:

Bamboo的REST API提供以下功能:

Bamboo's REST APIs provide the following capabilities:

  • 检索构建的工件.

此处,我会看到文档:

http://myhost.com:8085/bamboo/rest/api/latest/plan/ {projectKey}-{buildKey}/artifact [GET]

http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey}/artifact [GET]

当我尝试使用我拥有的Bamboo服务器的链接时,例如:

When I try this link with the bamboo server I have, like:

https://my.bamboo.server/rest/api/latest/plan/MY-PLAN/artifact

我得到的是:

<artifacts expand="artifacts">
    <link href="http://my.bamboo.server/rest/api/latest/plan/MY-PLAN/artifact" rel="self"/>
    <artifacts start-index="0" max-result="0" size="0"/>
</artifacts>

所以我是不是完全理解REST文档,还是MY-PLAN可能有问题,并且此链接应该为我提供了我所期望的war文件?

So am I understanding the REST documentation completely wrong, or is there something wrong possibly with MY-PLAN and this link is supposed to provide me a war file as I expect?

推荐答案

恐怕您对REST文档有误解.通过检索构建的工件",它的意思是检索有关为给定计划定义的构建工件的信息".如您所见,您所获得的只是描述所定义工件的XML或JSON文档.

I'm afraid you are misunderstanding the REST documentation; by "Retrieve the artifacts for a build", it means "retrieves information about the build artifacts defined for a given plan". As you have already seen, all you get back is an XML or JSON document describing the artifacts defined.

如果要下载实际的构建工件,则需要编写一个脚本,该脚本使用/rest/api/latest/result/来获取最新的成功构建信息,并由此形成一个实际的下载链接,以神器.

If you want to download an actual build artifact, you'll need to write a script that uses /rest/api/latest/result/ to get the latest successful build info and, from that, form an actual download link to the artifact.

这篇关于我可以使用Bamboo Rest-API下载Bamboo构建的工件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆