2 Commits
Author SHA1 Message Date
ucef 390c547920 fix(ci): prioritize /root/.ssh/gitea_ci_key mount
AS Talange CI/CD Pipeline / Deploy to Test Environment (push) Successful in 2m23s
AS Talange CI/CD Pipeline / Build & Run Unit Tests (push) Successful in 4m56s
2026-09-03 14:29:20 +02:00
ucef 2d390b553d fix(ci): mount /home/ubuntu/.ssh and auto-detect gitea_ci_key location 2026-09-03 14:26:53 +02:00
+7 -8
View File
@@ -128,7 +128,8 @@ jobs:
docker run --rm --net=host \
-v "$(pwd):/workspace" -w /workspace \
-v "${HOME}/.ssh:/root/.ssh:ro" \
-v "/root/.ssh:/root/.ssh:ro" \
-v "/home/ubuntu/.ssh:/home/ubuntu/.ssh:ro" \
-e TARGET_HOST="${TARGET_HOST}" \
-e TARGET_USER="${TARGET_USER}" \
-e PORT="${PORT}" \
@@ -136,13 +137,11 @@ jobs:
alpine:latest sh -c '
apk add --no-cache openssh-client rsync && \
KEY_ARG="" && \
if [ -f /root/.ssh/gitea_ci_key ]; then \
KEY_ARG="-i /root/.ssh/gitea_ci_key -o IdentitiesOnly=yes" ; \
elif [ -f /root/.ssh/id_ed25519 ]; then \
KEY_ARG="-i /root/.ssh/id_ed25519 -o IdentitiesOnly=yes" ; \
elif [ -f /root/.ssh/id_rsa ]; then \
KEY_ARG="-i /root/.ssh/id_rsa -o IdentitiesOnly=yes" ; \
fi && \
for k in /root/.ssh/gitea_ci_key /home/ubuntu/.ssh/gitea_ci_key /root/.ssh/id_ed25519 /root/.ssh/id_rsa; do \
if [ -f "$k" ]; then \
KEY_ARG="-i $k -o IdentitiesOnly=yes" && break ; \
fi ; \
done && \
SSH_CMD="ssh -p ${PORT} ${KEY_ARG} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=15" && \
echo "Deploying backup script and .env to DB Server (${TARGET_USER}@${TARGET_HOST}:${DEST_DIR})..." && \
$SSH_CMD "${TARGET_USER}@${TARGET_HOST}" "mkdir -p ${DEST_DIR}/scripts" && \