One issue is that you are running the second ant build on a different system, 
potentially, via ssh. The error may be transmitted to the shell that is 
running, but not transmitted back to the parent script. On the local system you 
may see the result of being able to issue the ssh command but not result of 
running the ant script. The docs are not clear on that. There is a difference 
in having the ability to run an ssh and the error results produced on the 
remote system during the ssh. From the target, you are issuing multiple 
commands on the remote system and not trapping the errors from any of them. 
Remember that the "cd" command can fail and you are not where you expect to be 
but the sshexec probably will not fail.

It may be easier to have your ant script on the remote machine write the 
success to a file and ftp it back to check the error status. Using a file based 
semaphore is often the best way to get status results since it is generally 
portable among operating systems. This can give you more granular information 
than just that an error has occurred.
 
Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)

----- Original Message ----
From: jpyork <[EMAIL PROTECTED]>
To: user@ant.apache.org
Sent: Monday, January 21, 2008 1:30:44 PM
Subject: RE: Halt Ant script question



This is the start of the target I use:

         <target name="deploy_War" description = "Copy war file to
environment">
        
                <scp
 file="../../../../../Builds/test/abc-${buildVersion}.war"
todir="${scp.url}" trust="true"/>

        
                     <sshexec host="${host.autodeploy}" trust="true"
                    username="${host.autodeploy.username}"
                    password="${host.autodeploy.pw}"
                    output="deploy.log"
                    append="true"
                    command="cd; 
                    
                    echo 'Starting Deployment';
                                                                       
                                                               
                                              
                    cd '/test/home/asadmin';                        
    
                                                                      
                                        
                    echo 'Triggering Deployment script on Server';
                    /opt/SUNWappserver/bin/asant
 -DbuildVersion=${buildVersion} -buildfile
deploy_build.xml;








Toomey, Kevin H (ATS, IT) wrote:
> 
> Can you give an example of how the first script is calling the
 second? Are
> you using <ant>, or <antcall>, or <excec>, or something else?
> 
> -----Original Message-----
> From: jpyork [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 21, 2008 11:58 AM
> To: user@ant.apache.org
> Subject: Halt Ant script question
> 
> 
> 
> I am running 2 scripts and my problem is when the first script runs
 and
> the
> calls the 2nd one, sometimes the 2nd one will fail and that does not
 cause
> my 1st one to fail.  
> 
> I am looking for a way to have my main script halt/fail if the 2nd
 script
> does not work.  What is the task to do this?
> -- 
> View this message in context:
>
 http://www.nabble.com/Halt-Ant-script-question-tp15001659p15001659.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
>
 *************************************************************************
> This communication, including attachments, is
> for the exclusive use of addressee and may contain proprietary,
> confidential and/or privileged information.  If you are not the
 intended
> recipient, any use, copying, disclosure, dissemination or
 distribution is
> strictly prohibited.  If you are not the intended recipient, please
 notify
> the sender immediately by return e-mail, delete this communication
 and
> destroy all copies.
>
 *************************************************************************
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context:
 http://www.nabble.com/Halt-Ant-script-question-tp15001659p15003355.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Reply via email to