Skip to content

Instantly share code, notes, and snippets.

@robb1e
Created June 17, 2010 09:50
Show Gist options
  • Save robb1e/441917 to your computer and use it in GitHub Desktop.
Save robb1e/441917 to your computer and use it in GitHub Desktop.
<target name="staging.deploy">
<echo message="Stopping the server"/>
<exec executable="${staging.directory}/etc/init.d/${staging.startstop}" dir="${staging.directory}">
<arg line="stop"/>
</exec>
<echo message="Cleaning the environment"/>
<exec executable="grails">
<env key="JAVA_HOME" value="/usr/lib/jvm/java-6-sun/"/>
<arg line="clean"/>
</exec>
<echo message="Starting the server"/>
<exec executable="${staging.directory}/etc/init.d/${staging.startstop}" dir="${staging.directory}" spawn="true">
<env key="BUILD_ID" value="dontKillMe" />
<env key="JAVA_HOME" value="/usr/lib/jvm/java-6-sun/"/>
<arg line="start"/>
</exec>
<echo message="Checking and waiting on port ${staging.port}"/>
<waitfor maxwait="120" maxwaitunit="second" checkevery="5" checkeveryunit="second" timeoutproperty="deploy.failed">
<socket server="localhost" port="${staging.port}"/>
</waitfor>
<fail if="deploy.failed" message="Timed out waiting for deploy"/>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment