Enhance Jenkinsfile to include passphrase handling for SSH key authentication. Added a passphrase variable for the development server SSH key, improving security during deployment processes.

This commit is contained in:
2026-04-02 11:00:37 -05:00
parent 6d7020b5c4
commit 36424a2e04

4
Jenkinsfile vendored
View File

@@ -224,7 +224,8 @@ pipeline {
sshUserPrivateKey(
credentialsId: 'dev-server-ssh',
keyFileVariable: 'DEV_SERVER_KEY',
usernameVariable: 'DEV_SERVER_SSH_USER'
usernameVariable: 'DEV_SERVER_SSH_USER',
passphraseVariable: 'DEV_SERVER_KEY_PASSPHRASE'
)
]) {
script {
@@ -233,6 +234,7 @@ pipeline {
host: env.DEV_SERVER_HOST,
user: env.DEV_SERVER_USER ?: env.DEV_SERVER_SSH_USER,
identityFile: env.DEV_SERVER_KEY,
passphrase: env.DEV_SERVER_KEY_PASSPHRASE,
allowAnyHosts: true
]
sshCommand remote: remote, command: '''