update_server.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /bin/bash
  2. region=$1 # 区域类型,决定切换哪个分支 thailand 或者test360
  3. source=/server/source # 服务器资源 用于更新最新的git代码地址
  4. serverBasePath=/data/server/server/bin1 # 服务器base地址,需要手动更换
  5. #git账号和密码
  6. usename="mf527"
  7. password="Cdw19930527"
  8. echo enter source path
  9. if [ ! -d "$source" ];
  10. then
  11. mkdir -p "$source"
  12. fi
  13. cd $source
  14. if [ ! -d "congkong" ];
  15. then
  16. git clone -b ${region} https://${usename}:${password}@gitee.com/wangwenfan/congkong.git
  17. fi
  18. cd congkong
  19. #git checkout $region
  20. git pull
  21. # 将主要脚本同步过去
  22. cp -rf ${source}/congkong/script/common ${serverBasePath}/script/common
  23. #cp -rf ${source}/congkong/script/excel ${serverBasePath}/script/excel
  24. cp -rf ${source}/congkong/script/module ${serverBasePath}/script/module
  25. # 进入source地址 更新git
  26. ## -- congkong
  27. ## -- script
  28. ## -- common
  29. ## -- excel
  30. ## -- module
  31. ## -- docs
  32. ## -- gm
  33. ## -- webServer
  34. ## 复制git下面的代码 到 bin中 cp -rf