On Fri, Mar 5, 2010 at 6:41 PM, Antoine Levy Lambert <anto...@gmx.de> wrote: > Hello Kaushal, > > the easiest is to install ant on the remote host and kick off ant remotely, > maybe from another ant process. > > ant can do all what you want (backing up, copying, deleting, ...). Just open > the manual. > > Maybe develop/test your deployment script on the server where tomcat is > running first. > > When you get it to do what you want, start invoking it remotely. > > If the remote invocation is from ant, you can do it using the <sshexec/> > task. > > If you need to pass parameters to the deployment scripts running on the > tomcat host, then use -D on the command line > > for instance you can do something like > > <sshexec host="tomcat.host" .... command=". ~/.profile; /opt/ant/bin/ant -f > deploy.xml -Dtomcat.warfile=/tmp/abc.war"/> > > (complete the password or identity file attributes of sshexec as > appropriate). > > Regards, > > Antoine > > > Kaushal Shriyan wrote: >> >> On Fri, Mar 5, 2010 at 10:55 AM, Kaushal Shriyan >> <kaushalshri...@gmail.com> wrote: >> >>> >>> On Thu, Mar 4, 2010 at 6:57 PM, Antoine Levy Lambert <anto...@gmx.de> >>> wrote: >>> >>>> >>>> Hi, >>>> >>>> If you want to start/stop tomcat using a script on a remote server, >>>> maybe >>>> you need to use the <sshexec/> task, >>>> assuming you have a ssh server on the remote server. >>>> >>>> Regards, >>>> >>>> Antoine >>>> >>> >>> Thanks Antoine :) >>> >>> >> >> Hi, >> >> We face issues whenever we deploy application using tomcat manager we >> used to face the situation where new >> changes were not reflected. On stopping, cleaning work folder and >> starting tomcat again application used to get deployed properly. But >> to restart and clean we need to ssh again on the machine where we want >> to deploy defeating our main purpose. >> >> Also one more issue we have faced is we are not able to locate the new >> war file where Tomcat manager has deployed it >> >> We need to have a tool that does the following on specified remote hosts >> >> 1. stop the tomcat >> 2. back up the existing war >> 3. remove existing wars and folders and copy the new war >> 4. start the tomcat again >> >> Are the above steps possible using ant or is there a better and >> efficient way to do it ? >> >> Please suggest/guide. >> >> Thanks and Regards, >> >> Kaushal >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > >
Hi again, I have couple of questions: <target name="stop-tomcat"> <!-- Executes remote command via ssh --> <sshexec host="host0072.example.com" username="kaushal" password="xxxxxx" trust="true" command="sudo /etc/init.d/tomcat0 start" /> </target> the password field is exposed here. is there a way to secure it. ? Also when i run the command ant -lib lib/ stop-tomcat the string "command="sudo /etc/init.d/tomcat start"" asks for password again on the stdout. is there a way to handle this condition since i need to start tomcat server as tomcat user. Thanks and Regards, Kaushal --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org