The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

aws_delete_images.sh 963 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. function die {
  6. echo 1>&2 "${1}"
  7. exit 1
  8. }
  9. IMAGE_FILTER=${1:-'packer_bubble_*'}
  10. THISDIR=$(cd $(dirname ${0}) && pwd)
  11. for region in $(${THISDIR}/aws_list_regions.sh) ; do
  12. ${THISDIR}/aws_set_region.sh ${region} || die "Error setting aws region ${region}"
  13. echo 1>&2 "Deleting images matching: ${IMAGE_FILTER} in region ${region}"
  14. IMAGE_IDS=$(aws ec2 describe-images --filters "Name=name,Values=${IMAGE_FILTER}" | jq -r '.Images[].ImageId')
  15. if [[ -z "${IMAGE_IDS}" ]] ; then
  16. echo 1>&2 "No images matching ${IMAGE_FILTER} found in region ${region}"
  17. continue
  18. fi
  19. for image in ${IMAGE_IDS} ; do
  20. echo 1>&2 "Deleting image: ${image} in region ${region}"
  21. aws ec2 deregister-image --image-id ${image} || echo 1>&2 "Error deleting image ${image} in aws region ${region}"
  22. done
  23. done