Skip to content

Commit

Permalink
Fix apache release image artifact names
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Antunes committed Oct 10, 2024
1 parent 67c669a commit 6c9fed1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
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

0 comments on commit 6c9fed1

Please sign in to comment.