Procházet zdrojové kódy

update Vagrantfile, add docs

tags/v1.5.4
Jonathan Cobb před 4 roky
rodič
revize
f6f45e220c
3 změnil soubory, kde provedl 96 přidání a 55 odebrání
  1. +39
    -24
      Vagrantfile
  2. +12
    -31
      docs/dev.md
  3. +45
    -0
      docs/dev_manual.md

+ 39
- 24
Vagrantfile Zobrazit soubor

@@ -5,15 +5,20 @@
# ==================
# Bubble Vagrantfile
# ==================
# Running `vagrant up` will create a full Bubble development environment, and
# optionally start a local launcher.
# Running `vagrant up` will create a full Bubble development environment including all
# dependencies, and build all the code and website. You'll be ready to run a local
# launcher or do dev work on the Bubble codebase.
#
# There are a few environment variables that determine how the box is initialized,
# described below.
#
# ## Environment Variables
#
# ### LETSENCRYPT_EMAIL
# If you specify the LETSENCRYPT_EMAIL environment variable, then `vagrant up` will also
# start a Local Launcher (see docs/local-launcher.md) which is your starting point for
# launching new Bubbles.
# launching new Bubbles. You can always change this later by editing the `~/.bubble.env`
# file after the Vagrant box is setup.
#
# ### BUBBLE_PORT
# By default, Bubble will listen on port 8090.
@@ -21,38 +26,38 @@
# Set the `BUBBLE_PORT` environment variable to another port, and Bubble will listen on
# that port instead.
#
# ### BUBBLE_TAG
# By default, the Vagrant box will run the bleeding edge (`master` branch) of Bubble.
# Set the `BUBBLE_TAG` environment variable to the name of a git branch or tag to check
# out instead.
#
# ### BUBBLE_PUBLIC_PORT
# By default, Vagrant will only expose the Bubble API port (8090 or whatever BUBBLE_PORT
# is set to) as listening on 127.0.0.1
# If you want the Bubble API port to be listening on all addresses (bind to 0.0.0.0)
# then set the BUBBLE_PUBLIC_PORT environment variable to any value except 'false'
#
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"

# You can access the launcher on port 8090 (or BUBBLE_PORT) but only on 127.0.0.1
# If you want to allow outside access to port 8090 (listen on 0.0.0.0), use the version below
config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090, host_ip: "127.0.0.1"

# Anyone who can reach port 8090 on this system will be able to access the launcher
# config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090
if not ENV.include? 'BUBBLE_PUBLIC_PORT' or ENV['BUBBLE_PUBLIC_PORT'] == 'false' do
config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090, host_ip: "127.0.0.1"
else
# Anyone who can reach port 8090 on this system will be able to access the launcher
config.vm.network "forwarded_port", guest: 8090, host: ENV['BUBBLE_PORT'] || 8090
end

# Update system
config.vm.provision :shell do |s|
s.inline = <<-SHELL
apt-get update -y
apt-get upgrade -y
SHELL
end

# Get dependencies and build everything
config.vm.provision :shell do |s|
s.env = {
LETSENCRYPT_EMAIL: ENV['LETSENCRYPT_EMAIL'],
BUBBLE_TAG: ENV['BUBBLE_TAG'] || 'master'
}
s.env = { LETSENCRYPT_EMAIL: ENV['LETSENCRYPT_EMAIL'] }
s.privileged = false
s.inline = <<-SHELL
# Get the code
git clone https://git.bubblev.org/bubblev/bubble.git
cd bubble && git fetch && git pull origin ${BUBBLE_TAG}
cd /vagrant

# Initialize the system
./bin/first_time_ubuntu.sh
@@ -61,14 +66,24 @@ Vagrant.configure("2") do |config|
SKIP_BUBBLE_BUILD=1 ./bin/first_time_setup.sh

# Build the bubble jar
MVN_QUIET=""
BUBBLE_PRODUCTION=1 mvn ${MVN_QUIET} -Pproduction clean package
BUBBLE_PRODUCTION=1 mvn -DskipTests=true -Dcheckstyle.skip=true -Pproduction clean package

# Start the Local Launcher if LETSENCRYPT_EMAIL is defined
# Write bubble API port
echo \"export BUBBLE_SERVER_PORT=${BUBBLE_PORT}\" > ~/.bubble.env

