Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,040
Community Members
 
Community Events
185
Community Groups

Download all artifacts from previous jobs

Is it possible to download the artifacts created by ALL previously executed jobs without specifying the exact artifact name?

I use spec branches to enable/disable jobs based on the branch type (f.e. release branches need to execute additional builds). At the end of the Pipeline I want to download all artifacts (number of artifacts can be different based on the branch type) and share them as an "all_artifacts" artifact. 

I am not able to use the download all aritfacts task because this task also demands the "all_artifacts" artifact. Is there any solution for this topic?

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 14, 2021 • edited Oct 15, 2021

Hello @Simon Beyer,

Welcome to Atlassian Community!

Your requirement is not possible to be achieved using standard tooling in Bamboo. You can possibly try extending Bamboo and run a series of scripts that will do that artifact parsing and download then.

For example:

To get information about a build, you can run a curl:

curl -X GET -uuser:pass -H "Accept: application/json" "https://bamboo.mydomain.net/rest/api/latest/result/BAM-SLEEP-34?expand=artifacts"

You can then parse the output of it using your favourite script/programing language and figure out what artifacts are carried with that build.

Then download them (date.txt is my artifact, for example):

curl -X GET -uuser:pass https://bamboo.mydomain.net/browse/BAM-SLEEP-34/artifact/shared/date/date.txt -o date.txt

Once you have all the artifacts you need you can then publish them as "all_artifacts" (as a folder with multiple files or as a single zip archive, your call)

The values of your projectKey-buildKey-buildNumber keys can be expanded in real-time from Bamboo variables:

E.g.

https://bamboo.mydomain.net/browse/${bamboo_planKey}-${bamboo_buildNumber}/artifact/shared/date/date.txt

It is also recommended that you store the values of your username and password or the PAT (personal access token) as encrypted strings in Bamboo.

 

Regards,

Eduardo Alvarenga
Atlassian Support APAC 

EDIT: sorry I posted this as answer.

Thank you. This looks promising. But I trouble with downloading the artifact. My artifacts contain multiple files and not just one like in your example. 

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 15, 2021 • edited

Once you query the artifacts, you will get a json output that can be parsed to get the name of all the artifacts of that build.

Then you can create another call in a loop to download each of them to your desired location.

Regards,

Eduardo Alvarenga
Atlassian Support APAC

Like Steffen Opel _Utoolity_ likes this

Thanks. But is there an easier way to get a list of all files which are included in on artifact? I am only able to receive the overview html page

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 18, 2021

If you want to have a list of files to be downloaded, you will need to parse that overview page.

You can alternatively use a script task to create a single zip file out of your all_artifacts folder, then you can focus on downloading a single zip file and unzipping it at the destination.

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events