Skip to content

Commit

Permalink
Use default maven settings file for release
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed Aug 14, 2024
1 parent 447a726 commit 012a7d7
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,32 @@ pipeline {
stage('Deploy drools') {
steps {
script {
withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
def installOrDeploy
if (shouldDeployToRepository()) {
installOrDeploy = "deploy -DdeployAtEnd -Dapache.repository.username=${REPOSITORY_USER} -Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5"
} else {
installOrDeploy = 'install'
}
def mavenCommand = getMavenCommand()
.withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : [])
.withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : [])
.withProperty('maven.test.failure.ignore', true)
.skipTests(params.SKIP_TESTS)

if (isRelease()) {
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mavenCommand.withProfiles(['apache-release'])
}

def installOrDeploy
if (shouldDeployToRepository()) {
installOrDeploy = 'deploy -DdeployAtEnd -DretryFailedDeploymentCount=5'
} else {
installOrDeploy = 'install'
}
def mavenCommand = getMavenCommand()
.withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : [])
.withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : [])
.withProperty('maven.test.failure.ignore', true)
.skipTests(params.SKIP_TESTS)

if (isRelease()) {
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mavenCommand.withProfiles(['apache-release'])
} else {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean $installOrDeploy")
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
}
withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
mavenCommand
.withProperty('apache.repository.username', "${REPOSITORY_USER}")
.withProperty('apache.repository.password', "${REPOSITORY_TOKEN}")
}
}
mavenCommand.run("clean $installOrDeploy")
}
}
post {
Expand Down

0 comments on commit 012a7d7

Please sign in to comment.