Bambo OnDemand SSH Task permission problem ?


Here is my situation :

In Bamboo OnDemand, I am setting up a simple deployment project with a SSH task.

The task is responsible for pulling the source code from a Bitbucket Account to the target server (linux) in the web root drectory, and then for triggering PHPUnit tests on this new code.

To accomplish this, the SSH Task basically runs the following commands, and is set up with connexion using a user (john) and his password :

cd /path-to-web-root/
git pull origin master
phpunit --configuration tests/phpunit_conf.xml --log-junit tests/phpunit_report.xml

Results :

the pulling is ok.

the phpunit commands leads to the following error :

"/usr/bin/env: php: No such file or directory"

Please notice that :

(1) If I replay the same scenario but with root user, phpunit is properly executed.

(2) If I run the same phpunit command as in the SSH Task, directly from the server command line, logged in as user john, phpunit also works.

(3) phpunit is installed on the target server via the "phar" file, and is version 3.7.37

(4) on the target server, php is here : /usr/local/php5.5.6/bin/php5php

I really don't get why it works in one case and not the other.

Any help possible on this one ?

It looks like a permission problem, or a path problem... I don't know I am really not a server expert



1 answer

1 accepted

So, I reply to myself :

The problem was simply that the PATH variable was different from user root and user john, so it couldn't find phpunit...

hope it will help someone :)

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