This commit is contained in:
2023-04-19 09:29:31 +08:00
parent cf199dfc01
commit c5e713c784
3 changed files with 129 additions and 11 deletions

22
update.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# 靜態編譯
go mod tidy
go build -o data/gameui-ai-server main.go
# 上传文件
scp ./data/gameui-ai-server root@47.103.40.152:~/gameui-ai-server_new
# 重啓服務
ssh root@47.103.40.152 '''
ps -ef | grep -v grep | grep ./gameui-ai-server;
if [ $? -eq 0 ]; then
echo "kill gameui-ai-server"
killall ./gameui-ai-server
fi
rm -rf ./gameui-ai-server;
mv ./gameui-ai-server_new ./gameui-ai-server;
nohup ./gameui-ai-server >> nohup-ai.out 2>&1 &
echo "start gameui-ai-server:8080 ok"
'''