498bb3a3c8
- Move CI/CD configs to config/ci/ directory - Reorganize scripts into categorized directories (deployment, monitoring, testing, utils) - Consolidate documentation into docs/ directory with proper structure - Update linting and testing configurations - Remove obsolete test reports and performance summaries - Add new documentation for code quality tools and contact form security - Improve project organization and maintainability - Fix lint-staged config to only lint JS/TS files - Disable react/react-in-jsx-scope rule for Next.js compatibility - Ignore scripts and test config directories in ESLint
45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
echo "🔧 监控和告警系统环境检查..."
|
|
|
|
# 检查 Docker
|
|
if ! command -v docker &> /dev/null; then
|
|
echo "❌ Docker 未安装"
|
|
echo "请访问 https://docs.docker.com/get-docker/ 安装 Docker"
|
|
exit 1
|
|
else
|
|
echo "✅ Docker 已安装: $(docker --version)"
|
|
fi
|
|
|
|
# 检查 Docker Compose
|
|
if ! command -v docker-compose &> /dev/null; then
|
|
echo "❌ Docker Compose 未安装"
|
|
echo "请运行: sudo curl -L \"https://github.com/docker/compose/releases/latest/download/docker-compose-\$(uname -s)-\$(uname -m)\" -o /usr/local/bin/docker-compose"
|
|
echo "然后运行: sudo chmod +x /usr/local/bin/docker-compose"
|
|
exit 1
|
|
else
|
|
echo "✅ Docker Compose 已安装: $(docker-compose --version)"
|
|
fi
|
|
|
|
# 检查端口占用
|
|
echo ""
|
|
echo "📊 检查端口占用情况..."
|
|
|
|
check_port() {
|
|
if lsof -Pi :$1 -sTCP:LISTEN -t >/dev/null 2>&1; then
|
|
echo "⚠️ 端口 $1 已被占用"
|
|
return 1
|
|
else
|
|
echo "✅ 端口 $1 可用"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
check_port 3000 # 应用服务
|
|
check_port 9090 # Prometheus
|
|
check_port 3001 # Grafana
|
|
check_port 9093 # Alertmanager
|
|
|
|
echo ""
|
|
echo "✅ 环境检查完成!"
|