Skip to content

Commit

Permalink
Split nightly job
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Oct 20, 2021
1 parent cfba376 commit f018d35
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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' ],
])
Expand Down
5 changes: 5 additions & 0 deletions .ci/jenkins/scripts/update_version.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void execute(def pipelinesCommon) {
maven.mvnVersionsSet(pipelinesCommon.getDefaultMavenCommand(), pipelinesCommon.getKogitoVersion(), !pipelinesCommon.isRelease())
}

return this
13 changes: 13 additions & 0 deletions .ci/jenkins/scripts/version_checks.groovy
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f018d35

Please sign in to comment.