Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0.x] NO-ISSUE: Fix apache release image artifact names #1805

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pipeline {
}
steps {
script {
String resultingFileName = "incubator-kie-${getImageArtifactReleaseVersion()}-${getBuildImageName()}-image.tar.gz"
String resultingFileName = "apache-kie-${getImageArtifactReleaseVersion()}-incubating-${getBuildImageName()}-image.tar.gz"
String signatureFileName = "${resultingFileName}.asc"
String checksumFileName = "${resultingFileName}.sha512"
sh """
Expand All @@ -222,7 +222,7 @@ pipeline {
"""
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
releaseUtils.gpgSignFileDetachedSignatureWithoutPassword(resultingFileName, signatureFileName)
releaseUtils.svnUploadFileToRepository(getReleaseSvnRepository(), getReleaseSvnCredsId(), getImageArtifactReleaseVersion(), resultingFileName, signatureFileName, checksumFileName)
releaseUtils.svnUploadFileToRepository(getReleaseSvnRepository(), getReleaseSvnCredsId(), getImageArtifactReleaseCandidateVersion(), resultingFileName, signatureFileName, checksumFileName)
}
}
post {
Expand Down Expand Up @@ -472,6 +472,10 @@ String getImageArtifactReleaseVersion() {
return params.IMAGE_ARTIFACT_RELEASE_VERSION
}

String getImageArtifactReleaseCandidateVersion() {
return params.IMAGE_ARTIFACT_RELEASE_CANDIDATE_VERSION
}

boolean isRelease() {
return env.RELEASE ? env.RELEASE.toBoolean() : false
}
33 changes: 17 additions & 16 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ pipeline {
}
}

stage('Commit and Tag changes') {
when {
expression { return isRelease() }
}
steps {
script {
if (!getBuildFailedImages()) {
dir(getRepoName()) {
commitAndTagChanges("[${getBuildBranch()}] Update version to ${getProjectVersion()}")
}
}
}
}
}

stage('Build, Push & Test Images') {
steps {
script {
Expand Down Expand Up @@ -153,21 +168,6 @@ pipeline {
}
}

stage('Commit and Tag changes') {
when {
expression { return isRelease() }
}
steps {
script {
if (!getBuildFailedImages()) {
dir(getRepoName()) {
commitAndTagChanges("[${getBuildBranch()}] Update version to ${getProjectVersion()}")
}
}
}
}
}

stage('Finalize') {
steps {
script {
Expand Down Expand Up @@ -252,7 +252,8 @@ 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: 'IMAGE_ARTIFACT_RELEASE_VERSION', value: getGitTagName()))
buildParams.add(string(name: 'IMAGE_ARTIFACT_RELEASE_VERSION', value: getProjectVersion()))
buildParams.add(string(name: 'IMAGE_ARTIFACT_RELEASE_CANDIDATE_VERSION', value: getGitTagName()))

def job = build(job: 'kogito-images.build-image', wait: true, parameters: buildParams, propagate: false)
if (job.result != 'SUCCESS') {
Expand Down
3 changes: 2 additions & 1 deletion .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void setupDeployJob(JobType jobType) {
QUARKUS_PLATFORM_NEXUS_URL: Utils.getMavenQuarkusPlatformRepositoryUrl(this),

// during 10.0.x release automated push of images is disabled, in nightly behaves based on configuration in branch.yaml
DISABLE_IMAGES_DEPLOY: (jobType==JobType.NIGHTLY) ? Utils.isImagesDeployDisabled(this) : true
DISABLE_IMAGES_DEPLOY: (jobType == JobType.RELEASE) ? true : Utils.isImagesDeployDisabled(this)
])
if (Utils.hasBindingValue(this, 'CLOUD_IMAGES')) {
jobParams.env.put('IMAGES_LIST', Utils.getBindingValue(this, 'CLOUD_IMAGES'))
Expand Down Expand Up @@ -218,6 +218,7 @@ void setupBuildImageJob(JobType jobType) {
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('IMAGE_ARTIFACT_RELEASE_VERSION', '', 'Optional if not RELEASE. Set the release version to be attached to the images artifacts names')
stringParam('IMAGE_ARTIFACT_RELEASE_CANDIDATE_VERSION', '', 'Optional if not RELEASE. Set the release candidate version to define the SVN directory where the images artifacts will be uploaded')
}
}
}
Expand Down
Loading