Browse Source

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 <honghuo.zw@alibaba-inc.com>
3.0.0/version-upgrade
zwZjut 3 years ago committed by GitHub
parent
commit
a8aed0f5f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      docker/build/startup-init-conf.sh

17
docker/build/startup-init-conf.sh

@ -25,11 +25,20 @@ echo "init env variables"
#============================================================================ #============================================================================
# Database # 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 # Registry

Loading…
Cancel
Save