The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

list_test_instances.sh 943 B

1234567891011121314151617181920212223242526272829303132
  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