用shell脚本自动部署项目
用shell脚本自动部署项目
自己写了一个,再次用的话,直接copy
#!/bin/bash #redeplory project #create by huangdengji 2016-09-22 16:41:22 projectDir='/u01/tomcat7070/webapps/' str=`ps -ef | grep tomcat7070` pid=`echo $str | awk '{print $2}'` echo 'tomcat7070 pid:'${pid} [ -f /home/jhnet/ROOT.war ] || { echo '/home/jhnet/ROOT.war not exist' exit 1 } kill -9 ${pid} if [ $? -eq 0 ] then echo "kill tomcat success!" else echo "kill tomcat fail!" fi path='/gxt_bak/'$(date +%Y%m%d%H%M) mkdir ${path} if [ $? -eq 0 ] then echo 'created dir:'${path}' success!' else echo 'created dir:'${path}' fail!' exit 1 fi mv ${projectDir}ROOT* ${path} if [ $? -eq 0 ] then echo 'project back to dir:'${path}' success!' else echo 'project back to dir:'${path}' fail!' exit 1 fi mv /home/jhnet/ROOT.war ${projectDir} if [ $? -eq 0 ] then echo 'deplory project to dir:'${projectDir}' success!' else echo 'deplory project to dir:'${projectDir}' fail!' exit 1 fi /u01/tomcat7070/bin/startup.sh echo 'starting tomcat7070 ...' tail -f /u01/tomcat7070/logs/catalina.out
相关推荐
huha 2020-10-16
laisean 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
以梦为马不负韶华 2020-10-20
JohnYork 2020-10-16
Julyth 2020-10-16
applecarelte 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
wangzhaotongalex 2020-09-22
流年浅滩 2020-10-23
liujianhua 2020-10-22
woaimeinuo 2020-10-21
tufeiax 2020-09-03
laisean 2020-09-01
vvu 2020-09-16
libao 2020-09-16
Yyqingmofeige 2020-08-18
zhushixia 2020-08-17