Using Bamboo variables on Windows,

I am trying to run the PHPUnit command in the code my Bamboo job has checked out.

Using advice in another post I set a custom capability: build_dir=D:\bamboo\xml-data\build-dir.

Then in my task I set an environment variable:

I get the error on running the task:
Unable to find executable at ${BUILDROOT}/vendor/bin/phpunit.bat

Any help would be appreciated.

5 answers

1 accepted

You can't use the bamboo variable in the executable path but there are work arounds.

1. Use a script task

  • Long way to illustrate a point other might need. Inline script: ${}\vendor\bin\phpunit.bat
  • Short way and more proper, script file vendor\bin\phpunit.bat

2. Make a custom executable for your purpose at an absolute location ex. C:\RunPhpUnit.bat

  • Allows control and audit of server capabilities
  • Add ${} to the arguments each time it is used and use it inside your script to execute what you really what.

Agreed - for all the reasons you state.

I just come cross this issue as well. I think it should be very handy to allow using bamboo variable in executable path.


Are you trying to define the PHPUnit executable path for the task as ${}\vendor\bin\phpunit.bat ?

If that's the case then that's probably not going to work. The executable path needs to be an absolute path. So in our case, we define MSBuild task path to be "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe".

Thanks. That clarifies things. It's a learning curve.

I want to use the PHPUnit installation that is kept alongside the project, managed by composer. I will probably have similar requirements. I will make a small collection of build command scripts at a fixed path which my projects can use.

Also, I will install some more standard build tools e.g. a default PHPUnit and Composer.

I'll try to summarise things in an answer later, but for now things look good.

I defined the executable as


I also tried


to no avail.

Can you just use ${}?

When I substitute ${} in my executable, I see the following in the build log -

Unable to find executable at ${}\vendor\bin\phpunit.bat.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,814 views 0 6
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