I try to organize the deployment from the repository with the subsequent rolling, but any commands related do not cure anything, only git pull works.

In theory, exec() returns everything that was output as a result of the command.

I test the command directly from the terminal - the log is written, the command is executed. Trying to execute the command with the help of a hook - returns nothing .

What could be wrong? Maybe you need to do something from the server?

Test hook code:

 exec("cd /home/user/.local/bin/node-v0.12.7-linux-x64/bin/ && npm -v", $output); foreach($output as $value) { echo $value . '; '; } 

Accordingly, instead of the npm version, I get nothing in the body.

  • The third parameter exec can catch the shutdown status of the program. Perhaps not enough rights to perform. You may need to specify the full path to npm - ilyaplot
  • The full path indicated the same thing. I caught the third parameter, but this did not add to the point, only pull is performed, the rest is omitted. As I understand it - the problem is still in the rights? - lamartire
  • The script on which name is executed? - ilyaplot
  • From a regular user. - lamartire

0