Created
January 18, 2012 21:59
-
-
Save scottsbaldwin/1636069 to your computer and use it in GitHub Desktop.
Deploy script for a war on tomcat 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" == "" ] | |
then | |
echo "Usage: $0 [dir]" | |
exit 1 | |
fi | |
if [ ! -e "$1/MYWAR.war" ] | |
then | |
echo "$1/MYWAR.war does not exist!" | |
exit 1 | |
fi | |
TOMCAT=/usr/share/apache-tomcat-6.0.32 | |
echo "Stopping tomcat..." | |
sudo /etc/init.d/tomcat stop | |
# make sure tomcat has fully stopped | |
sleep 5 | |
echo "Removing existing web app" | |
sudo rm -rf ${TOMCAT}/webapps/MYWAR ${TOMCAT}/webapps/MYWAR.war | |
echo "Copying $1/MYWAR.war to ${TOMCAT}/webapps" | |
cp $1/MYWAR.war ${TOMCAT}/webapps | |
echo "Starting tomcat" | |
sudo /etc/init.d/tomcat start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment