Using Build Artifacts to copy selected files and directories

Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2013

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
Answer accepted
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2013

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.

0 votes
Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2013

Thanks, I never thought of that!

0 votes
Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2013

Hi, can anyone help me here, please?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events