Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21850 rajender 1
#!/bin/bash
2
 
3
# Deploy the war
4
 
5
#sh $TOMCAT_HOME/bin/shutdown.sh
6
 
7
pkill -9 -f tomcat
8
 
9
 
10
echo "deleting old Dtr.war Dtr directory";
11
 
12
`rm -rf $TOMCAT_HOME/webapps/Dtr*`;
13
if [ $? -eq 0 ]; then
14
	echo "Dtr.war and Dtr directory has been removed successfully.";
15
	echo "Dtr.war is deploying... to tomcat container";
16
	cp target/Dtr-1.0-SNAPSHOT.war $TOMCAT_HOME/webapps/Dtr.war
17
	if [ $? -eq 0 ]; then
18
		echo "Dtr.war has been deployed successfully.";
19
		echo "freshing the catalina.out file";
20
		>$TOMCAT_HOME/logs/catalina.out;
21
		if [ $? -eq 0 ]; then
22
			echo "catalina.out has been refreshed.";
23
		fi
24
		echo "tomcat container is being starting...";
25
		sh $TOMCAT_HOME/bin/startup.sh
26
		if [ $? -eq 0 ]; then
27
			echo "tomcat container has been started successfully.";
28
			echo "opening application logs";
29
			#tail -f /home/ashikali/apache-tomcat-8.0.43/logs/catalina.out
30
			tail -f $TOMCAT_HOME/logs/catalina.out
31
		else
32
			echo "tomcat container is failed to start";
33
		fi
34
	else 
35
		echo "Dtr.war deployment failed.";
36
	fi
37
else 
38
	echo "Dtr.war or Dtr directory deletion failed.";
39
fi