init-backend.sh 961 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # 克隆 go-kit 仓库(如果不存在)
  3. echo ""
  4. if [ ! -d "/workspace/dev/backend/work/go-kit" ]; then
  5. echo "正在克隆 go-kit 仓库..."
  6. if git clone root@git.ooo.ink:root/go-kit.git /workspace/dev/backend/work/go-kit; then
  7. echo "✅ go-kit 仓库克隆完成"
  8. else
  9. echo "❌ go-kit 仓库克隆失败"
  10. exit 1
  11. fi
  12. else
  13. echo "✅ go-kit 仓库已存在,跳过克隆"
  14. fi
  15. echo ""
  16. # 安装 MySQL CLI 工具
  17. echo ""
  18. if [ -f "/workspace/shell-kit/setup-mysql-cli.sh" ]; then
  19. chmod +x /workspace/shell-kit/setup-mysql-cli.sh
  20. /workspace/shell-kit/setup-mysql-cli.sh
  21. else
  22. echo "⚠️ 警告:MySQL CLI 安装脚本不存在,跳过 MySQL CLI 安装"
  23. fi
  24. echo ""
  25. # 安装 gentool 工具
  26. echo ""
  27. if [ -f "/workspace/shell-kit/setup-gentool.sh" ]; then
  28. chmod +x /workspace/shell-kit/setup-gentool.sh
  29. /workspace/shell-kit/setup-gentool.sh
  30. else
  31. echo "⚠️ 警告:gentool 安装脚本不存在,跳过 gentool 安装"
  32. fi
  33. echo ""