Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

#!/bin/bash

# Deploy the war

#sh $TOMCAT_HOME/bin/shutdown.sh

pkill -9 -f tomcat


echo "deleting old Dtr.war Dtr directory";

`rm -rf $TOMCAT_HOME/webapps/Dtr*`;
if [ $? -eq 0 ]; then
        echo "Dtr.war and Dtr directory has been removed successfully.";
        echo "Dtr.war is deploying... to tomcat container";
        cp target/Dtr-1.0-SNAPSHOT.war $TOMCAT_HOME/webapps/Dtr.war
        if [ $? -eq 0 ]; then
                echo "Dtr.war has been deployed successfully.";
                echo "freshing the catalina.out file";
                >$TOMCAT_HOME/logs/catalina.out;
                if [ $? -eq 0 ]; then
                        echo "catalina.out has been refreshed.";
                fi
                echo "tomcat container is being starting...";
                sh $TOMCAT_HOME/bin/startup.sh
                if [ $? -eq 0 ]; then
                        echo "tomcat container has been started successfully.";
                        echo "opening application logs";
                        #tail -f /home/ashikali/apache-tomcat-8.0.43/logs/catalina.out
                        tail -f $TOMCAT_HOME/logs/catalina.out
                else
                        echo "tomcat container is failed to start";
                fi
        else 
                echo "Dtr.war deployment failed.";
        fi
else 
        echo "Dtr.war or Dtr directory deletion failed.";
fi