Ant-sshexec-执行远程服务器或本地脚本
1. 远程服务器
?
?
?
Reference:http://ant.apache.org/manual/Tasks/sshexec.html
?
Runs a command on a remote machine running SSH daemon.
Note:<sshexec host="${host}" username="${usr}" password="${pwd}" trust="true" command="pwd;./test.sh" outputproperty="output"/>
?
?
?
这样在后续的ant脚本中就可以用${output}来取得脚本的运行结果了。
?
<exec dir="${tools.dir}" executable="xx.sh或xx.bat或xx.exe" outputproperty="platform.type" />
?
?
<exec dir="${tools.dir}" executable="uname" outputproperty="platform"> <arg value="-s"></arg></exec>