Skip to content

Commit

Permalink
Replace quay.io references
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed May 27, 2024
1 parent 1c6a453 commit 5e48261
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
18 changes: 8 additions & 10 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ imageUtils = null

pipeline {
agent {
docker {
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
label util.avoidFaultyNodes()
Expand Down Expand Up @@ -112,7 +112,7 @@ pipeline {
stage('Upload OptaPlanner documentation') {
steps {
script {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getMavenCommand()
.inDirectory(optaplannerRepository)
.skipTests(true)
Expand Down Expand Up @@ -150,7 +150,7 @@ pipeline {
void sendErrorNotification() {
if (params.SEND_NOTIFICATION) {
String additionalInfo = "**[${getBuildBranch()}] Optaplanner - Promote**"
mailer.sendMarkdownTestSummaryNotification("CI failures", [env.OPTAPLANNER_CI_EMAIL_TO], additionalInfo)
mailer.sendMarkdownTestSummaryNotification('CI failures', [env.OPTAPLANNER_CI_EMAIL_TO], additionalInfo)
} else {
echo 'No notification sent per configuration'
}
Expand Down Expand Up @@ -260,7 +260,7 @@ void uploadDistribution(String directory) {
// For testing, simulate connection via SSH:
// sh "ssh -i $SSH_KEY_JBOSS_FILEMGMT -oKexAlgorithms=+diffie-hellman-group1-sha1 [email protected]"
sh "./build/release/upload_distribution.sh ${getProjectVersion()} $SSH_KEY_JBOSS_FILEMGMT"
}
}
}
} else {
echo 'No uploadDistribution due to testing build'
Expand Down Expand Up @@ -316,10 +316,8 @@ void pushOperatorFinalImage() {
}

void removeOperatorImageTemporaryTag() {
if (!imageUtils.removeQuayTag(getOperatorImageNamespace(), getOperatorImageName(), getOperatorImageTemporaryTag())) {
String temporaryImageName = imageUtils.getImageFullName(getOperatorImageNamespace(), getOperatorImageName(),
getOperatorImageTemporaryTag())
error "Cannot remove the OptaPlanner Operator temporary image tag (${temporaryImageName}) from quay.io. "
+ "The tag should be removed manually."
}
String temporaryImageName = imageUtils.getImageFullName(getOperatorImageNamespace(), getOperatorImageName(),
getOperatorImageTemporaryTag())
// https://docs.docker.com/docker-hub/api/latest/#tag/repositories
error "Dockerhub API does not allow deleting tags via API. The OptaPlanner Operator temporary image tag (${temporaryImageName}) should be removed manually."
}
6 changes: 3 additions & 3 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ maven:
creds_id: apache-nexus-kie-deploy-credentials
cloud:
image:
registry_credentials: tradisso_registry_token # TODO set to `kogito-quay-token`
registry: quay.io
namespace: tradisso
registry_credentials: 'to_be_defined'
registry: docker.io
namespace: apache
latest_git_branch: main
jenkins:
email_creds_id: OPTAPLANNER_CI_NOTIFICATION_EMAILS
Expand Down
19 changes: 1 addition & 18 deletions .ci/jenkins/scripts/imageUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,4 @@ void pushImage(String image) {
}
}

boolean removeQuayTag(String namespace, String imageName, String tag) {
String image = "quay.io/${namespace}/${imageName}:${tag}"
echo "Removing a temporary image tag ${image}"
try {
def output = 'false'
withCredentials([usernamePassword(credentialsId: getOperatorImageRegistryCredentials(), usernameVariable: 'QUAY_USER', passwordVariable: 'QUAY_TOKEN')]) {
output = sh(returnStdout: true, script: "curl -H 'Content-Type: application/json' -H 'Authorization: Bearer ${QUAY_TOKEN}' -X DELETE https://quay.io/api/v1/repository/${namespace}/${imageName}/tag/${tag}").trim()
if (output != '') {
echo "$output"
}
}
return output == ''
} catch (err) {
echo "[ERROR] Cannot remove a temporary image tag ${image}."
}
}

return this
return this

0 comments on commit 5e48261

Please sign in to comment.