Skip to content

Commit

Permalink
Remove quay.io references
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed Jun 25, 2024
1 parent ece88e5 commit 3b50963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
10 changes: 4 additions & 6 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
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."
}
17 changes: 0 additions & 17 deletions .ci/jenkins/scripts/imageUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,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

0 comments on commit 3b50963

Please sign in to comment.