Capability to define custom Build Working Directories in bamboo

Currently in bamboo each stage runs in a seperate working directory.

for example if we set

buildWorkingDirectory = /home/supund/abc

inside the buildWorkingDirectory, it creates seperate directory for each stage as follows

<buildWorkingDirectory>/"<PROJECT_KEY>_<PLAN_KEY>_<STAGE_KEY>"

This is a bit tricky if we want two stages to run in the same directory.

We are having a pre-built system that builds and deploys all the components that we need, in single commands.

The issue being that this is already included in to git so when the code gets checked out, the script lies in the source directory. After building the components we use the same tool to deploy the test binaries to a test environment where we run seperate test suits.

The issue is that since the script is in the Checkout stage directory, we cannot have a seperate stage to spawn the test deploy since test deploy stage has a different build-working-dir.

If we can override the limitation of having seperate build-working-dir for each stage it becomes much easier. This is one of our concerns of 'build-working-dir' not being able to configure.

Is there a workaround for this ??

1 answer

Yes, copy the contents of the other folder into your cwd using a script command. You're not going to check it in so it won't matter in the long run and you'll have your stuff where you need it.

For example cp ${bamboo.build.working.directory}..\(name of other directory)\*.* ${bamboo.build.working.directory} usually gets the trick done for me.

We have several builds with repositories checked out from other places (runtime libraries etc.) Since the build working dir is a SVN workspace (in our case) you can't check out two repos to a single workspace (svn limitation) we have to do it this way.

It does cause a clean build but that's small price.

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