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

[10.0.x] NO-ISSUE: Disable generate-code-tests goal and fixes for the release job #3121

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
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
66 changes: 29 additions & 37 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ pipeline {
}
steps {
script {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
if (getDroolsVersion()) {
maven.mvnSetVersionProperty(getOptaplannerMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), 'version.org.drools', getDroolsVersion())
}
maven.mvnVersionsSet(getOptaplannerMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), getProjectVersion(), !isRelease())
if (getDroolsVersion()) {
maven.mvnSetVersionProperty(getOptaplannerMavenCommand(), 'version.org.drools', getDroolsVersion())
}
maven.mvnVersionsSet(getOptaplannerMavenCommand(), getProjectVersion(), !isRelease())
mavenCleanInstallOptaPlannerParents()
updateQuickstartsVersions()
}
Expand Down Expand Up @@ -173,12 +171,16 @@ pipeline {
stage('Build Quickstarts') {
steps {
script {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerQuickstartsMavenCommand()
withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerQuickstartsMavenCommand()
.withProperty('maven.test.failure.ignore', true)
.skipTests(params.SKIP_TESTS)
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.withProperty('apache.repository.username', REPOSITORY_USER)
.withProperty('apache.repository.password', REPOSITORY_TOKEN)
.run('clean install')
}
}
}
}
Expand Down Expand Up @@ -270,14 +272,20 @@ void sendErrorNotification() {
}
}

List getIntegrationTestProfiles() {
return params.SKIP_INTEGRATION_TESTS ? [] : ['integration-tests']
}

void updateQuickstartsVersions() {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
maven.mvnSetVersionProperty(getOptaplannerQuickstartsMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), 'version.org.optaplanner', getProjectVersion())
maven.mvnVersionsUpdateParentAndChildModules(getOptaplannerQuickstartsMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), getProjectVersion(), !isRelease())
maven.mvnSetVersionProperty(getOptaplannerQuickstartsMavenCommand(), 'version.org.optaplanner', getProjectVersion())
maven.mvnVersionsUpdateParent(getOptaplannerQuickstartsMavenCommand(), getProjectVersion(), !isRelease())

withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
maven.mvnVersionsUpdateChildModules(
getOptaplannerQuickstartsMavenCommand()
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.withProperty('apache.repository.username', REPOSITORY_USER)
.withProperty('apache.repository.password', REPOSITORY_TOKEN),
!isRelease()
)
}
}

gradleVersionsUpdate(quickstartsFolder, getProjectVersion())
Expand All @@ -291,6 +299,7 @@ void updateQuickstartsVersions() {
'cat', returnStdout: true)
}
}

if (isCreatePr()) {
dir(quickstartsFolder) {
// TODO: Remove the exclusion after the kubernetes demo is migrated to 9.
Expand Down Expand Up @@ -411,36 +420,19 @@ MavenCommand getOptaplannerQuickstartsMavenCommand() {
* Builds the parent modules and the BOM so that project depending on these artifacts can resolve.
*/
void mavenCleanInstallOptaPlannerParents() {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerMavenCommand()
withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerMavenCommand()
.skipTests(true)
.withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom', '-am'])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.withProperty('apache.repository.username', REPOSITORY_USER)
.withProperty('apache.repository.password', REPOSITORY_TOKEN)
.run('clean install')
}
}
}

void runMavenDeploy(MavenCommand mvnCmd, String localDeploymentId = '') {
mvnCmd = mvnCmd.clone()

if (localDeploymentId) {
mvnCmd.withLocalDeployFolder(getLocalDeploymentFolder(localDeploymentId))
} else if (env.MAVEN_DEPLOY_REPOSITORY) {
mvnCmd.withDeployRepository(env.MAVEN_DEPLOY_REPOSITORY)
}

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

String getMavenRepoZipUrl() {
return "${params.MAVEN_DEPLOY_REPOSITORY.replaceAll('/content/', '/service/local/').replaceFirst('/*$', '')}/content-compressed"
}

// Getters and Setters of params/properties

boolean shouldDeployToRepository() {
Expand Down
3 changes: 2 additions & 1 deletion optaplanner-operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
<!-- Disabled for the Apache 10 release as it was causing errors during the operator build
<goal>generate-code-tests</goal>-->
</goals>
</execution>
</executions>
Expand Down
Loading