diff --git a/.ci/jenkins/Jenkinsfile.build-image b/.ci/jenkins/Jenkinsfile.build-image index 2d24558b1..23cff1e4d 100644 --- a/.ci/jenkins/Jenkinsfile.build-image +++ b/.ci/jenkins/Jenkinsfile.build-image @@ -214,7 +214,7 @@ pipeline { } steps { script { - def resultingFileName = "incubator-kie-${getReleaseVersion()}-${getBuildImageName()}.tar.gz" + def resultingFileName = "incubator-kie-${getImageArtifactReleaseVersion()}-${getBuildImageName()}.tar.gz" def signatureFileName = "${resultingFileName}.asc" sh """ docker pull ${getBuiltImageTag()} @@ -222,7 +222,7 @@ pipeline { """ release.gpgImportKeyFromFileWithPassword(getReleaseGpgSignKeyCredsId(), getReleaseGpgSignPassphraseCredsId()) release.gpgSignFileDetachedSignatureWithPassword(resultingFileName, signatureFileName, getReleaseGpgSignPassphraseCredsId()) - release.svnUploadFileToRepository(getReleaseSvnRepository(), getReleaseSvnCredsId(), getReleaseVersion(), resultingFileName, signatureFileName) + release.svnUploadFileToRepository(getReleaseSvnRepository(), getReleaseSvnCredsId(), getImageArtifactReleaseVersion(), resultingFileName, signatureFileName) } } post { @@ -457,6 +457,6 @@ String getReleaseSvnCredsId() { return env.RELEASE_SVN_CREDS_ID } -String getReleaseVersion() { - return env.RELEASE_VERSION +String getImageArtifactReleaseVersion() { + return env.IMAGE_ARTIFACT_RELEASE_VERSION } diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index a13ab9f08..d8e05ecf6 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -214,11 +214,10 @@ pipeline { String prLink = githubscm.createPR(commitMsg, prBody, getBuildBranch(), getGitAuthorPushCredsId()) deployProperties["${getRepoName()}.pr.link"] = prLink - // Create a new tag githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) - githubscm.tagRepository(getProjectVersion()) - githubscm.pushRemoteTag('origin', getProjectVersion(), getGitAuthorPushCredsId()) + githubscm.tagRepository(getGitTagName()) + githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) } } } @@ -229,6 +228,7 @@ pipeline { setDeployPropertyIfNeeded("${getRepoName()}.pr.source.ref", getPRBranch()) setDeployPropertyIfNeeded("${getRepoName()}.pr.target.uri", "https://github.com/${getGitAuthor()}/${getRepoName()}") setDeployPropertyIfNeeded("${getRepoName()}.pr.target.ref", getBuildBranch()) + setDeployPropertyIfNeeded("${getRepoName()}.tag.name", geGitTagName()) } } } @@ -315,7 +315,7 @@ void createBuildAndTestStageClosure(String image) { buildParams.add(string(name: 'DEPLOY_IMAGE_NAME_SUFFIX', value: getDeployImageNameSuffix())) buildParams.add(string(name: 'DEPLOY_IMAGE_TAG', value: getDeployImageTag())) buildParams.add(booleanParam(name: 'DEPLOY_WITH_LATEST_TAG', value: isDeployLatestTag())) - buildParams.add(string(name: 'RELEASE_VERSION', value: getProjectVersion())) + buildParams.add(string(name: 'IMAGE_ARTIFACT_RELEASE_VERSION', value: getGitTagName())) def job = build(job: 'kogito-images.build-image', wait: true, parameters: buildParams, propagate: false) if (job.result != 'SUCCESS') { @@ -458,4 +458,8 @@ String[] getImages() { String getQuarkusPlatformVersion() { return params.QUARKUS_PLATFORM_VERSION -} \ No newline at end of file +} + +String getGitTagName() { + return params.GIT_TAG_NAME +} diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index ebaf81ee6..52238919d 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -149,6 +149,7 @@ void setupDeployJob(JobType jobType) { stringParam('KOGITO_ARTIFACTS_VERSION', '', 'Optional. If artifacts\' version is different from PROJECT_VERSION.') if (jobType == JobType.RELEASE) { stringParam('QUARKUS_PLATFORM_VERSION', '', 'Allow to override the Quarkus Platform version') + stringParam('GIT_TAG_NAME', '', 'Git tag to be created') } stringParam('KOGITO_PR_BRANCH', '', 'PR branch name') @@ -210,7 +211,7 @@ void setupBuildImageJob(JobType jobType) { stringParam('DEPLOY_IMAGE_TAG', '', 'Image tag to use to deploy images') booleanParam('DEPLOY_WITH_LATEST_TAG', false, 'Set to true if you want the deployed images to also be with the `latest` tag') booleanParam('EXPORT_AND_GPG_SIGN_IMAGE', jobType == JobType.RELEASE, 'Set to true if should images be exported and signed.') - stringParam('RELEASE_VERSION', '', 'Set the release version to be attached to the images artifacts names') + stringParam('IMAGE_ARTIFACT_RELEASE_VERSION', '', 'Set the release version to be attached to the images artifacts names') } } }