Skip to content

Instantly share code, notes, and snippets.

<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>
NAME=projectname
PORT=port
ENVIRONMENT=staging
URI=$NAME.$ENVIRONMENT
DIRECTORY=/mnt/apps/$ENVIRONMENT/$NAME
case "$1" in
start)
lsof -i :$PORT
if [ $? -eq 0 ]; then
java -jar -Dhudson.util.ProcessTreeKiller.disable=true hudson.war