Create a build artifact?

I am having trouble understanding the documentation. I want the plan to create a file and have it presented in some way in a UI so that a human can click somewhere and get the file.

In a stage artifact definition, does artifact location mean the place where my build will put artifacts? Or is there some mysterious mechanism by which bamboo puts files in that location?

What is the copy expression relative to? If it's generic bamboo location blah, how does my script find out where that is so it knows to deposit files there for bamboo to copy, if that is necessary?

2 answers

1 accepted

The copy pattern is required, so I do need it. It is an inclusion pattern.

It appears that:

out/some-file

doesn't work, because the pattern is relative to the location.

Any of these work:

some-file

**/*

*

This does not:

out/*

 

https://confluence.atlassian.com/display/BAMBOO/Configuring+a+job%27s+build+artifacts

I missed this in the documentation:

  • The location is relative to the build directory. Do not use the absolute path to refer to the location.
  • The copy pattern is relative to the location specified.

"The build directory" is ${bamboo_agentWorkingDirectory}.${bamboo.buildKey}

Your build script puts the artifact into the specified location (as opposed to your build script needing to expect it to have been put there by some builtin task).

0 vote
Timothy Chin Community Champion Feb 28, 2015

In a stage artifact definition, does artifact location mean the place where my build will put artifacts? Or is there some mysterious mechanism by which bamboo puts files in that location?

Whatever your build generates in the Tasks tab can be defined as an artifact in the Artifacts tab. You just need to give it a name, place to find it and what regex to find the artifact.

The place to find it and what regex to find the artifact is the part I am asking about.

 

Do I put the artifact there? Or do I find the artifact there?

 

I've tried using this definition, e.g.:

Location: out

Copy pattern: out/some-file

 

My build script puts some-file in ${bamboo_agentWorkingDirectory}.${bamboo.buildKey}/out

After the build, the file is there, but the result of the build says the job created no artifacts.

 

If Location means the place where Bamboo put the artifacts (somehow), I have no idea what value that would be.

Timothy Chin Community Champion Mar 01, 2015

You need to understand the difference between "Location" and "regex". If you already specify the location, you don't need to add the location in your regex.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,096 views 0 5
Read article

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