Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#667: fix cleanup and settingsXml handling #613

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {
stage('Initialize') {
steps {
script {
cleanWs()
cleanWs(disableDeferredWipeout: true)

if (params.DISPLAY_NAME) {
currentBuild.displayName = params.DISPLAY_NAME
Expand All @@ -45,17 +45,34 @@ pipeline {
stage('Build OptaPlanner parents') {
steps {
script {
getMavenCommand(optaplannerRepo)
.withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom,org.optaplanner:optaplanner-operator', '-am'])
.run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand(optaplannerRepo)
.withOptions([
'-U',
'-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom,org.optaplanner:optaplanner-operator',
'-am'
])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}
}
}
stage('Update project version') {
steps {
script {
maven.mvnSetVersionProperty(getMavenCommand(getRepoName()), 'version.org.optaplanner', getOptaPlannerVersion())
maven.mvnVersionsUpdateParentAndChildModules(getMavenCommand(getRepoName()), getOptaPlannerVersion(), true)
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
maven.mvnSetVersionProperty(
getMavenCommand(getRepoName()).withSettingsXmlFile(MAVEN_SETTINGS_FILE),
'version.org.optaplanner',
getOptaPlannerVersion()
)
maven.mvnVersionsUpdateParentAndChildModules(
getMavenCommand(getRepoName()).withSettingsXmlFile(MAVEN_SETTINGS_FILE),
getOptaPlannerVersion(),
true
)
}

dir(getRepoName()) {
sh "find . -name build.gradle -exec sed -i -E 's/def optaplannerVersion = \"[^\"\\s]+\"/def optaplannerVersion = \"${getOptaPlannerVersion()}\"/' {} \\;"
Expand Down Expand Up @@ -89,7 +106,7 @@ pipeline {
}
cleanup {
script {
util.cleanNode('docker')
util.cleanNode()
}
}
}
Expand Down Expand Up @@ -136,6 +153,5 @@ String getGitAuthorCredsID() {

MavenCommand getMavenCommand(String directory) {
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID)
.inDirectory(directory)
}
Loading