fix(ci): use verified Jenkins SSH key path for deploy stage
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -85,18 +85,15 @@ pipeline {
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
withCredentials([sshUserPrivateKey(
|
||||
credentialsId: "${env.DEPLOY_SSH_CREDENTIAL_ID}",
|
||||
keyFileVariable: 'SSH_KEY',
|
||||
usernameVariable: 'SSH_USER'
|
||||
)]) {
|
||||
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}"
|
||||
@@ -150,7 +147,6 @@ ssh ${SSH_OPTS} "$SSH_USER@$APP_HOST" "docker inspect plesk-agency-portal --form
|
||||
EOF
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Smoke check') {
|
||||
|
||||
Reference in New Issue
Block a user