diff --git a/bin/first_time_macosx.md b/bin/first_time_macosx.md new file mode 100755 index 00000000..ba3760f3 --- /dev/null +++ b/bin/first_time_macosx.md @@ -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" diff --git a/bin/first_time_macosx.sh b/bin/first_time_macosx.sh new file mode 100644 index 00000000..cedb4531 --- /dev/null +++ b/bin/first_time_macosx.sh @@ -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" diff --git a/bin/reset_bubble_db b/bin/reset_bubble_db index 51afc19f..5c5ce379 100755 --- a/bin/reset_bubble_db +++ b/bin/reset_bubble_db @@ -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" diff --git a/bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java b/bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java index e3ff4221..afacc83c 100644 --- a/bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java +++ b/bubble-server/src/main/java/bubble/resources/cloud/BackupsResource.java @@ -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; diff --git a/utils/cobbzilla-utils b/utils/cobbzilla-utils index 9b1dae28..682312ab 160000 --- a/utils/cobbzilla-utils +++ b/utils/cobbzilla-utils @@ -1 +1 @@ -Subproject commit 9b1dae280b16cf38c87eca83b938952c15b2c64a +Subproject commit 682312ab9a16279db0b078b9ff5802adbb02c23f diff --git a/utils/cobbzilla-wizard b/utils/cobbzilla-wizard index e91152f2..ed5deaff 160000 --- a/utils/cobbzilla-wizard +++ b/utils/cobbzilla-wizard @@ -1 +1 @@ -Subproject commit e91152f296a04ce1e4363ae90e1cfde70cdee4d5 +Subproject commit ed5deaff20ab40bb3be8d7bb8cc744d220a72874