The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

49 rader
1.9 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. # Installs Packer and the Packer Vultr plugin.
  6. #
  7. # It is safe to run this command multiple times, it is idempotent.
  8. #
  9. function die {
  10. echo 1>&2 "${1}"
  11. exit 1
  12. }
  13. PLATFORM="$(uname -s)"
  14. # Install packer
  15. if [[ ! -f ${HOME}/packer/packer ]] ; then
  16. PACKER_VERSION=1.6.5
  17. if [[ "${PLATFORM}" == "Darwin" ]] ; then
  18. PACKER_FILE=packer_${PACKER_VERSION}_darwin_amd64.zip
  19. elif [[ "${PLATFORM}" == "Linux" ]] ; then
  20. PACKER_FILE=packer_${PACKER_VERSION}_linux_amd64.zip
  21. else
  22. die "Add packer support to script ${0} for platform ${PLATFORM}"
  23. fi
  24. PACKER_URL=https://releases.hashicorp.com/packer/${PACKER_VERSION}/${PACKER_FILE}
  25. mkdir -p ${HOME}/packer && cd ${HOME}/packer && curl -L ${PACKER_URL} -o ${PACKER_FILE} && unzip ${PACKER_FILE} || die "Error installing packer"
  26. echo "Packer successfully installed"
  27. else
  28. echo "Packer already installed"
  29. fi
  30. # Install packer Vultr plugin
  31. if [[ ! -f ${HOME}/.packer.d/plugins/packer-builder-vultr ]] ; then
  32. PACKER_VULTR_VERSION=1.0.15
  33. if [[ "${PLATFORM}" == "Darwin" ]] ; then
  34. PACKER_VULTR_FILE=packer-builder-vultr_${PACKER_VULTR_VERSION}_macOs_64-bit.tar.gz
  35. elif [[ "${PLATFORM}" == "Linux" ]] ; then
  36. PACKER_VULTR_FILE=packer-builder-vultr_${PACKER_VULTR_VERSION}_linux_64-bit.tar.gz
  37. else
  38. die "Add packer vultr support to script ${0} for platform ${PLATFORM}"
  39. fi
  40. PACKER_VULTR_URL=https://github.com/vultr/packer-builder-vultr/releases/download/v${PACKER_VULTR_VERSION}/${PACKER_VULTR_FILE}
  41. mkdir -p ${HOME}/.packer.d/plugins && cd ${HOME}/.packer.d/plugins && curl -L ${PACKER_VULTR_URL} -o ${PACKER_VULTR_FILE} && tar xzf ${PACKER_VULTR_FILE} || die "Error installing packer vultr plugin"
  42. echo "Packer Vult plugin successfully installed"
  43. else
  44. echo "Packer vultr plugin already installed"
  45. fi