Files
novalon-website/scripts/diagnosis/diagnose-cicd-issues.sh
T

49 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
echo "=========================================="
echo "CI/CD 问题诊断脚本"
echo "=========================================="
echo ""
echo "📋 问题1: Git LFS 配置检查"
echo "----------------------------------------"
if command -v git-lfs &> /dev/null; then
echo "✅ Git LFS 已安装"
git lfs version
else
echo "❌ Git LFS 未安装"
fi
if [ -f ".gitattributes" ]; then
echo "✅ .gitattributes 文件存在"
cat .gitattributes
else
echo "❌ .gitattributes 文件不存在(项目未使用LFS"
fi
echo ""
echo "📋 问题2: 环境变量检查"
echo "----------------------------------------"
echo "当前环境变量:"
echo " CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH:-未设置}"
echo " CI_COMMIT_SHA: ${CI_COMMIT_SHA:-未设置}"
echo " CI_COMMIT_MESSAGE: ${CI_COMMIT_MESSAGE:-未设置}"
echo " CI_COMMIT_AUTHOR: ${CI_COMMIT_AUTHOR:-未设置}"
echo " CI_PIPELINE_NUMBER: ${CI_PIPELINE_NUMBER:-未设置}"
echo " CI_REPO_ID: ${CI_REPO_ID:-未设置}"
echo ""
echo "📋 问题3: Woodpecker CI 配置验证"
echo "----------------------------------------"
if command -v python3 &> /dev/null; then
echo "运行 Python 诊断脚本..."
python3 diagnose-woodpecker.py 2>/dev/null || echo "诊断脚本执行失败"
else
echo "⚠️ Python3 未安装,跳过配置验证"
fi
echo ""
echo "=========================================="
echo "诊断完成"
echo "=========================================="