之前在使用Jenkins执行远程shell脚本时,出现提示java: command not found:多方查找原因后发现是因为远程执行shell脚本时,不会自动加载环境变量,导致出现此错误,解决方案就是在脚本前加上这段代码即可source /etc/profile; source /etc/profile cd /root/shell sh erp-shop-h5-server.sh
经常要部署多台服务器上面的应用,如果一个个机器的登录太麻烦. 所有就想到编写一个脚本来部署不同的服务器 前提条件: 配置ssh免登陆 如果不会的请参加我的另外一篇文章 http://blog.csdn.net/chenpy/article/details/30281515 两个错误: Pseudo-terminal will not be allocated because stdin is not a terminal.使用ssh -t -t 可以解决 另外一个问题Agent admitted