#适用于更新GOSKU代码服务,并且重启代码
#!/bin/bash
Cur_Dir=$(pwd)
echo $Cur_Dir
cd $Cur_Dir
git reset --hard HEAD
branch_name = $(git name-rev --name-only HEAD)
echo branch_name
git pull origin branch_name
#rm -f ${Cur_Dir}"/cmd/http/http"
export GO111MODULE=on
export CGO_ENABLED=0
go env -w GOPROXY=https://goproxy.cn,direct
go build -o ${Cur_Dir}"/cmd/http/http"   ${Cur_Dir}"/cmd/http/http_server.go"
chmod +x ${Cur_Dir}"/cmd/http/http"
go build -o ${Cur_Dir}"/cmd/cron/cron"   ${Cur_Dir}"/cmd/cron/cron_server.go"
chmod +x ${Cur_Dir}"/cmd/cron/cron"
chmod +x ${Cur_Dir}"/update.sh"
supervisorctl restart go_sku_server_60014:*
echo "更新执行成功"