blob: 314898c4bd998f9f391cc3b4553c32e8828aa406 [file] [log] [blame]
/*
* This file is describing all the Jenkins jobs in the DSL format (see https://plugins.jenkins.io/job-dsl/)
* needed by the Kogito pipelines.
*
* The main part of Jenkins job generation is defined into the https://github.com/kiegroup/kogito-pipelines repository.
*
* This file is making use of shared libraries defined in
* https://github.com/kiegroup/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl.
*/
import org.kie.jenkins.jobdsl.model.JobType
import org.kie.jenkins.jobdsl.utils.JobParamsUtils
import org.kie.jenkins.jobdsl.KogitoJobTemplate
import org.kie.jenkins.jobdsl.KogitoJobUtils
import org.kie.jenkins.jobdsl.Utils
jenkins_path = '.ci/jenkins'
Map getMultijobPRConfig() {
return [
parallel: true,
buildchain: true,
jobs : [
[
id: 'optaplanner-quickstarts',
primary: true,
env : [
BUILD_MVN_OPTS_CURRENT: '-Dfull',
OPTAPLANNER_BUILD_MVN_OPTS_UPSTREAM: '-Dfull',
MIGRATE_TO_9: Utils.isMainBranch(this)
]
]
],
]
}
// Optaplanner PR checks
KogitoJobUtils.createAllEnvironmentsPerRepoPRJobs(this) { jobFolder -> getMultijobPRConfig() }
// Init branch
createSetupBranchJob()
// Nightlies
setupSpecificBuildChainNightlyJob('native')
setupSpecificBuildChainNightlyJob('quarkus-main')
setupSpecificBuildChainNightlyJob('quarkus-branch')
setupSpecificBuildChainNightlyJob('quarkus-lts')
setupSpecificBuildChainNightlyJob('native-lts')
// Tools
KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'optaplanner-quickstarts', [
properties: [ 'version.io.quarkus' ],
compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ],
], [
// Escaping quotes so it is correctly handled by Json marshalling/unmarshalling
regex: [ 'id \\"io.quarkus\\" version', 'def quarkusVersion =' ]
])
void setupSpecificBuildChainNightlyJob(String envName) {
KogitoJobUtils.createNightlyBuildChainBuildAndTestJobForCurrentRepo(this, envName, true)
}
void createSetupBranchJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-quickstarts', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'OptaPlanner Quickstarts Setup Branch')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
jobParams.env.putAll([
REPO_NAME: 'optaplanner-quickstarts',
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
stringParam('DISPLAY_NAME', '', 'Setup a specific build display name')
stringParam('BUILD_BRANCH_NAME', "${GIT_BRANCH}", 'Set the Git branch to checkout')
stringParam('OPTAPLANNER_VERSION', '', 'OptaPlanner version to set.')
booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.')
}
}
}