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

0 votes
Accepted answer

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 votes
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 Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

230 views 4 1
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