Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save berendt/fca9bfae23d6462ffab6e861dee82707 to your computer and use it in GitHub Desktop.
Save berendt/fca9bfae23d6462ffab6e861dee82707 to your computer and use it in GitHub Desktop.
Quay API recipes
#!/usr/bin/env bash
NAMESPACE=your_namespace_on_quay
TAG=the_tag
# https://quay.io/organization/your_namespace_on_quay?tab=applications
ACCESS_TOKEN=xxxxx
for repository in $(curl -s -X GET -H "Authorization: Bearer $ACCESS_TOKEN" "https://quay.io/api/v1/repository?namespace=$NAMESPACE" | jq -r '.repositories[].name' | sort); do
curl -s -X DELETE -H "Authorization: Bearer $ACCESS_TOKEN" https://quay.io/api/v1/repository/$NAMESPACE/$repository/tag/$TAG
done
#!/usr/bin/env bash
NAMESPACE=your_namespace_on_quay
# https://quay.io/organization/your_namespace_on_quay?tab=applications
ACCESS_TOKEN=xxxxx
for repository in $(curl -s -X GET -H "Authorization: Bearer $ACCESS_TOKEN" "https://quay.io/api/v1/repository?namespace=$NAMESPACE" | jq -r '.repositories[].name' | sort); do
curl -s -X POST -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"visibility":"public"}' "https://quay.io//api/v1/repository/$NAMESPACE/$repository/changevisibility"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment