Parcourir la source

fixes to enable building and running on mac

tags/v1.4.0
Jonathan Cobb il y a 4 ans
Parent
révision
d954b26b46
6 fichiers modifiés avec 91 ajouts et 14 suppressions
  1. +32
    -0
      bin/first_time_macosx.md
  2. +45
    -0
      bin/first_time_macosx.sh
  3. +10
    -10
      bin/reset_bubble_db
  4. +2
    -2
      bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java
  5. +1
    -1
      utils/cobbzilla-utils
  6. +1
    -1
      utils/cobbzilla-wizard

+ 32
- 0
bin/first_time_macosx.md Voir le fichier

@@ -0,0 +1,32 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
function die {
echo 1>&2 "${1}"
exit 1
}

# Ensure system is current

# Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

# Install emacs
brew cask install emacs

# Install AdoptOpenJDK 11
install from https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot

# Install packages
brew install maven
brew install postgresql@10 && brew services start postgresql@10
brew install redis && brew services start redis
brew install jq
brew install python@3.8

# Create DB user 'bubble', with the ability to create databases
createuser -U postgres --createdb bubble || die "Error creating bubble DB user"

# Create bubble database
createdb --encoding=UTF-8 bubble || die "Error creating bubble DB"

+ 45
- 0
bin/first_time_macosx.sh Voir le fichier

@@ -0,0 +1,45 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
function die {
echo 1>&2 "${1}"
exit 1
}

# Ensure system is current

# Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

# Install emacs
brew cask install emacs

# Install AdoptOpenJDK 11
echo "Install AdoptOpenJDK 11 from https://adoptopenjdk.net/index.html?variant=openjdk11&jvmVariant=hotspot"

# Install IntelliJ IDEA
echo "Install IntelliJ IDEA from https://www.jetbrains.com/idea/download/#section=mac"

# Install packages
brew install maven
brew install postgresql@10 && brew services start postgresql@10
brew install redis && brew services start redis
brew install jq
brew install python@3.8
brew install npm
brew install webpack
sudo pip3 install setuptools psycopg2-binary

# Add python paths to script rc
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
export PATH="/usr/local/opt/python@3.8/bin:$PATH"

# Create DB user 'postgres' as super admin
createuser --createdb --superuser --createrole postgres || die "Error creating postgres DB user"

# Create DB user 'bubble', with the ability to create databases
createuser --createdb bubble || die "Error creating bubble DB user"

# Create bubble database
createdb --encoding=UTF-8 bubble || die "Error creating bubble DB"

+ 10
- 10
bin/reset_bubble_db Voir le fichier

@@ -10,8 +10,8 @@
# debug : set this to 'debug' to enable debugging
#
SCRIPT="${0}"
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
. ${SCRIPT_DIR}/bubble_common
SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
. "${SCRIPT_DIR}/bubble_common"

DEBUG=${1}
if [[ ! -z "${DEBUG}" && "${DEBUG}" == "debug" ]] ; then
@@ -27,24 +27,24 @@ fi

BUBBLE_TARGET=${BUBBLE_SERVER}/target
META_DIR="${BUBBLE_TARGET}/classes/META-INF/bubble/"
mkdir -p ${META_DIR} || die "Error creating META-INF dir: ${META_DIR}"
mkdir -p "${META_DIR}" || die "Error creating META-INF dir: ${META_DIR}"

SQL_DIR="${BUBBLE_SERVER}/target/classes/META-INF/"
if [[ ! -d "${SQL_DIR}" ]] ; then
die "config dir not found: ${SQL_DIR}"
fi
SQL_DIR="$(cd ${SQL_DIR} && pwd)"
SQL_DIR="$(cd "${SQL_DIR}" && pwd)"

if [[ ${DEBUG} -eq 1 ]] ; then
cd ${SCRIPT_DIR}/.. && \
cd "${SCRIPT_DIR}"/.. && \
mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -Xnoagent -Djava.compiler=NONE" \
-Dtest=bubble.test.DbInit -Ddb.dump=${SQL_DIR}/bubble.sql test \
-Dtest=bubble.test.DbInit -Ddb.dump="${SQL_DIR}/bubble.sql" test \
|| exit 1
else
cd ${SCRIPT_DIR}/.. && \
mvn -Dtest=bubble.test.DbInit -Ddb.dump=${SQL_DIR}/bubble.sql test || exit 1
cd "${SCRIPT_DIR}"/.. && \
mvn -Dtest=bubble.test.DbInit -Ddb.dump="${SQL_DIR}/bubble.sql" test || exit 1
fi

dropdb bubble ; createdb bubble && cat ${SQL_DIR}/bubble.sql | psql bubble
dropdb bubble ; createdb bubble && cat "${SQL_DIR}/bubble.sql" | psql bubble
echo "Successfully initialized DB schema from: "
echo ${SQL_DIR}/bubble.sql
echo "${SQL_DIR}/bubble.sql"

+ 2
- 2
bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java Voir le fichier

@@ -29,8 +29,8 @@ import static org.cobbzilla.wizard.resources.ResourceUtil.*;
@Produces(APPLICATION_JSON)
public class BackupsResource {

private Account account;
private BubbleNetwork network;
private final Account account;
private final BubbleNetwork network;

public BackupsResource(Account account, BubbleNetwork network) {
this.account = account;


+ 1
- 1
utils/cobbzilla-utils

@@ -1 +1 @@
Subproject commit 9b1dae280b16cf38c87eca83b938952c15b2c64a
Subproject commit 682312ab9a16279db0b078b9ff5802adbb02c23f

+ 1
- 1
utils/cobbzilla-wizard

@@ -1 +1 @@
Subproject commit e91152f296a04ce1e4363ae90e1cfde70cdee4d5
Subproject commit ed5deaff20ab40bb3be8d7bb8cc744d220a72874

Chargement…
Annuler
Enregistrer