1
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user