Skip to content

Commit

Permalink
#1464 fixes release pipeline to use managed credentials from jenkins …
Browse files Browse the repository at this point in the history
…ci for connecting to github and nexus
  • Loading branch information
tfr42 committed Dec 27, 2024
1 parent c7e1c9b commit 568284d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
pipeline {
agent {
label 'openjdk11bot'
}
options {
agent any
options {
disableConcurrentBuilds()
}
tools {
maven 'maven-3.9'
jdk 'temurin-jdk17'
git 'git-default'
}
environment {
MAVEN_OPTS='-Djava.awt.headless=true -Xmx4096m'
}
parameters {
string name: 'REL_VERSION', defaultValue: "3.5.x", description: 'Next release version'
string name: 'DEV_VERSION', defaultValue: "3.5.x-SNAPSHOT", description: 'Next snapshot version'
string name: 'REL_VERSION', defaultValue: "3.6.x", description: 'Next release version'
string name: 'DEV_VERSION', defaultValue: "3.6.x-SNAPSHOT", description: 'Next snapshot version'
booleanParam name: 'PERFORM_RELEASE', defaultValue: false, description: 'Perform release build (on main branch only)'
}
stages {
Expand Down Expand Up @@ -56,8 +55,7 @@ pipeline {
}
post {
always {
recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()]
recordIssues enabledForFailure: true, tool: spotBugs()
recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc(), spotBugs()]
}
}
}
Expand All @@ -70,7 +68,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 {
Expand All @@ -85,4 +89,4 @@ pipeline {
cleanWs notFailBuild: true
}
}
}
}

0 comments on commit 568284d

Please sign in to comment.