The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

aws_delete_images.sh 815 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. function die {
  3. echo 1>&2 "${1}"
  4. exit 1
  5. }
  6. IMAGE_FILTER=${1:-'packer_bubble_*'}
  7. THISDIR=$(cd $(dirname ${0}) && pwd)
  8. for region in $(${THISDIR}/aws_list_regions.sh) ; do
  9. ${THISDIR}/aws_set_region.sh ${region} || die "Error setting aws region ${region}"
  10. echo 1>&2 "Deleting images matching: ${IMAGE_FILTER} in region ${region}"
  11. IMAGE_IDS=$(aws ec2 describe-images --filters "Name=name,Values=${IMAGE_FILTER}" | jq -r '.Images[].ImageId')
  12. if [[ -z "${IMAGE_IDS}" ]] ; then
  13. echo 1>&2 "No images matching ${IMAGE_FILTER} found in region ${region}"
  14. continue
  15. fi
  16. for image in ${IMAGE_IDS} ; do
  17. echo 1>&2 "Deleting image: ${image} in region ${region}"
  18. aws ec2 deregister-image --image-id ${image} || echo 1>&2 "Error deleting image ${image} in aws region ${region}"
  19. done
  20. done