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

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 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,066 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