dongzi3805 2016-09-15 15:16
浏览 65

Git Hook PHP脚本:没有输出

I have this Script php-pull-script.phpwritten:

<?php
  $output1 = shell_exec('git pull');
  $output2 = shell_exec('pkill java');
  $output3 = shell_exec('mvn package');
  $output4 = shell_exec('java -jar ./target/compute-0.0.1-SNAPSHOT.jar');

  echo "<pre>$output1</pre>";
  echo "<pre>$output2</pre>";
  echo "<pre>$output3</pre>";
  echo "<pre>$output4</pre>";
?>

When executing in shell, I am not seeing any output in order to verify that it is running. I am not sure at all it is working. Is there a better way to do this automation script?

  • 写回答

2条回答 默认 最新

  • dongyoucha0645 2016-09-15 15:25
    关注

    You might not be in the correct working directory. You may need to set that manually to make the commands run. Otherwise, those commands look right. Though you really should just have this set up as a shell script. PHP's not a good language for this sort of thing, and if you are calling this from a REST endpoint there are far better solutions like Jenkins.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置