# Allow website to be loaded from disk
echo \"export BUBBLE_ASSETS_DIR=$(pwd)/bubble-web/dist\" >> ~/.bubble.env

# Add bubble bin to PATH
echo \"export PATH=\${PATH}:${HOME}/bubble/bin\" >> ~/.bashrc

# Set LETSENCRYPT_EMAIL is defined
if [[ -n \"${LETSENCRYPT_EMAIL}\" ]] ; then
echo \"export LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}\" > bubble.env
# ./bin/run.sh bubble.env
echo \"export LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}\" >> ~/.bubble.env
fi

# Create env file symlink for running tests
cd ~ && ln -s .bubble.env .bubble-test.env
SHELL
end
end

+ 12
- 31
docs/dev.md Zobrazit soubor

@@ -5,46 +5,27 @@ This guide is intended for developers who would like to work directly with the B
For API-level details, see the [Bubble API Guide](https://github.com/getbubblenow/bubble-docs/blob/master/api/README.md)
and the [Bubble API Reference](https://app.getbubblenow.com/apidocs/)

# Development Setup
These instructions presume you are running a newly setup Ubuntu 20.04 or Mac OS X system.
# Vagrant Setup
The easiest way to get started with Bubble is to install [Vagrant](https://www.vagrantup.com/) and use
the Bubble [Vagrantfile](../Vagrantfile):

For Ubuntu, either the Server or Desktop distribution will work.

Other Debian-based systems will probably also work fine.

See below for other Linux distributions and other operating systems.

## One-Time System Setup
You'll need to install some software for Bubble to work correctly.

Follow the instructions in [System Software Setup](system-software.md) to install the required software.

## First-Time Dev Setup
After running the system setup above, run:
```shell script
./bin/first_time_setup.sh
```

This will grab all the submodules and perform an initial build of all components.

This will take a while to complete, please be patient.

## Bubble environment file
You will need a file named `${HOME}/.bubble.env` which contains various environment variables
required to run the server. At the least, it should contain:
```shell script
export LETSENCRYPT_EMAIL=user@example.com
vagrant up
```

This defines what email address is used with LetsEncrypt when creating new SSL certificates.
This will take a long time to complete. When it is done, you'll have a Vagrant box with
the Bubble source code and all dependencies fully built and ready to run a local launcher.

If you will be running any tests, create a symlink called `${HOME}/.bubble-test.env`
When your Vagrant box is ready, you can login to it and start the local launcher:

```shell script
cd ${HOME} && ln -s .bubble.env .bubble-test.env
vagrant ssh
./bubble/bin/run.sh
```

The `.bubble-test.env` file is used by the test suite.
# Manual Development Setup
If you'd prefer not to use Vagrant or want to build things locally, follow
the [Bubble Manual Development Setup](dev_manual.md) instructions.

## Subsequent Updates
If you want to grab the latest code, and ensure that all git submodules are properly in sync with the main repository, run:


+ 45
- 0
docs/dev_manual.md Zobrazit soubor

@@ -0,0 +1,45 @@
Bubble Manual Development Setup
===============================
These instructions presume you are running a newly-setup Ubuntu 20.04 or Mac OS X system.

For Ubuntu, either the Server or Desktop distribution will work.

Other Debian-based systems will probably also work fine.

See below for other Linux distributions and other operating systems.

## One-Time System Setup
You'll need to install some software for Bubble to work correctly.

Follow the instructions in [System Software Setup](system-software.md) to install the required software.

## First-Time Dev Setup
After running the system setup above, run:
```shell script
./bin/first_time_setup.sh
```

This will grab all the submodules and perform an initial build of all components.

This will take a while to complete, please be patient.

## Bubble environment file
You will need a file named `${HOME}/.bubble.env` which contains various environment variables
required to run the server. At the least, it should contain:
```shell script
export LETSENCRYPT_EMAIL=user@example.com
```

This defines what email address is used with LetsEncrypt when creating new SSL certificates.

If you will be running any tests, create a symlink called `${HOME}/.bubble-test.env`

```shell script
cd ${HOME} && ln -s .bubble.env .bubble-test.env
```

The `.bubble-test.env` file is used by the test suite.

## What's Next
Continue reading the [Bubble Developer Guide](dev.md) for information
on how to update the source code, reset the database, and more.

Načítá se…
Zrušit
Uložit