ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Outputproperty in sshexec
Date Thu, 28 Jul 2005 00:34:58 GMT
Hi Anil, The sshexec task should fail if the exit status of your remote command is not zero.
Here is the output from a simple sshexec task where I try to cd to a directory that does not
exist:

$ ant sshtest
Buildfile: build.xml

sshtest:
  [sshexec] Connecting to localhost:22
  [sshexec] bash: line 1: cd: /poop/poop/poop: No such file or directory

BUILD FAILED
H:\build.xml:56: Remote command failed with exit status 1

Total time: 12 seconds

The outputproperty will capture the ouput from the remote command, not the exit status. If
you are running a script remotely, just make the script exit with the appropriate exit status
and your sshexec command will fail if it is not zero.

I hope this helps. Tell Barbara and everyone I say Hi.

-Rob Anderson

> -----Original Message-----
> From: Jacob, Anil - MWL [mailto:jacob.anil@menloworldwide.com]
> Sent: Tuesday, July 26, 2005 2:35 PM
> To: user@ant.apache.org
> Subject: Outputproperty in sshexec
> 
> 
> 
> I have an ssh task which executes a remote start command and 
> I am trying
> to get the exit status using outputproperty. However I notice that the
> outputproperty value is not being set. Any Idea's? here is a 
> part of my
> build.
> 
> <sshexec host="${remote.server}" username="${remote.user}"
> keyfile="${user.home}/.ssh/id_dsa" trust="true" command="xxxx"
> outputproperty="step4.out"/>
> <echo message="${step4.out}"/>
> </target>
> 
> <target name="stop.step5" depends="stop.step4">
> <if>
> <equals arg1="${step4.out}" arg2="0" />
> <then>
> <XXXXXX>
> 
> ---
> ${step4.out} is not being set at all. The ssh task executes fine.
> 
> Anil
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message