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:
BUILDROOT="${bamboo.capability.build-dir}/${bamboo.buildKey}"
I get the error on running the task:
Unable to find executable at ${BUILDROOT}/vendor/bin/phpunit.bat
Any help would be appreciated.
You can't use the bamboo variable in the executable path but there are work arounds.
1. Use a script task
2. Make a custom executable for your purpose at an absolute location ex. C:\RunPhpUnit.bat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Peter,
Are you trying to define the PHPUnit executable path for the task as ${bamboo.build.working.directory}\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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I substitute ${bamboo.build.working.directory} in my executable, I see the following in the build log -
Unable to find executable at ${bamboo.build.working.directory}\vendor\bin\phpunit.bat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you just use ${bamboo.build.working.directory}?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I defined the executable as
${BUILDROOT}/vendor/bin/phpunit.bat
I also tried
%BUILDROOT%/vendor/bin/phpunit.bat
to no avail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.