Download the artifact from bamboo using wget. Edited

Hi,

I am using wget to download bamboo artifact using the below command,

wget --http-user='userName' --http-password='*****' 'http://localhost/rest/api/latest/plan/AP-BAF/artifact?os_authType=basic' --no-check-certificate

where AP-BAF is the build plan and that plan has two stages and each stage produce artifacts.I want to download these two artifacts.

When I enter this command in command prompt,it shows the below output,

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><artifacts expand="artifa
cts"><link href="http://localhost/rest/api/latest/plan/AP-BAF
/artifact" rel="self"/><artifacts start-index="0" max-result="0" size="0"/></art
ifacts>

 

When i browse through bamboo and I can see the artifacts produced by the build.

Please help me as this is the high priority.

1 answer

I ended up hitting the login page to acquire valid cookies, then loading those cookies when I requested the artifacts I wanted.  I lost my original wget command (mainly because I typed my password out and didn't want that in my history).  But it was something like below:

Edit: I had to do this query again so here's the working modified version -

wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate https://bamboo/userlogin\!default.action\?os_destination=%2Fstart.action\&os_username=myusername\&os_password=*****\&os_cookie=true

Then I wrote a bash for loop to grab the individual items I was interested in.

for f in 1.json 10.json 12.json 13.json 14.json 15.json 16.json 18.json 1
9.json 2.json 20.json 21.json 23.json 27.json 28.json 29.json 3.json 30.json 4.j
son 5.json 6.json 7.json 8.json consolidate.json cucumber.json; do wget --no-che
ck-certificate --load-cookies cookies.txt -p -A "*" https://bamboo/browse/OHH-AC
766-1/artifact/ACIR/Cucumber-JSON/$f; done

 I seem to recall it may have had some looping that seemed to be going on forever, but it may have been when I was using the -r flag or something. In any case it should work whether you use the for loop or not.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,345 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot