The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

50 linhas
1.4 KiB

  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. # Create packer images for sage and/or node
  6. #
  7. # Usage: pack_bubble [-node|-sage] [-cloud CloudName]
  8. #
  9. # -node : only pack the node image, do not pack the sage
  10. # -sage : only pack the sage image, do not pack the node
  11. # -cloud CloudName : only pack for CloudName compute cloud, do not pack for all clouds
  12. #
  13. SCRIPT="${0}"
  14. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  15. . ${SCRIPT_DIR}/bubble_common
  16. if [[ -z "${1}" ]] ; then
  17. IMAGES="node sage"
  18. elif [[ "${1}" == "-node" ]] ; then
  19. IMAGES="node"
  20. shift
  21. elif [[ "${1}" == "-sage" ]] ; then
  22. IMAGES="sage"
  23. shift
  24. fi
  25. if [[ -z "${1}" ]] ; then
  26. CLOUDS_URL="me/clouds?type=compute"
  27. CLOUDS="$("${SCRIPT_DIR}/bgetn" "${CLOUDS_URL}")"
  28. if [[ -z "${CLOUDS}" ]] ; then
  29. die "Error reading compute cloud names from ${CLOUDS_URL}"
  30. fi
  31. elif [[ "${1}" == "-cloud" ]] ; then
  32. CLOUDS="${2}"
  33. if [[ -z "${CLOUDS}" ]] ; then
  34. die "No cloud name specified after -cloud"
  35. fi
  36. else
  37. die ""
  38. fi
  39. for cloud in ${CLOUDS} ; do
  40. for image in ${IMAGES} ; do
  41. echo "Building ${image} image for cloud ${cloud} ..."
  42. "${SCRIPT_DIR}/bpute" "me/clouds/${cloud}/packer/${image}" || die "Error submitting packer build: ${image} / ${cloud}"
  43. done
  44. done