Update .gitlab-ci.yml file

This commit is contained in:
2025-11-12 23:22:37 +01:00
parent b8706721d6
commit b2da706ca8

View File

@@ -75,3 +75,26 @@ deploy:production:
only: only:
- main - main
when: manual when: manual
ssh:diagnose:
stage: deploy
image: alpine:3.20
script:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
# zeige Fingerprint & public key (sollte zum KAS-Eintrag passen)
- echo "Public key derived from private key:"
- ssh-keygen -y -f ~/.ssh/id_ed25519 | tee /tmp/ci_pubkey.pub
- echo "Fingerprint:"; ssh-keygen -lf ~/.ssh/id_ed25519
# Hostkey anlernen
- ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts
# Sehr ausführlicher Login-Test (ohne Befehl)
- echo "Trying SSH with -vvv..."
- ssh -vvv -o IdentitiesOnly=yes -o PreferredAuthentications=publickey $DEPLOY_USER@$DEPLOY_HOST 'echo OK'
when: manual