bash脚本
脚本说明
SVN更新项目,Maven打包,关闭tomcat服务器,移动War包,开启服务器
#! /bin/bash
echo "checking out files from svn...."
svn up /data/webapps/myproject-api/source/myproject-api
echo "maven package...."
cd /data/webapps/myproject-api/source/myproject-api
mvn clean install package
echo "killing the tomcat process...."
pidlist=`ps -ef|grep /app/tomcat/myproject-api-tomcat/ | grep -v "grep"|awk '{print $2}'`
echo "tomcat Id list :$pidlist"
kill -9 $pidlist
echo "copy war file to tomcat..."
rm -rf /data/webapps/myproject-api/war/*
cp /data/webapps/myproject-api/source/myproject-api/target/myproject-api.war /data/webapps/myproject-api/war/ROOT.war
echo "starting tomcat..."
/app/tomcat/myproject-api-tomcat/bin/startup.sh&
命令说明
svn up :svn更新的意思
mvn clean install package : mvn打包命令
kill :杀线程命令