From f5febc743b11c624e2eddf97a97c0a20312a835f Mon Sep 17 00:00:00 2001 From: Torsten Friebe Date: Fri, 27 Dec 2024 19:24:34 +0100 Subject: [PATCH] fixes release pipeline to use managed credentials from jenkins ci for connecting to github and nexus --- Jenkinsfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 23a7738950..9334acff11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,7 +70,13 @@ pipeline { } steps { echo 'Prepare release version ${REL_VERSION}' - sh 'mvn -Dresume=false -DreleaseVersion=${REL_VERSION} -DdevelopmentVersion=${DEV_VERSION} -DdeployAtEnd=true -Dgoals=deploy release:prepare release:perform -P integration-tests,oracle,handbook' + withMaven(mavenSettingsConfig: 'mvn-server-settings', options: [junitPublisher(healthScaleFactor: 1.0)], publisherStrategy: 'EXPLICIT') { + withCredentials([usernamePassword(credentialsId:'nexus-deploy', passwordVariable: 'PASSWORD_VAR', usernameVariable: 'USERNAME_VAR')]) { + sshagent(credentials: ['jenkins-deegree-ssh-key']) { + sh 'mvn -Dresume=false -DreleaseVersion=${REL_VERSION} -DdevelopmentVersion=${DEV_VERSION} -Darguments="-Drepo.username=${USERNAME_VAR} -Drepo.password=${PASSWORD_VAR}" -DdeployAtEnd=true -Dgoals=deploy release:prepare release:perform -P integration-tests,oracle,handbook' + } + } + } } post { success { @@ -85,4 +91,4 @@ pipeline { cleanWs notFailBuild: true } } -} +} \ No newline at end of file