Using Build Artifacts to copy selected files and directories

We are using Bamboo 5.2 to build and (eventually) deploy Git-based applications managed by Stash 2.8

After an application is built, there are a number of files in different directories that we wish to make available in a central build area. I want the resultant directory structure to match the original, but only with selected contents. Typically this may include most but not all built files in a bin directory (e.g. an EXE, all DLLs but no other files), and some database and installation scripts in other directories within the working directories, which have been put there by the initial Git clone operation.

Having consulted your documentation and other Answers, I have tried the Build Artifacts functionality, defining a (rather long) copy pattern "*/*/*/bin/Release/*.*" , but this has just copied all the binary files, including some I didn't want. In order to also copy the scripts, I tried a second artifact definition "*/*/Database/**" which located and copied all the desired files, but deposited them in a directory structure separate from the built files, with each structure path headed by the Artifact definition name.

Is the Build Artifact functionality the best way of achieving this? If so, how can I get all the items from the different areas to end up in the same directory structure? How can I exclude certain items from the operation?

If not, then is a script to perform the copy the best alternative? Or use of the SCP Task?

Eventually we will be moving on to using Bamboo for deployment, but I expect we will still want to make the build results available in this manner.

3 answers

1 accepted

This widget could not be displayed.

Create a script task that will move all the files into your desired directory structure and then define a single artifact that will just copy the whole thing.

This widget could not be displayed.

Hi, can anyone help me here, please?

This widget could not be displayed.

Thanks, I never thought of that!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

140 views 1 3
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