This commit is contained in:
昔念
2026-01-30 00:04:20 +08:00
parent eaacbb01b5
commit 3cb0d5351c

View File

@@ -26,33 +26,33 @@ steps:
CNB_ACCK:
from_secret: CNB_ACCK
commands:
# 调试验证变量是否传递
- echo "🔍 调试当前环境变量列表筛选SSH相关"
- env | grep -i ssh || echo "⚠️ 无SSH相关环境变量"
# # 调试验证变量是否传递
# - echo "🔍 调试当前环境变量列表筛选SSH相关"
# - env | grep -i ssh || echo "⚠️ 无SSH相关环境变量"
# 系统初始化
- apt update -y
- apt install -y --no-install-recommends ca-certificates curl git openssh-client openssl libssl-dev
# # 系统初始化
# - apt update -y
# - apt install -y --no-install-recommends ca-certificates curl git openssh-client openssl libssl-dev
# 清理旧SSH文件严格配置权限
- rm -rf /root/.ssh/*
- mkdir -p /root/.ssh && chmod 700 /root/.ssh
- DEPLOY_KEY_FILE="$HOME/.ssh/deploy_key"
# # 清理旧SSH文件严格配置权限
# - rm -rf /root/.ssh/*
# - mkdir -p /root/.ssh && chmod 700 /root/.ssh
# - DEPLOY_KEY_FILE="$HOME/.ssh/deploy_key"
# 关键修复SSH密钥写入EOF内无缩进
- |
cat > /root/.ssh/id_ed25519 << EOF
$WOODPECKER_SSH_KEY
EOF
chmod 600 /root/.ssh/id_ed25519
echo "✅ ED25519密钥写入完成"
# # 关键修复SSH密钥写入EOF内无缩进
# - |
# cat > /root/.ssh/id_ed25519 << EOF
# $WOODPECKER_SSH_KEY
# EOF
# chmod 600 /root/.ssh/id_ed25519
# echo "✅ ED25519密钥写入完成"
# 添加GitHub主机密钥
- SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
- ssh-keyscan -H github.com > /root/.ssh/known_hosts
- chmod 600 /root/.ssh/known_hosts
- echo "🔍 ${#CI_REPO_CLONE_SSH_URL}调试: ${CI_REPO_CLONE_SSH_URL}"
# # 添加GitHub主机密钥
# - SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
# - ssh-keyscan -H github.com > /root/.ssh/known_hosts
# - chmod 600 /root/.ssh/known_hosts
# - echo "🔍 ${#CI_REPO_CLONE_SSH_URL}调试: ${CI_REPO_CLONE_SSH_URL}"
- git config --global core.compression 0
- export GIT_CONFIG_URL="https://cnb:$CNB_ACCK@cnb.cool/blzing/blazing"
- echo "🔍 $CNB_ACCK调试 $GIT_CONFIG_URL"