80 lines
2.3 KiB
Bash

#!/usr/bin/env bash
#update
#echo "update server"
#cd ../rocommon
#git checkout -- *
#git pull
#cd ../roserver
#git checkout -- *
#git pull
runPath=/data/roserver/roserverrun
runZone=2
runRemoteZone=1001
remotePath=/data/roserver/roserverremote
echo "build server"
echo "[db]"
go build -o run/db -gcflags '-N -l' ./db
echo "[game]"
go build -o run/game -gcflags '-N -l' ./game
echo "[gate]"
go build -o run/gate -gcflags '-N -l' ./gate
echo "[auth]"
go build -o run/auth -gcflags '-N -l' ./auth
echo "[social]"
go build -o run/social -gcflags '-N -l' ./social
echo "[server_aoi]"
go build -o run/server_aoi -gcflags '-N -l' ./server_aoi
#echo "[server_map_router]"
#go build -race -o run/server_map_router -gcflags '-N -l' ./server_map_router
echo "[battleboss]"
go build -o run/battleboss -gcflags '-N -l' ./battleboss
echo "[rank]"
go build -o run/rank -gcflags '-N -l' ./rank
echo "[guild]"
go build -o run/guild -gcflags '-N -l' ./guild
echo "[gmweb]"
go build -o run/gmweb -gcflags '-N -l' ./gmweb
echo "[battlerecord]"
go build -o run/battlerecord -gcflags '-N -l' ./battlerecord
echo "[crossrouter]"
go build -race -o run/crossrouter -gcflags '-N -l' ./cross_router
echo "[crossserver]"
go build -race -o run/crossserver -gcflags '-N -l' ./cross_server
DATE=`date +%Y%m%d-%H:%M:%S`
echo "Version: 0.1.3.9 ${DATE}" > run/version_date.txt
#elf files
cp -fr ./run/* $runPath
cp -fr ./run/* $remotePath
#config files
cp -fr ./config/csv $runPath/config
cp -fr ./config/csv $remotePath/config
cp -fr ./config/xml $runPath/config
cp -fr ./config/xml $remotePath/config
#start stop shell script
cp -fr ./start.sh $runPath
cp -fr ./start.sh $remotePath
#set start zone id
#cd $runPath
#sed -i "s/\zone: [0-9]*\S*/zone: ${runZone}/" *.yaml
#sed -i "/dbindex:/,+d" *.yaml
#
#cd $remotePath
#sed -i "s/\zone: [0-9]*\S*/zone: ${runRemoteZone}/" *.yaml
#sed -i "s/etcdaddr: [0-9]*\S*/etcdaddr: 127.0.0.1:2379/" *.yaml
#sed -i "s/redisaddr: [0-9]*\S*/redisaddr: [127.0.0.1:6379]/" *.yaml
#sed -i "s/reconnect: 0\S*/reconnect: 1/" *.yaml
##sed -i "s/authmode: 1/authmode: 2/g" *.yaml
##sed -i "s/192.168.10.158:3306/172.17.0.1:3306/g" *.yaml
#测试服务器
#sed -i "s/192.168.10.158:3306/123.57.16.238:3306/g" *.yaml
#sed -i "s/127.0.0.1:9200/172.17.0.1:9200/g" *.yaml
#sed -i "/dbindex:/,+d" *.yaml