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 #3272

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 19 additions & 6 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline {
stage('Initialize') {
steps {
script {
cleanWs()
cleanWs(disableDeferredWipeout: true)

if (params.DISPLAY_NAME) {
currentBuild.displayName = params.DISPLAY_NAME
Expand Down Expand Up @@ -95,7 +95,12 @@ pipeline {
maven.mvnSetVersionProperty(getMavenCommand(), 'version.org.kie', getDroolsVersion())

// Need artifacts available locally
getMavenCommand().withProperty('quickly').run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand()
.withProperty('quickly')
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
maven.mvnSetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), 'data-index-ephemeral.image', getDataIndexEphemeralReleaseImage())
}
}
Expand All @@ -112,7 +117,11 @@ pipeline {
if (params.SKIP_TESTS) {
mvnCmd.skipTests() // Conflict somehow with Python testing. If `skipTests={anyvalue}` is set, then exec plugin is not executed ...
}
mvnCmd.run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
mvnCmd
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}
}
}
Expand Down Expand Up @@ -196,7 +205,7 @@ pipeline {
}
cleanup {
script {
util.cleanNode('docker')
util.cleanNode()
}
}
}
Expand Down Expand Up @@ -286,7 +295,6 @@ void setDeployPropertyIfNeeded(String key, def value) {
MavenCommand getMavenCommand(String directory = '') {
directory = directory ?: getRepoName()
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID)
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
.inDirectory(directory)
.withProperty('full')
Expand All @@ -303,7 +311,12 @@ void runMavenDeploy(boolean localDeployment = false) {
mvnCmd.withDeployRepository(env.MAVEN_DEPLOY_REPOSITORY)
}

mvnCmd.skipTests(true).run('clean deploy')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
mvnCmd
.skipTests(true)
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean deploy')
}
}

String getMavenRepoZipUrl() {
Expand Down
4 changes: 2 additions & 2 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipeline {
stage('Initialization') {
steps {
script {
cleanWs()
cleanWs(disableDeferredWipeout: true)

if (params.DISPLAY_NAME != '') {
currentBuild.displayName = params.DISPLAY_NAME
Expand Down Expand Up @@ -73,7 +73,7 @@ pipeline {
}
cleanup {
script {
util.cleanNode('docker')
util.cleanNode()
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline {
stage('Initialization') {
steps {
script {
cleanWs()
cleanWs(disableDeferredWipeout: true)

sh 'printenv > env_props'
archiveArtifacts artifacts: 'env_props'
Expand All @@ -40,7 +40,12 @@ pipeline {
dir('drools') {
githubscm.checkoutIfExists('incubator-kie-drools', changeAuthor, changeBranch, 'apache', changeTarget, true)
sh '.ci/environments/update.sh quarkus-3'
getMavenCommand().withProperty('quickly').run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand()
.withProperty('quickly')
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}
}
}
Expand Down Expand Up @@ -70,10 +75,8 @@ pipeline {
}
}
post {
always {
script {
cleanWs()
}
cleanup {
cleanWs()
}
unsuccessful {
script {
Expand All @@ -93,6 +96,5 @@ String getGitAuthorCredsId() {

MavenCommand getMavenCommand() {
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID)
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
}
10 changes: 7 additions & 3 deletions .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ pipeline {
dir('drools') {
githubscm.checkoutIfExists('incubator-kie-drools', getGitAuthor(), getBuildBranch(), getBaseAuthor(), getBaseBranch(), true)
sh '.ci/environments/update.sh quarkus-3'
getMavenCommand().withProperty('quickly').run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand()
.withProperty('quickly')
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}
}
}
Expand Down Expand Up @@ -117,7 +122,7 @@ pipeline {

void clean() {
sh 'rm -rf ~/.rewrite-cache/'
util.cleanNode('docker')
util.cleanNode()
}

void sendErrorNotification() {
Expand Down Expand Up @@ -171,6 +176,5 @@ String getPRBranch() {

MavenCommand getMavenCommand() {
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID)
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
}
25 changes: 16 additions & 9 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
stage('Initialize') {
steps {
script {
cleanWs()
cleanWs(disableDeferredWipeout: true)

if (params.DISPLAY_NAME) {
currentBuild.displayName = params.DISPLAY_NAME
Expand All @@ -41,11 +41,14 @@ pipeline {
stage('Build Drools') {
steps {
script {
getMavenCommand(droolsRepo)
.withProperty('quickly')
.withOptions(env.BUILD_MVN_OPTS_UPSTREAM ? [ env.BUILD_MVN_OPTS_UPSTREAM ] : [])
.withOptions(env.DROOLS_BUILD_MVN_OPTS_UPSTREAM ? [ env.DROOLS_BUILD_MVN_OPTS_UPSTREAM ] : [])
.run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand(droolsRepo)
.withProperty('quickly')
.withOptions(env.BUILD_MVN_OPTS_UPSTREAM ? [ env.BUILD_MVN_OPTS_UPSTREAM ] : [])
.withOptions(env.DROOLS_BUILD_MVN_OPTS_UPSTREAM ? [ env.DROOLS_BUILD_MVN_OPTS_UPSTREAM ] : [])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}
}
}
Expand All @@ -56,7 +59,12 @@ pipeline {
maven.mvnSetVersionProperty(getMavenCommand(getRepoName()), 'version.org.kie', getDroolsVersion())

// Need artifacts available locally
getMavenCommand(getRepoName()).withProperty('quickly').run('clean install')
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
getMavenCommand(getRepoName())
.withProperty('quickly')
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
maven.mvnSetVersionProperty(getMavenCommand(getRepoName()).withOptions(['-pl :kogito-quarkus-workflow-common-deployment']), 'data-index-ephemeral.image', getDataIndexEphemeralImage())
}
}
Expand Down Expand Up @@ -84,7 +92,7 @@ pipeline {
}
cleanup {
script {
util.cleanNode('docker')
util.cleanNode()
}
}
}
Expand Down Expand Up @@ -146,7 +154,6 @@ String getGitAuthorCredsID() {

MavenCommand getMavenCommand(String directory) {
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID)
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
.inDirectory(directory)
}
Expand Down