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.
 
 
 
 

91 rivejä
3.5 KiB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. # ==================
  6. # Bubble Vagrantfile
  7. # ==================
  8. # Running `vagrant up` will create a full Bubble development environment including all
  9. # dependencies, and build all the code and website. You'll be ready to run a local
  10. # launcher or do dev work on the Bubble codebase.
  11. #
  12. # There are a few environment variables that determine how the box is initialized,
  13. # described below.
  14. #
  15. # ## Environment Variables
  16. #
  17. # ### LETSENCRYPT_EMAIL
  18. # If you specify the LETSENCRYPT_EMAIL environment variable, then `vagrant up` will also
  19. # start a Local Launcher (see docs/local-launcher.md) which is your starting point for
  20. # launching new Bubbles. You can always change this later by editing the `~/.bubble.env`
  21. # file after the Vagrant box is setup.
  22. #
  23. # ### BUBBLE_PORT
  24. # By default, Bubble will listen on port 8090.
  25. # If something else is already using that port on your computer, `vagrant up` will fail.
  26. # Set the `BUBBLE_PORT` environment variable to another port, and Bubble will listen on
  27. # that port instead.
  28. #
  29. # ### BUBBLE_PUBLIC_PORT
  30. # By default, Vagrant will only expose the Bubble API port (8090 or whatever BUBBLE_PORT
  31. # is set to) as listening on 127.0.0.1
  32. # If you want the Bubble API port to be listening on all addresses (bind to 0.0.0.0)
  33. # then set the BUBBLE_PUBLIC_PORT environment variable to any value except 'false'
  34. #
  35. Vagrant.configure("2") do |config|
  36. config.vm.box = "ubuntu/focal64"
  37. # You can access the launcher on port 8090 (or BUBBLE_PORT) but only on 127.0.0.1
  38. # If you want to allow outside access to port 8090 (listen on 0.0.0.0), use the version below
  39. if not ENV.include? 'BUBBLE_PUBLIC_PORT' or ENV['BUBBLE_PUBLIC_PORT'] == 'false' then
  40. config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090, host_ip: "127.0.0.1"
  41. else
  42. # Anyone who can reach port 8090 on this system will be able to access the launcher
  43. config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090
  44. end
  45. # Update system
  46. config.vm.provision :shell do |s|
  47. s.inline = <<-SHELL
  48. apt-get update -y
  49. apt-get upgrade -y
  50. SHELL
  51. end
  52. # Get dependencies and build everything
  53. config.vm.provision :shell do |s|
  54. s.env = { LETSENCRYPT_EMAIL: ENV['LETSENCRYPT_EMAIL'] }
  55. s.privileged = false
  56. s.inline = <<-SHELL
  57. # Copy shared bubble dir to ${HOME}
  58. rsync -a /vagrant ${HOME}/bubble
  59. # Initialize the system
  60. cd ${HOME}/bubble && ./bin/first_time_ubuntu.sh
  61. # Clone and build all dependencies
  62. SKIP_BUBBLE_BUILD=1 ./bin/first_time_setup.sh
  63. # Build the bubble jar
  64. BUBBLE_PRODUCTION=1 mvn -DskipTests=true -Dcheckstyle.skip=true -Pproduction clean package 2>&1 | tee /tmp/build.log
  65. # Write bubble API port
  66. echo \"export BUBBLE_SERVER_PORT=${BUBBLE_PORT}\" > ~/.bubble.env
  67. # Allow website to be loaded from disk
  68. echo \"export BUBBLE_ASSETS_DIR=$(pwd)/bubble-web/dist\" >> ~/.bubble.env
  69. # Add bubble bin to PATH
  70. echo \"export PATH=\${PATH}:${HOME}/bubble/bin\" >> ~/.bashrc
  71. # Set LETSENCRYPT_EMAIL is defined
  72. if [[ -n \"${LETSENCRYPT_EMAIL}\" ]] ; then
  73. echo \"export LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}\" >> ~/.bubble.env
  74. fi
  75. # Create env file symlink for running tests
  76. cd ~ && ln -s .bubble.env .bubble-test.env
  77. SHELL
  78. end
  79. end