diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 34c8e411147..19430d4efa2 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -7,20 +7,13 @@ import org.kie.jenkins.jobdsl.Utils JENKINSFILE_PATH = '.ci/jenkins' def getDefaultJobParams() { - def jobParams = KogitoJobTemplate.getDefaultJobParams(this, 'kogito-runtimes') + def jobParams = KogitoJobUtils.getDefaultJobParams(this, 'kogito-runtimes') jobParams.pr.excluded_regions.add('docsimg/.*') return jobParams } def getJobParams(String jobName, String jobFolder, String jenkinsfileName, String jobDescription = '') { - def jobParams = getDefaultJobParams() - jobParams.job.name = jobName - jobParams.job.folder = jobFolder - jobParams.jenkinsfile = jenkinsfileName - if (jobDescription) { - jobParams.job.description = jobDescription - } - return jobParams + return KogitoJobUtils.getBasicJobParams(this, { return getDefaultJobParams() }, jobName, jobFolder, jenkinsfileName, jobDescription) } Map getMultijobPRConfig() { @@ -83,8 +76,15 @@ if (Utils.isMainBranch(this)) { setupQuarkusJob('main') } setupNativeJob() -setupDeployJob(FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY) -setupPromoteJob(FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY) +KogitoJobUtils.createBuildChainBranchJob(this, 'kogito-runtimes', FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY) +KogitoJobUtils.createDeployArtifactsJob(this, 'kogito-runtimes', FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY) +KogitoJobUtils.createUpdateVersionJob(this, 'kogito-runtimes', FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY, [ + versions: ['kogito'], + scripts: [ + update_version: 'scripts/update_version.groovy', + pipeline_checks: 'scripts/version_checks.groovy', + ] +]) // No release directly on main branch if (!Utils.isMainBranch(this)) { @@ -98,12 +98,12 @@ if (Utils.isLTSBranch(this)) { } // Tools job -KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'kogito-runtimes', 'Kogito Runtimes', [ +KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'kogito-runtimes', [ modules: [ 'kogito-dependencies-bom', 'kogito-build-parent', 'kogito-quarkus-bom' ], compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ], properties: [ 'version.io.quarkus', 'version.io.quarkus.quarkus-test-maven' ], ]) -KogitoJobUtils.createKie7UpdateToolsJob(this, 'kogito-runtimes', 'Kogito Runtimes', [ +KogitoJobUtils.createKie7UpdateToolsJob(this, 'kogito-runtimes', [ modules: [ 'kogito-kie7-bom' ], properties: [ 'version.org.kie7' ], ]) diff --git a/.ci/jenkins/scripts/update_version.groovy b/.ci/jenkins/scripts/update_version.groovy new file mode 100644 index 00000000000..89107141637 --- /dev/null +++ b/.ci/jenkins/scripts/update_version.groovy @@ -0,0 +1,5 @@ +void execute(def pipelinesCommon) { + maven.mvnVersionsSet(pipelinesCommon.getDefaultMavenCommand(), pipelinesCommon.getKogitoVersion(), !pipelinesCommon.isRelease()) +} + +return this diff --git a/.ci/jenkins/scripts/version_checks.groovy b/.ci/jenkins/scripts/version_checks.groovy new file mode 100644 index 00000000000..b93afa8409c --- /dev/null +++ b/.ci/jenkins/scripts/version_checks.groovy @@ -0,0 +1,13 @@ +void execute(def pipelinesCommon) { + if (pipelinesCommon.isRelease() || pipelinesCommon.isCreatePr()) { + // Verify version is set + assert pipelinesCommon.getKogitoVersion() + + if (pipelinesCommon.isRelease()) { + // Verify if on right release branch + assert pipelinesCommon.getGitBranch() == util.getReleaseBranchFromVersion(pipelinesCommon.getKogitoVersion()) + } + } +} + +return this