Can I download Bamboo built artifacts using Bamboo

2019-02-23 01:05发布

This page states:

Bamboo's REST APIs provide the following capabilities:

  • Retrieve the artifacts for a build.

and here I see the documentation:

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

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

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

All I get is:

<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>

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?

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-02-23 01:48

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.

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.

查看更多
爷、活的狠高调
3楼-- · 2019-02-23 01:51

There are some issues related to your question: https://jira.atlassian.com/browse/BAM-11706 and BAM-16315 (which was deleted, because it contained customer details)

查看更多
淡お忘
4楼-- · 2019-02-23 02:04

You've the link

<link href="http://my.bamboo.server/rest/api/latest/plan/MY-PLAN/artifact" rel="self"/>

Using curl you can download the artifact.

curl --user ${username}:{password} http://my.bamboo.server/rest/api/latest/plan/MY-PLAN/artifact
查看更多
登录 后发表回答