From a8aed0f5f7d0c8fd2d8acf04359c9cff8276df14 Mon Sep 17 00:00:00 2001 From: zwZjut Date: Fri, 26 Nov 2021 16:57:41 +0800 Subject: [PATCH] to #7005: transform params to SPRING_DATASOURCE_XXX (#7007) * to #7005: transform params to SPRING_DATASOURCE_XXX * to #7005: exclude h2 Co-authored-by: honghuo.zw --- docker/build/startup-init-conf.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docker/build/startup-init-conf.sh b/docker/build/startup-init-conf.sh index 8b1e381671..ad61829074 100755 --- a/docker/build/startup-init-conf.sh +++ b/docker/build/startup-init-conf.sh @@ -25,11 +25,20 @@ echo "init env variables" #============================================================================ # Database #============================================================================ -export DATABASE_TYPE=${DATABASE_TYPE:-"postgresql"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_TYPE=${DATABASE_TYPE:-"postgresql"} +# export DATABASE_DRIVER=${DATABASE_DRIVER:-"org.postgresql.Driver"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_HOST=${DATABASE_HOST:-"127.0.0.1"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_PORT=${DATABASE_PORT:-"5432"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_USERNAME=${DATABASE_USERNAME:-"root"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_PASSWORD=${DATABASE_PASSWORD:-"root"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_DATABASE=${DATABASE_DATABASE:-"dolphinscheduler"} +[ "h2" == ${DATABASE_TYPE} ] || export DATABASE_PARAMS=${DATABASE_PARAMS:-"characterEncoding=utf8"} +# transform params to SPRING_DATASOURCE_XXX +[ "h2" == ${DATABASE_TYPE} ] || export SPRING_DATASOURCE_URL="jdbc:${DATABASE_TYPE}://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_DATABASE}?${DATABASE_PARAMS}" +[ "h2" == ${DATABASE_TYPE} ] || export SPRING_DATASOURCE_USERNAME=${DATABASE_USERNAME} +[ "h2" == ${DATABASE_TYPE} ] || export SPRING_DATASOURCE_PASSWORD=${DATABASE_PASSWORD} +# export SPRING_DATASOURCE_DRIVER_CLASS_NAME=${DATABASE_DRIVER} -# export SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-"jdbc:postgresql://localhost:5432/dolphinscheduler} -# export SPRING_DATASOURCE_USERNAME=${DATABASE_USERNAME:-"root"} -# export SPRING_DATASOURCE_PASSWORD=${DATABASE_PASSWORD:-"root"} #============================================================================ # Registry