I was wondering if there is a way to access specific artifact (tarball) for the latest successful build, though rest api, using wget.
Community moderators have prevented the ability to post new answers.
Try:
http://my-ci-server:8080/bamboo/rest/api/latest/result/PROJECT_KEY-PLAN_KEY-latest?expand=artifacts
This will give you access to the artifact list in XML format, including the file name. The prerequisite is that the artifact with tarball is a single file (it can be defined via a wildcard like PROJECT-*.tgz, so you don't need to hardcode it, but it has to resolve to a single file).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hm…
I don't think I am seeing the right thing.
I am getting the same output as if I were to access just
http://my-ci-server:8080/bamboo/rest/api/latest/result/PROJECT_KEY-PLAN_KEY-BULDNUMBER
Do I have anything misconfigured? My build file is a single .tgz file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are asking about getting a tarballed artifact from a Bamboo Server (i.e. an artifact has a couple/lots of files in it and you want to fetch a single tarball with all the artifac files in it) - no, that's not possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Przemek,
Thank you for your response.
I was under impression that what I asking for is very trivial and common functionality and Atlassian definitely should work on providing it. TeamCity has it.
What I am looking for is this:
http://my-ci-server:8080/bamboo/browse/PROJECT/latestSuccessful/artifact/SUBPROJECT/Tarball/PROJECT-0.1.BUILDNUMBER.tgz
Tarball is already created and above is the location where the file is. What makes it complicated is to get latest successful build number. That is right before the .tgz. I can go as far as:
http://my-ci-server:8080/bamboo/browse/PROJECT/latestSuccessful/artifact/SUBPROJECT/Tarball/<br< a=""> /> which will display the artifact in the HTML format. Of course I can parse the html, but I am looking for more stable way to handle this.
Right now I am parsing this url to get my latest successful build:
http://my-ci-server:8080/bamboo/rest/api/latest/result/PROJECT?buildstate=Successful&max-results=1
and constructing my url based on the result to look like this:
http://my-ci-server:8080/bamboo/browse/PROJECT-BUILDNUMBER/artifact/SUBPROJECT/Tarball/PROJECT-0.1.BUILDNUMBER.tgz
What I really need is to be able to directly access link like this:
http://my-ci-server:8080/bamboo/browse/PROJECT/latestSuccessful/artifact/SUBPROJECT/Tarball/PROJECT-0.1.LATEST-SUCCESSFUL-BUILDNUMBER.tgz</span<>>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. Bamboo Command Line Interface does this for instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bob. Unfortunately, I am completely ignorant about Bamboo Command Line Interface. What I am trying to do is to write a bash script that gets the file using wget or curl through url like: /bamboo/browse/CMS-CMSS/latestSuccessful/artifact/XXXXXX/Tarball/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Longer answer. Yes, it is possible to get a specific artifact from a specific build or from the latest build. The rest apis are documented here: http://confluence.atlassian.com/display/BAMBOODEV/Bamboo+REST+Resources . There are some release specific differences, make sure you get the right level of document. The Bamboo CLI shields you from that and would be easy to call from your script :). But you can roll your own too. If you use the -v option on the getArtifact action it will show you the URL you need. Or just construct the URL from the documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could also look at the source for hints, but it covers more generic cases, so is a bit more difficult - https://bitbucket.org/bob_swift/bamboo-cli/src/7087bc062a93/src/main/java/org/swift/bamboo/cli/BambooClient.java
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.