Skip to content

Commit

Permalink
Update CI pipelines for the Apache 10 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed May 27, 2024
1 parent 63b10d9 commit 330d9e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
25 changes: 7 additions & 18 deletions .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
*/
@Library('jenkins-pipeline-shared-libraries')_

QUAY_REGISTRY = 'quay.io'

pipeline {
agent {
docker {
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
label util.avoidFaultyNodes()
Expand Down Expand Up @@ -149,18 +147,6 @@ pipeline {
}
steps {
script {
// Make public if quay registry
if (getDeployImageRegistry() == QUAY_REGISTRY) {
String namespace = getDeployImageNamespace()
String repository = getFinalImageName()
echo "Check and set public if needed Quay repository ${namespace}/${repository}"
try {
cloud.makeQuayImagePublic(namespace, repository, [ usernamePassword: getDeployImageRegistryCredentials()])
} catch (err) {
echo "[ERROR] Cannot set image quay.io/${namespace}/${repository} as visible"
}
}

int retries = Integer.parseInt(env.MAX_REGISTRY_RETRIES)
String imageTag = getBuiltImageTag()
if (isDeployLatestTag()) {
Expand Down Expand Up @@ -228,7 +214,7 @@ pipeline {
}
steps {
script {
def resultingFileName = "${getFinalImageName()}.tar.gz"
def resultingFileName = "incubator-kie-${getReleaseVersion()}-${getBuildImageName()}.tar.gz"
def signatureFileName = "${resultingFileName}.asc"
sh """
docker pull ${getBuiltImageTag()}
Expand Down Expand Up @@ -328,9 +314,8 @@ String getDeployImageNameSuffix() {
String getDeployImageTag() {
if (params.DEPLOY_IMAGE_TAG != '') {
return params.DEPLOY_IMAGE_TAG
} else {
return sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
}
return sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
}

String getFinalImageName() {
Expand Down Expand Up @@ -471,3 +456,7 @@ String getReleaseSvnRepository() {
String getReleaseSvnCredsId() {
return env.RELEASE_SVN_CREDS_ID
}

String getReleaseVersion() {
return env.RELEASE_VERSION
}
1 change: 1 addition & 0 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,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()))

def job = build(job: 'kogito-images.build-image', wait: true, parameters: buildParams, propagate: false)
if (job.result != 'SUCCESS') {
Expand Down
18 changes: 0 additions & 18 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,6 @@ void promoteImage(String oldImageName, String newImageName) {
cloud.skopeoCopyRegistryImages(oldImageName, newImageName, Integer.parseInt(env.MAX_REGISTRY_RETRIES))
}

// Set images public on quay. Useful when new images are introduced.
void makeQuayNewImagesPublic() {
String namespace = getNewImageNamespace()
for (String imageName : getImages()) {
String repository = getFinalImageName(imageName, getNewImageNameSuffix())
echo "Check and set public if needed Quay repository ${namespace}/${repository}"
try {
cloud.makeQuayImagePublic(namespace, repository, [ usernamePassword: getNewImageRegistryCredentials()])
} catch (err) {
echo "[ERROR] Cannot set image quay.io/${namespace}/${repository} as visible"
}
}
}

String getOldImageFullTag(String imageName) {
return "${getOldImageRegistry()}/${getOldImageNamespace()}/${getFinalImageName(imageName, getOldImageNameSuffix())}:${getOldImageTag()}"
}
Expand Down Expand Up @@ -296,10 +282,6 @@ String getGitAuthorPushCredsId() {
return env.GIT_AUTHOR_PUSH_CREDS_ID
}

boolean isQuayRegistry(String registry) {
return registry == 'quay.io'
}

////////////////////////////////////////////////////////////////////////
// Old image information
////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,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')
}
}
}
Expand Down

0 comments on commit 330d9e0

Please sign in to comment.