File tree Expand file tree Collapse file tree 5 files changed +14
-2
lines changed Expand file tree Collapse file tree 5 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ dokku postgres:create <service> [--create-flags...]
6666flags:
6767
6868- ` -c|--config-options "--args --go=here" ` : extra arguments to pass to the container create command (default: ` None ` )
69+ - ` -c|--createdb-options "--locale=C" ` : extra arguments to pass to the ` createdb ` command inside the container (default: ` -E=UTF8 ` )
6970- ` -C|--custom-env "USER=alpha;HOST=beta" ` : semi-colon delimited environment variables to start the service with
7071- ` -i|--image IMAGE ` : the image name to start the service with
7172- ` -I|--image-version IMAGE_VERSION ` : the image version to start the service with
Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ service_commit_config() {
269269 echo " $SERVICE_MEMORY " > " $SERVICE_ROOT /SERVICE_MEMORY"
270270 fi
271271
272+ if [[ -n " $CREATEDB_OPTIONS " ]]; then
273+ echo " $CREATEDB_OPTIONS " > " $SERVICE_ROOT /CREATEDB_OPTIONS"
274+ fi
275+
272276 if [[ -n " $SERVICE_SHM_SIZE " ]]; then
273277 echo " $SERVICE_SHM_SIZE " > " $SERVICE_ROOT /SHM_SIZE"
274278 fi
@@ -452,6 +456,7 @@ service_info() {
452456 local flag_map=(
453457 " --config-dir: ${SERVICE_ROOT} /${PLUGIN_CONFIG_SUFFIX} "
454458 " --config-options: $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
459+ " --createdb-options: $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
455460 " --data-dir: ${SERVICE_ROOT} /data"
456461 " --dsn: ${SERVICE_URL} "
457462 " --exposed-ports: $( service_exposed_ports " $SERVICE " ) "
@@ -606,6 +611,7 @@ service_parse_args() {
606611 case " $arg " in
607612 " --alias" ) set -- " $@ " " -a" ;;
608613 " --config-options" ) set -- " $@ " " -c" ;;
614+ " --createdb-options" ) set -- " $@ " " -o" ;;
609615 " --custom-env" ) set -- " $@ " " -C" ;;
610616 " --database" ) set -- " $@ " " -d" ;;
611617 " --image-version" ) set -- " $@ " " -I" ;;
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ service_create_container() {
7373 export CONFIG_OPTIONS=" $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
7474 fi
7575
76+ if [[ -f " $SERVICE_ROOT /CREATEDB_OPTIONS" ]]; then
77+ export CREATEDB_OPTIONS=" $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
78+ fi
79+
7680 [[ -f " $SERVICE_ROOT /SERVICE_MEMORY" ]] && SERVICE_MEMORY=" $( cat " $SERVICE_ROOT /SERVICE_MEMORY" ) "
7781 if [[ -n " $SERVICE_MEMORY " ]]; then
7882 MEMORY_LIMIT=" --memory=${SERVICE_MEMORY} m"
@@ -94,7 +98,7 @@ service_create_container() {
9498 docker run --rm --link " $SERVICE_NAME :$PLUGIN_COMMAND_PREFIX " " $PLUGIN_WAIT_IMAGE " -p " $PLUGIN_DATASTORE_WAIT_PORT " > /dev/null
9599
96100 dokku_log_verbose_quiet " Creating container database"
97- docker exec " $SERVICE_NAME " su - postgres -c " createdb -E utf8 $DATABASE_NAME " 2> /dev/null || dokku_log_verbose_quiet ' Already exists'
101+ docker exec " $SERVICE_NAME " su - postgres -c " createdb -E=UTF8 $CREATEDB_OPTIONS $DATABASE_NAME " 2> /dev/null || dokku_log_verbose_quiet ' Already exists'
98102
99103 dokku_log_verbose_quiet " Securing connection to database"
100104 service_stop " $SERVICE " > /dev/null
Original file line number Diff line number Diff line change 11[plugin ]
22description = " dokku postgres service plugin"
3- version = " 1.14.1 "
3+ version = " 1.15.2 "
44[plugin .config ]
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ service-create-cmd() {
1919 # E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
2020 # A service, service to run command against
2121 # F -c|--config-options "--args --go=here", extra arguments to pass to the container create command
22+ # F -c|--createdb-options "--locale=C ", extra arguments to pass to the createdb command inside the container
2223 # F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
2324 # F -i|--image IMAGE, the image name to start the service with
2425 # F -I|--image-version IMAGE_VERSION, the image version to start the service with
You can’t perform that action at this time.
0 commit comments