sync-modules.sh 1015 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # set -x
  3. # 执行 checkout
  4. yarn checkout $@
  5. branch=$1
  6. currentPath=$(dirname $0)
  7. sync(){
  8. local moduleName=$1; shift
  9. local path=$1; shift
  10. { # try
  11. echo
  12. cd $currentPath/$path
  13. git fetch origin && \
  14. git pull origin $branch && \
  15. # 不显示输出
  16. cd - 2>&1 >/dev/null && \
  17. echo "\033[32m [$moduleName] rebase 完成 \033[0m"
  18. } || { # catch
  19. echo "\033[31m [$moduleName] rebase 发生错误,请手动执行rebase \033[0m"
  20. }
  21. }
  22. sync 'dashboard' ../
  23. sync 'dashboard-module-common' ../src
  24. sync 'dashboard-module-cloudenv' ../containers/Cloudenv
  25. sync 'dashboard-module-compute' ../containers/Compute
  26. sync 'dashboard-module-dashboard' ../containers/Dashboard
  27. sync 'dashboard-module-network' ../containers/Network
  28. sync 'dashboard-module-storage' ../containers/Storage
  29. sync 'dashboard-module-k8s' ../containers/K8S
  30. sync 'dashboard-module-helm' ../containers/Helm
  31. sync 'dashboard-module-db' ../containers/DB
  32. sync 'dashboard-module-monitor' ../containers/Monitor
  33. exit 0