Skip to content

Commit

Permalink
Revert "Use default maven settings file for release (#6047)" (#6048)
Browse files Browse the repository at this point in the history
This reverts commit 1320d83.
  • Loading branch information
rodrigonull authored Aug 15, 2024
1 parent f349826 commit d59145e
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -114,32 +114,28 @@ pipeline {
stage('Deploy drools') {
steps {
script {
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)
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'])
}
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}")

configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean $installOrDeploy")
}
}
mavenCommand.run("clean $installOrDeploy")
}
}
post {
Expand Down

0 comments on commit d59145e

Please sign in to comment.