The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
943 B

  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. #
  6. # List test Amazon EC2 instances
  7. #
  8. SCRIPT="${0}"
  9. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  10. BUBBLE_ENV="${HOME}/.bubble-test.env"
  11. if [[ -z "${TEST_TAG}" ]] ; then
  12. TEST_TAG="$(cat ${BUBBLE_ENV} | egrep -v '\s*#' | grep TEST_TAG_CLOUD | awk -F '=' '{print $NF}' | tr -d "'" | tr -d '"')"
  13. if [[ -z "${TEST_TAG}" ]] ; then
  14. die "Error reading TEST_TAG_CLOUD from ${BUBBLE_ENV}"
  15. fi
  16. fi
  17. INSTANCES=$(aws ec2 describe-instances --filters "Name=tag:test_instance,Values=${TEST_TAG}" --query "Reservations[].Instances[].InstanceId")
  18. echo "$INSTANCES"
  19. INSTANCES_COUNT="${#INSTANCES[@]}"
  20. if [[ ${INSTANCES_COUNT} -gt 0 ]] ; then
  21. echo "Found ${INSTANCES_COUNT} test instances contain tag ${TEST_TAG}"
  22. else
  23. echo "No instances contain tag \"${TEST_TAG}\" found"
  24. fi