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

0 votes
Accepted answer

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.

Hi, can anyone help me here, please?

Thanks, I never thought of that!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

120 views 3 4
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