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

Merged
robbond merged 1 commits from fix/cl9-use-known-good-jenkins-key-path into master 2026-03-07 10:38:52 +00:00
Showing only changes of commit 164e97618e - Show all commits

14
Jenkinsfile vendored
View File

@@ -85,18 +85,15 @@ pipeline {
stage('Deploy') {
steps {
withCredentials([sshUserPrivateKey(
credentialsId: "${env.DEPLOY_SSH_CREDENTIAL_ID}",
keyFileVariable: 'SSH_KEY',
usernameVariable: 'SSH_USER'
)]) {
sh '''
sh '''
bash <<EOF
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"
echo "SSH user from credential: ${SSH_USER}"
echo "SSH user from configured deploy key: ${SSH_USER}"
echo "SSH key file path: ${SSH_KEY}"
ls -l "${SSH_KEY}"
ssh-keygen -y -f "${SSH_KEY}"
@@ -148,8 +145,7 @@ ssh ${SSH_OPTS} "$SSH_USER@$APP_HOST" \
echo "Printing final running container image metadata"
ssh ${SSH_OPTS} "$SSH_USER@$APP_HOST" "docker inspect plesk-agency-portal --format='{{.Image}} {{.Created}}'"
EOF
'''
}
'''
}
}