Reputation: 4022
I am very new to ANT and its working, so spare me if this question is too primitive :).
Background :
I have my TOMCAT and ANT set-up in my Windows Server.
I will have to build project in multiple remote target OS - AIX/HP/SUSE.
So I have created a set of plugins (.xml files having ANT code) and execute in sequence to attain the final build package.
Problem Description :
In the process of build execution, I need to execute some task in the remote machine (i.e AIX/HP/SUSE) servers and then based on the result, need to take action.
Like for example -
These mostly will be written in shell scripts (which can be run in all 3 OS) -will return 1 for failure and 0 for success.
Question :
How to execute "commands" in remote machine and capture the result from the Windows server using ANT? I know we can use telnet/write/read ANT commands for remote execution - but how to capture the result - like say output from shell script.
Or to be better, is there a way to execute the ANT plugin (xml) file remotely and capture the build failure/success result? Like ant -f <remoteMachine
> <passwd
> <path
> <file
>
Upvotes: 1
Views: 1554
Reputation: 78155
Suggest you consider using the Ant sshexec
task. You'll probably need to get the Ant-external JSch library to use it, unless you already have it. The sshexec
task can be set up to fail when the remote command fails, also you can capture the output from the remote command to a property.
Also, as you're new to Ant I suggest you browse the Ant tasks overview to get a feel for what Ant can do.
Upvotes: 1