other register

Tuesday, January 20, 2009

Remote Deploy Grails Application

Ant 1.6 or later support scp, ssh tasks.

Download the lastest ant.
Set ANT_HOME variable.
Add %ANT_HOME%\bin in the PATH variable (in Windows environment).

Download the JSch jar to the %ANT_HOME%\lib

Add the remote task in the build.xml in the Grails project:

<target name="remoteDeploy" depends="war" description="-->Deploy the war to the remote server">
<scp file="LockerJet.war" trust="yes" todir="username:password@remotehost:/PATH_TO_TOMCAT/webapps"/>

Note: set trust="yes", otherwise it will thrown "reject HostKey" or ""

Run the task by:

ant remoteDeploy


There is another Grails remote deploy using GANT post for reference.

No comments: