ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000

最近 ,用 swoole 搞了个服务端项目,以前都是 php-fpm 项目,

这次不同的是要有自己的启动脚本了。。。

然后也想用 jenkins 实现自动部署,于是问题来了,当 jenkins 执行完所有命令后不没有终止,而是:

 一直转圈  其实已经执行完了。

出现这种情况应该是 jenkins 无法判断命令是否执行完成,于是各方搜索,有说是命令最后要通过 

exit 0 表示成功,exit 1 表示失败

经测试 无效。。。

后来找到了这个解释:

Since you are executing a script from a non-TTY environment; The Jenkins is not able to get the exit properly, out of your script.(https://stackoverflow.com/questions/11290540/jenkins-text-finder-unable-to-success-my-build/22011893#22011893

大概是:你在一个non-TTY环境执行脚本,导致 jenkins 不能正确的得到脚本的 exit 从而退出脚本

解决办法是 :

点击高级选项

给 pty 打上勾;

果然问题解决。。。

但是,为什么会出现这个问题还没搞清楚,因为之前的 php-fpm 项目都不需要勾这个,两者之间的主要区别就是:

之前是:service php-fpm restart

我的是:sh start.sh ;  sh stop.sh

难道是系统 service 有什么不同?

猜你喜欢

转载自my.oschina.net/u/2399303/blog/1821437