#!/bin/sh cd /app export PORT=2233 export webClient=https://risk.kirito.cool export serverPort=5000 export listenAddress=0.0.0.0 export apiServer=https://risk.kirito.cool function run(){ if [ ! -e $1 ] then git clone git@gogs.kirito.cool:panqihua/$1.git isUpdate=false else isUpdate=true fi cd $1 && git reset --hard && git pull && yarn && chmod +x run.sh && killNode if [ $isUpdate ] then url="http://127.0.0.1:3000/finsh?name=$1" echo "成功回调地址:$url" curl $url fi } #检查是否正在部署 command ="ps -ef|grep 'updateRisk $1'|awk 'NR>1{next}{print $1}'" echo $command result=${command} echo $result if [ ! -z $result ] then echo "检测到自动部署$1进程在运行,直接kill掉" kill -9 $result fi run $1