You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
riskshell/shell/updateRisk

35 lines
616 B

#!/bin/sh
#自动部署脚本
cd /app
source riskenv
function run(){
if [ ! -e $1 ]
then
git clone git@gogs.kirito.cool:panqihua/$1.git
isUpdate=1
else
isUpdate=0
fi
cd $1 && git reset --hard && git pull && yarn && chmod +x run.sh && killNode
if [ $isUpdate -eq 0 ]
then
url="http://127.0.0.1:3000/finsh?name=$1"
echo "成功回调地址:$url"
curl $url
fi
}
#检查是否正在部署
result=`ps -ef|grep 'updateRisk $1'|wc -l`
echo $result
if [ ! -z $result ]
then
echo "检测到自动部署$1进程在运行,直接kill掉"
kill -9 $result
fi
run $1