fix(ci): use verified Jenkins SSH key path for deploy stage

This commit is contained in:
2026-03-07 10:36:49 +00:00
parent 2bb78e9864
commit 164e97618e

10
Jenkinsfile vendored
View File

@@ -85,18 +85,15 @@ pipeline {
stage('Deploy') { stage('Deploy') {
steps { steps {
withCredentials([sshUserPrivateKey(
credentialsId: "${env.DEPLOY_SSH_CREDENTIAL_ID}",
keyFileVariable: 'SSH_KEY',
usernameVariable: 'SSH_USER'
)]) {
sh ''' sh '''
bash <<EOF bash <<EOF
set -euxo pipefail set -euxo pipefail
SSH_KEY="/var/lib/jenkins/.ssh/plesk_agency_deploy"
SSH_USER="deploy"
SSH_OPTS="-i ${SSH_KEY} -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" SSH_OPTS="-i ${SSH_KEY} -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
echo "SSH user from credential: ${SSH_USER}" echo "SSH user from configured deploy key: ${SSH_USER}"
echo "SSH key file path: ${SSH_KEY}" echo "SSH key file path: ${SSH_KEY}"
ls -l "${SSH_KEY}" ls -l "${SSH_KEY}"
ssh-keygen -y -f "${SSH_KEY}" ssh-keygen -y -f "${SSH_KEY}"
@@ -150,7 +147,6 @@ ssh ${SSH_OPTS} "$SSH_USER@$APP_HOST" "docker inspect plesk-agency-portal --form
EOF EOF
''' '''
} }
}
} }
stage('Smoke check') { stage('Smoke check') {