From 6d7020b5c4cfa8277027cef38e048981778e6529 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Thu, 2 Apr 2026 10:52:55 -0500 Subject: [PATCH] Add DEV_SERVER_USER credential handling in Jenkinsfile Updated the Jenkinsfile to include a new credential for the development server user, enhancing the flexibility of user management during deployment. The SSH user variable now defaults to this new credential if available, improving security and maintainability. --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca8b37fd..109c43f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -219,6 +219,7 @@ pipeline { steps { withCredentials([ usernamePassword(credentialsId: 'harbor-credentials', usernameVariable: 'HARBOR_USERNAME', passwordVariable: 'HARBOR_PASSWORD'), + string(credentialsId: 'dev-server-user', variable: 'DEV_SERVER_USER'), string(credentialsId: 'dev-server-host', variable: 'DEV_SERVER_HOST'), sshUserPrivateKey( credentialsId: 'dev-server-ssh', @@ -230,7 +231,7 @@ pipeline { def remote = [ name: 'dev-server', host: env.DEV_SERVER_HOST, - user: env.DEV_SERVER_SSH_USER, + user: env.DEV_SERVER_USER ?: env.DEV_SERVER_SSH_USER, identityFile: env.DEV_SERVER_KEY, allowAnyHosts: true ]