The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

52 righe
1.6 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. # Display active and completed packer jobs
  6. #
  7. # Usage:
  8. #
  9. # pack_status [running|completed]
  10. #
  11. # If the first argument is 'running' then only the status of running jobs will be shown
  12. # If the first argument is 'completed' then only the status of completed jobs will be shown
  13. #
  14. # Based on your BUBBLE_USER, BUBBLE_PASS and BUBBLE_API environment variables, this command will
  15. # use the bubble API to display the current status of the PackerService
  16. #
  17. # It returns a JSON object in the form:
  18. # {
  19. # "running": [
  20. # {...job1...},
  21. # {...job2...},
  22. # ...
  23. # ],
  24. # "completed": {
  25. # "cloud_key1": [ {...image1...}, {...image2...}, ... ],
  26. # "cloud_key2": [ {...image1...}, {...image2...}, ... ],
  27. # ...
  28. # }
  29. # }
  30. #
  31. # In the above, "running" is an array of job summary objects
  32. # and "completed" is a key/value map where they key indicates a cloud,
  33. # and the value is an array of packer images that have completed
  34. #
  35. # If you pass the 'running' argument, only the array of running jobs will be printed
  36. # If you pass the 'completed' argument, only the map of cloud->image[] will be printed
  37. #
  38. SCRIPT="${0}"
  39. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  40. . "${SCRIPT_DIR}"/bubble_common
  41. if [[ -z "${1}" ]] ; then
  42. bget me/packer
  43. elif [[ "${1}" == "running" ]] ; then
  44. bget me/packer/running
  45. elif [[ "${1}" == "completed" ]] ; then
  46. bget me/packer/completed
  47. else
  48. echo "Unrecognized argument ${1}, expected 'running' or 'completed' (or nothing)"
  49. exit 1
  50. fi