You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Byron Vonthal <By...@marketlive.com> on 2007/03/02 20:04:46 UTC
sshexec not picking up exit code
I'm using ant 1.7.0 with jsch-0.1.29
I do get back output but I don't get an outputproperty.
The BUILD FAILED yet it shows as BUILD SUCCESS.
How do I pickup that exit code? I've seen various solutions but none
seemed to work.
I'm calling a remote machine by using sshexec thru openSSH like this:
<target name = "sshexec">
<sshexec host="${servers.server.ipaddress}"
trust="yes"
username="${servers.server.sshUser}"
password="${servers.server.sshPwd}"
command="c:/ant/remoteAntScripts/bin/build.bat"
output="sshExecOut.txt"
outputproperty="sshExecOutProp.txt"
failonerror="true"
/>
</target>
The program on the remote server does this:
call ant -buildfile %XML_HOME%\remoteDeploy.xml --I've set this up to
<fail/>
echo ERRORLEVEL=%ERRORLEVEL%
echo Before exit 1
exit 1 --I tried 'exit /B 1' also
echo after exit 1
The output file shows this:
[sshexec] BUILD FAILED
[sshexec] C:\ant\remoteAntScripts\xml\remoteDeploy.xml:28: failed
deploy
[sshexec]
[sshexec] Total time: 1 second
[sshexec] ERRORLEVEL=1
[sshexec] Before exit 1
BUILD SUCCESSFUL