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.
35 lines
606 B
35 lines
606 B
#!/bin/sh
|
|
#自动部署脚本
|
|
|
|
#如果当前存在自动部署进程直接kill掉
|
|
if [ -e $1.pid ]
|
|
then
|
|
kill -9 `cat $1.pid`
|
|
if [ $? -eq 0 ]
|
|
then
|
|
echo "成功杀死进程:$pid"
|
|
rm -f $file
|
|
fi
|
|
fi
|
|
|
|
echo $$>$1.pid
|
|
|
|
cd /app
|
|
|
|
source riskenv
|
|
|
|
function run(){
|
|
if [ ! -e $1 ]
|
|
then
|
|
git clone git@gogs.kirito.cool:panqihua/$1.git
|
|
fi
|
|
cd $1 && git reset --hard && git pull && yarn && chmod +x run.sh && killNode
|
|
url="http://127.0.0.1:3000/finsh?name=$1"
|
|
echo "成功回调地址:$url"
|
|
curl $url
|
|
}
|
|
|
|
run $1
|
|
echo `pwd`
|
|
rm -f ../$1.pid
|
|
echo "脚本运行完毕,删除$1.pid"
|
|
|