#!/bin/bash
path=/home/ubuntu
backpath=/home/work/back
#admin api web
servername="admin"
function updateVersion(){
makedirBack
backUpdateVersion
}
function backUpdateVersion(){
#修改servername 需要启动的服务
for i in $servername;
do
echo "kill $i is start ..............................."
ps -ef | grep qzo/$i | awk '{print $2}' | xargs kill
echo "kill $i is done,now start back $(date +%y%m%d) ...................................."
echo "$i back is start $(date +%y%m%d) ..............................."
mv $path/$i/webapps/xxxx-$i* $backpath/$(date +%y%m%d)
if [ $i == "admin" ]; then
mv $path/$i/webapps/vapi $backpath/$(date +%y%m%d)/$i
else
mv $path/$i/ROOT $backpath/$(date +%y%m%d)/$i
fi
echo "back $i is done,now start mv $(date +%y%m%d) ...................................."
mv $path/qzgull-$i.war $path/$i/webapps
sleep 3s
echo "mv $path/qzgull-$i.war is done,start project $(date +%y%m%d) ...................................."
$path/$i/bin/startup.sh
sleep 3s
echo "mv $i is done,start project $(date +%y%m%d) ...................................."
done
}
function makedirBack(){
if [ -d $backpath/$(date +%y%m%d) ]; then
echo "back $(date +%y%m%d) is exsit"
else
mkdir $backpath/$(date +%y%m%d)
echo "back $(date +%y%m%d) is building"
fi
}
updateVersion
Ubuntu tomcat工程一键发布
最新推荐文章于 2022-09-11 21:59:57 发布