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.
This commit is contained in:
2026-04-02 10:52:55 -05:00
parent d3318deb85
commit 6d7020b5c4

3
Jenkinsfile vendored
View File

@@ -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
]