发布程序步骤

  • 2016-09-11
  • 浏览 (78)

网站发布步骤:
  1. git pull
  2. mvn clean package
  3. tomdeploy

tomdeploy 是一个部署脚本别名:alias tomdeploy='sh /home/jeff/work/tomcat_deploy.sh',脚本内容如下:

tomcatDir='/usr/soft/tomcat'

backupDir='/home/jeff/backup'

td=`date +"%Y%m%d_%H%M%S"`

baseDir="/home/jeff/work/seaxiang/target"

warFile="ROOT.war"


echo "backup file $tomcatDir/webapps/$warFile to $backupDir/$td-$warFile"

mv "$tomcatDir/webapps/$warFile" "$backupDir/$td-$warFile"

echo "copy file $baseDir/$warFile to $tomcatDir/webapps/"

cp "$baseDir/$warFile"  "$tomcatDir/webapps/"


echo "shutdown tomcat"

$tomcatDir/bin/shutdown.sh


echo "remove tomcat file"

rm -rf "$tomcatDir/work"

rm -rf "$tomcatDir/webapps/ROOT"

echo "startup tomcat"

$tomcatDir/bin/startup.sh
正文到此结束