#! /bin/sh
# beego项目所在路径
path='/root/code/go/src/GoBigDataTestTool'
cd $path
git pull
go build
# 编译后的可执行文件
cmd='BigDataTestTool'
ps -ef | grep $cmd | grep -v grep | awk '{print $2}' | xargs kill -9
nohup ./BigDataTestTool >/dev/null 2>&1 &
pid=`ps -ef | grep $cmd | grep -v "grep" | awk '{print $2}'`
if [ "$pid" ]; then
echo "deploy success, pid is $pid"
else
echo "deploy fail"
fi
网友评论