buildall.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/usr/bin/env bash
  2. #update
  3. echo "update server"
  4. cd ../rocommon
  5. git checkout -- *
  6. git pull
  7. cd ../roserver
  8. git checkout -- *
  9. git pull
  10. runPath=/root/roserverrun
  11. runZone=2
  12. runRemoteZone=1000
  13. remotePath=/root/roserverremote
  14. echo "build server"
  15. echo "[db]"
  16. go build -race -o run/db -gcflags '-N -l' ./db
  17. echo "[game]"
  18. go build -race -o run/game -gcflags '-N -l' ./game
  19. echo "[gate]"
  20. go build -race -o run/gate -gcflags '-N -l' ./gate
  21. echo "[auth]"
  22. go build -race -o run/auth -gcflags '-N -l' ./auth
  23. echo "[social]"
  24. go build -race -o run/social -gcflags '-N -l' ./social
  25. #echo "[server_aoi]"
  26. #go build -race -o run/server_aoi -gcflags '-N -l' ./server_aoi
  27. #echo "[server_map_router]"
  28. #go build -race -o run/server_map_router -gcflags '-N -l' ./server_map_router
  29. echo "[battleboss]"
  30. go build -race -o run/battleboss -gcflags '-N -l' ./battleboss
  31. echo "[rank]"
  32. go build -race -o run/rank -gcflags '-N -l' ./rank
  33. echo "[guild]"
  34. go build -race -o run/guild -gcflags '-N -l' ./guild
  35. echo "[gmweb]"
  36. go build -race -o run/gmweb -gcflags '-N -l' ./gmweb
  37. echo "[battlerecord]"
  38. go build -race -o run/battlerecord -gcflags '-N -l' ./battlerecord
  39. echo "[crossrouter]"
  40. go build -race -o run/crossrouter -gcflags '-N -l' ./cross_router
  41. echo "[crossserver]"
  42. go build -race -o run/crossserver -gcflags '-N -l' ./cross_server
  43. echo "[crossrank]"
  44. go build -race -o run/crossrank -gcflags '-N -l' ./cross_rank
  45. echo "[gcrossrouter]"
  46. go build -race -o run/gcrossrouter -gcflags '-N -l' ./globalcross_router
  47. echo "[gcrossmap]"
  48. go build -race -o run/gcrossmap -gcflags '-N -l' ./globalcross_map
  49. #elf files
  50. cp -fr ./run/* $runPath
  51. cp -fr ./run/* $remotePath
  52. #config files
  53. cp -fr ./config/csv $runPath/config
  54. cp -fr ./config/csv $remotePath/config
  55. cp -fr ./config/xml $runPath/config
  56. cp -fr ./config/xml $remotePath/config
  57. #start stop shell script
  58. cp -fr ./start.sh $runPath
  59. cp -fr ./start.sh $remotePath
  60. #set start zone id
  61. cd $runPath
  62. sed -i "s/\zone: [0-9]*\S*/zone: ${runZone}/" *.yaml
  63. sed -i "/dbindex:/,+d" *.yaml
  64. cd $remotePath
  65. sed -i "s/\zone: [0-9]*\S*/zone: ${runRemoteZone}/" *.yaml
  66. sed -i "s/etcdaddr: [0-9]*\S*/etcdaddr: 127.0.0.1:2379/" *.yaml
  67. sed -i "s/redisaddr: [0-9]*\S*/redisaddr: [127.0.0.1:6379]/" *.yaml
  68. sed -i "s/reconnect: 0\S*/reconnect: 1/" *.yaml
  69. #sed -i "s/authmode: 1/authmode: 2/g" *.yaml
  70. #sed -i "s/192.168.10.158:3306/172.17.0.1:3306/g" *.yaml
  71. #测试服务器
  72. sed -i "s/192.168.10.158:3306/123.57.16.238:3306/g" *.yaml
  73. sed -i "s/127.0.0.1:9200/172.17.0.1:9200/g" *.yaml
  74. sed -i "/dbindex:/,+d" *.yaml