简体   繁体   English

如何使用sshexec任务调用另一个蚂蚁并获得预期结果?

[英]How to use sshexec task to call another ant and get expected result?

Here is the scenario : 这是场景:

An ant script is launched on computer1, logged on computer2 using sshexec ant task to call a shell script that calls itself another ant script. 在计算机1上启动一个蚂蚁脚本,并使用sshexec蚂蚁任务在计算机2上登录,以调用自身称为另一个蚂蚁脚本的外壳脚本。

The main script looks like 主脚本看起来像

<target ...>
  <sshexec host="*" username="*" password="*" command="someShellScript.sh" />
</target>

The remote script is basic : 远程脚本是基本的:

#!/bin/sh
setting some env vars
ant buildfile.xml 

All scripts are correctly executed, but when the remote build fails, the main Ant script return BUILD SUCCESSFUL instead of FAILED. 所有脚本均已正确执行,但是当远程构建失败时,主Ant脚本将返回BUILD SUCCESSFUL而不是FAILED。

I guess it uses the result of the sh script. 我猜它使用了sh脚本的结果。

Is there a way to get the second Ant script result ? 有没有办法获得第二个Ant脚本结果? But maybe, there is a better way to achieve this ? 但是,也许有更好的方法来实现这一目标?

Thanks 谢谢

Self answering : 自我回答:

it comes from a bug in ant.bat 它来自ant.bat中的错误

See this answer 看到这个答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM