Blame | Last modification | View Log | RSS feed
#!/bin/bash# Deploy the war#sh $TOMCAT_HOME/bin/shutdown.shpkill -9 -f tomcatecho "deleting old profitmandi-api.war profitmandi-api directory";echo "deleting old profitmandi-admin.war profitmandi-admin directory";`rm -rf $TOMCAT_HOME/webapps/profitmandi-api*`;if [ $? -ef 0 ]; thenecho "profitmandi-api.war and profitmandi-api directroy has been removed successfully.";elseecho "profitmandi-api.war and profitmandi-api directroy deletion failed.";fi`rm -rf $TOMCAT_HOME/webapps/profitmandi-admin*`;if [ $? -eq 0 ]; thenecho "profitmandi-admin.war and profitmandi-admin directory has been removed successfully.";echo "profitmandi-admin.war is deploying... to tomcat container";cp target/profitmandi-admin-0.0.1-SNAPSHOT.war $TOMCAT_HOME/webapps/profitmandi-admin.warif [ $? -eq 0 ]; thenecho "profitmandi-admin.war has been deployed successfully.";echo "freshing the catalina.out file";>$TOMCAT_HOME/logs/catalina.out;if [ $? -eq 0 ]; thenecho "catalina.out has been refreshed.";fiecho "tomcat container is being starting...";sh $TOMCAT_HOME/bin/catalina.sh startif [ $? -eq 0 ]; thenecho "tomcat container has been started successfully.";echo "opening application logs";tail -f /home/ashikali/apache-tomcat-8.0.43/logs/catalina.outelseecho "tomcat container is failed to start";fielseecho "profitmandi-admin.war deployment failed.";fielseecho "profitmandi-admin.war or profitmandi-admin directory deletion failed.";fi