From af7d916c12349260d1a8a35c879ec671d8fbb75c Mon Sep 17 00:00:00 2001 From: radtriste Date: Wed, 13 Oct 2021 15:03:50 +0200 Subject: [PATCH] update --- .ci/jenkins/dsl/jobs.groovy | 3 ++- .ci/jenkins/scripts/version_checks.groovy | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .ci/jenkins/scripts/version_checks.groovy diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index c306183e74e..eff6f5208d3 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -68,7 +68,8 @@ KogitoJobUtils.createDeployArtifactsJob(this, 'kogito-runtimes', FolderUtils.get KogitoJobUtils.createUpdateVersionJob(this, 'kogito-runtimes', FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY, [ versions: ['kogito'], scripts: [ - update_version: 'scripts/update_version.groovy' + update_version: 'scripts/update_version.groovy', + pipeline_checks: 'scripts/version_checks.groovy', ] ]) 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