forked from folio-org/mod-remote-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
17 lines (15 loc) · 878 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
#DB_PROPS_FILE=/usr/verticles/1.txt
#touch ${DB_PROPS_FILE}
#echo "spring.datasource.username=${DB_USERNAME} spring.datasource.password=${DB_PASSWORD} spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}" | sed 's/\s\+/\n/g' | tee ${DB_PROPS_FILE}
#
############################################################################
# Assign fake values to variables (like DB_HOST/DB_PORT etc) if not provided
# This way DB connection won't be established but the application boots up
############################################################################
DB_URL="jdbc:postgresql://${DB_HOST:-localhost}:${DB_PORT:-5432}/${DB_DATABASE:-db}"
#
DB_OPTS="-Dspring.datasource.username=${DB_USERNAME:-user} -Dspring.datasource.password=${DB_PASSWORD:-pass} -Dspring.datasource.url=${DB_URL}"
#
export JAVA_OPTIONS="${JAVA_OPTIONS:-} ${DB_OPTS}"