jenkins 自动部署脚本 自动启停tomcat并部署项目
jenkins 自动部署脚本备份:自动启停tomcat 清空缓存 部署war包export ENV=DEVexport JAVA_HOME=/usr/local/jdk1.6.0_45export DEPLOYMENT_HOME=/root/toDeploy/userportalexport USERPORTAL_HOME=/usr/local/apache-tomcat-userpor
·
jenkins 自动部署脚本备份:自动启停tomcat 清空缓存 部署war包
export ENV=DEV
export JAVA_HOME=/usr/local/jdk1.6.0_45
export DEPLOYMENT_HOME=/root/toDeploy/userportal
export USERPORTAL_HOME=/usr/local/apache-tomcat-userportal
export DATASERVER_HOME=/usr/local/apache-tomcat-dataserver
echo "[Deploy] Shutting down Userportal"
if [ `ps auxwwww|grep tomcat-userportal|grep -v grep|wc -l` -gt 0 ]
then
for pid in `ps auxwww|grep tomcat-userportal|grep -v grep|tr -s ' '|cut -d ' ' -f2`
do
kill -9 $pid 2>&1 > /dev/null
done
fi
echo "[Deploy] Shutting down Dataserver"
if [ `ps auxwwww|grep tomcat-dataserver|grep -v grep|wc -l` -gt 0 ]
then
for pid in `ps auxwww|grep tomcat-dataserver|grep -v grep|tr -s ' '|cut -d ' ' -f2`
do
kill -9 $pid 2>&1 > /dev/null
done
fi
echo "[Deploy] Cleaning cache for Userportal"
rm -rf $USERPORTAL_HOME/work/Catalina/localhost/*
echo "[Deploy] Removing Userportal.war"
rm -rf $USERPORTAL_HOME/webapps/*
echo "[Deploy] Cleaning cache for Dataserver"
rm -rf $DATASERVER_HOME/work/Catalina/localhost/*
echo "[Deploy] Removing Dataserver.war"
rm -rf $DATASERVER_HOME/webapps/*
echo "[Deploy] Copying new Dataserver.war"
cp $DEPLOYMENT_HOME/iss-dataserver/target/Dataserver.war $DATASERVER_HOME/webapps/
echo "[Deploy] Copying new Userportal.war"
cp $DEPLOYMENT_HOME/iss-userportal/target/Userportal.war $USERPORTAL_HOME/webapps/
echo "[Deploy] Starting up Dataserver"
$DATASERVER_HOME/bin/startup.sh
echo "[Deploy] Starting up Userportal"
$USERPORTAL_HOME/bin/startup.sh
更多推荐
已为社区贡献3条内容
所有评论(0)