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:
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@@ -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: '''
|
||||
|
||||
Reference in New Issue
Block a user