From 34632cf58bfecc1fedde0999da1bd743daa53e7b Mon Sep 17 00:00:00 2001 From: Christopher Zell Date: Tue, 24 Aug 2021 09:27:38 -0400 Subject: [PATCH] utility launcher --- prod.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 prod.sh diff --git a/prod.sh b/prod.sh new file mode 100755 index 0000000..d92700f --- /dev/null +++ b/prod.sh @@ -0,0 +1,22 @@ + +if [[ "$1" == "clean" ]]; then + echo "Cleaning and re-creating db..."; + dropdb common; + createdb common; +fi; + +export SPRING_PROFILES_ACTIVE=production; +export SECURITY_ENABLED=true; +export PGHOST='localhost'; +export PGPORT='5432'; +export PG_DATABASE=common; +export APP_DB_ADMIN_PASSWORD=''; +export PG_USER=${USER}; +export APP_DB_RW_PASSWORD=''; +export PG_RW_USER=${USER}; + +# dont have to require SSL here unlike the real prod profile +export SPRING_DATASOURCE_URL="jdbc:postgresql://$PGHOST:$PGPORT/$PG_DATABASE"; + +# run the app +mvn spring-boot:run -Pproduction -- GitLab