buildrobot.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. robotPath=/root/rorobot
  11. runZone=3
  12. rundbindex=4
  13. echo "build server"
  14. echo "[db]"
  15. go build -o run/db -gcflags '-N -l' ./db
  16. echo "[game]"
  17. go build -o run/game -gcflags '-N -l' ./game
  18. echo "[gate]"
  19. go build -o run/gate -gcflags '-N -l' ./gate
  20. echo "[auth]"
  21. go build -o run/auth -gcflags '-N -l' ./auth
  22. echo "[social]"
  23. go build -o run/social -gcflags '-N -l' ./social
  24. echo "[server_aoi]"
  25. go build -o run/server_aoi -gcflags '-N -l' ./server_aoi
  26. echo "[server_map_router]"
  27. go build -o run/server_map_router -gcflags '-N -l' ./server_map_router
  28. echo "[battleboss]"
  29. go build -o run/battleboss -gcflags '-N -l' ./battleboss
  30. echo "[rank]"
  31. go build -o run/rank -gcflags '-N -l' ./rank
  32. #elf files
  33. cp -fr ./run/* $robotPath
  34. #config files
  35. cp -fr ./config/csv $robotPath/config
  36. cp -fr ./config/xml $robotPath/config
  37. #start stop shell script
  38. cp -fr ./start.sh $robotPath
  39. cp -fr ./stop.sh $robotPath
  40. #set start zone id
  41. cd $robotPath
  42. sed -i "s/\zone: [0-9]*\S*/zone: ${runZone}/" *.yaml
  43. sed -i "s/etcdaddr: [0-9]*\S*/etcdaddr: 127.0.0.1:2379/" *.yaml
  44. sed -i "/dbindex:/,+d" *.yaml
  45. sed -i "s/redisaddr: [0-9]*\S*/redisaddr: [127.0.0.1:6379]\n dbindex: ${rundbindex}/" *.yaml
  46. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:61001/" aoi_config.yaml
  47. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:6401/" auth_config.yaml
  48. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:6201/" game_config.yaml
  49. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:61301/" battleboss_config.yaml
  50. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:6301/" db_config.yaml
  51. sed -i "s/addr: 0.0.0.0:5101\S*/addr: 0.0.0.0:6101/" gate_config.yaml
  52. sed -i "s/addr: 0.0.0.0:21001\S*/addr: 0.0.0.0:22002/" gate_config.yaml
  53. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:6601/" rank_config.yaml
  54. sed -i "s/addr: 0.0.0.0\S*/addr: 0.0.0.0:6501/" social_config.yaml