Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass custom args to the createdb command #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timaschew
Copy link

No description provided.

@timaschew timaschew force-pushed the pass-createdb-args branch 4 times, most recently from a95fedc to 94385ec Compare October 7, 2021 11:16
@timaschew
Copy link
Author

timaschew commented Oct 7, 2021

What's wrong with my changes?

I did this:

  • sudo dokku plugin:uninstall postgres
  • sudo dokku plugin:install https://github.com/timaschew/dokku-postgres.git --committish pass-createdb-args
dokku plugin:list | grep gres
  postgres             1.15.0 enabled    dokku postgres service plugin

This command: dokku --trace postgres:create synapsedb --createdb-options "--localqe=C --template=template0"

leads to this output:

++ [...] --label dokku.service=postgres postgres:13.4 ale=C --template=template0

Why are some characters removed: --locale=C --template=template0

Here is the full trace

+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo debian
+ DOKKU_DISTRO=debian
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ export DOKKU_CNB_BUILDER=heroku/buildpacks
+ DOKKU_CNB_BUILDER=heroku/buildpacks
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_SYSTEM_GROUP=dokku
+ DOKKU_SYSTEM_GROUP=dokku
+ export DOKKU_SYSTEM_USER=dokku
+ DOKKU_SYSTEM_USER=dokku
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_PID=2766482
+ DOKKU_PID=2766482
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export 'DOKKU_GLOBAL_BUILD_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_BUILD_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ export 'DOKKU_GLOBAL_RUN_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_RUN_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args postgres:create synapsedb --createdb-options '--locale=C --template=template0'
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=('postgres:create' 'synapsedb' '--createdb-options' '--locale=C --template=template0')
+ local args
+ local flags
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ postgres:create == \-\-\a\p\p ]]
+ [[ postgres:create =~ ^--.* ]]
+ next_index=2
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ synapsedb == \-\-\a\p\p ]]
+ [[ synapsedb =~ ^--.* ]]
+ next_index=3
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ --createdb-options == \-\-\a\p\p ]]
+ [[ --createdb-options =~ ^--.* ]]
+ flags=' --createdb-options'
+ next_index=4
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ --locale=C --template=template0 == \-\-\a\p\p ]]
+ [[ --locale=C --template=template0 =~ ^--.* ]]
+ flags=' --createdb-options --locale=C --template=template0'
+ next_index=5
+ [[ -z --trace --createdb-options --locale=C --template=template0 ]]
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ postgres:create =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
+ [[ '' == \t\r\u\e ]]
++ LC_ALL=C
++ /usr/bin/tty
+ [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ postgres:create =~ ^plugin:.* ]]
+ [[ postgres:create == \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ postgres:create == \s\s\h\-\k\e\y\s\:\r\e\m\o\v\e ]]
+ [[ -n '' ]]
+ dokku_auth postgres:create synapsedb --createdb-options '--locale=C --template=template0'
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=admin
+ SSH_USER=admin
+ export SSH_NAME=default
+ SSH_NAME=default
++ wc -l
++ find /var/lib/dokku/plugins/enabled/20_events/user-auth
+ local user_auth_count=1
+ [[ 1 == 0 ]]
+ [[ 1 == 1 ]]
+ [[ -f /var/lib/dokku/plugins/enabled/20_events/user-auth ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd postgres:create synapsedb --createdb-options '--locale=C --template=template0'
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=postgres:create
+ local PLUGIN_CMD=postgres:create
+ local implemented=0
+ local script
+ argv=('postgres:create' 'synapsedb' '--createdb-options' '--locale=C --template=template0')
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/postgres
+ [[ /var/lib/dokku/plugins/available/postgres == *core-plugins* ]]
+ [[ -x /var/lib/dokku/plugins/enabled/postgres:create/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/postgres:create/subcommands/postgres:create ]]
+ [[ -x /var/lib/dokku/plugins/enabled/postgres/subcommands/create ]]
+ [[ -n create ]]
+ /var/lib/dokku/plugins/enabled/postgres/subcommands/create postgres:create synapsedb --createdb-options '--locale=C --template=template0'
+ source /var/lib/dokku/plugins/enabled/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++++ dirname /var/lib/dokku/plugins/enabled/postgres/subcommands/create
+++ cd /var/lib/dokku/plugins/enabled/postgres/subcommands
+++ pwd
++ dirname /var/lib/dokku/plugins/enabled/postgres/subcommands
+ source /var/lib/dokku/plugins/enabled/postgres/functions
++++ dirname /var/lib/dokku/plugins/enabled/postgres/functions
+++ cd /var/lib/dokku/plugins/enabled/postgres
+++ pwd
++ source /var/lib/dokku/plugins/enabled/postgres/config
+++++ dirname /var/lib/dokku/plugins/enabled/postgres/config
++++ cd /var/lib/dokku/plugins/enabled/postgres
++++ pwd
+++ _DIR=/var/lib/dokku/plugins/enabled/postgres
+++ export POSTGRES_IMAGE=postgres
+++ POSTGRES_IMAGE=postgres
+++ export POSTGRES_IMAGE_VERSION=13.4
+++ POSTGRES_IMAGE_VERSION=13.4
+++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
+++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
+++ export POSTGRES_HOST_ROOT=/var/lib/dokku/services/postgres
+++ POSTGRES_HOST_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_UNIMPLEMENTED_SUBCOMMANDS=()
+++ export PLUGIN_UNIMPLEMENTED_SUBCOMMANDS
+++ export PLUGIN_COMMAND_PREFIX=postgres
+++ PLUGIN_COMMAND_PREFIX=postgres
+++ export PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/postgres
+++ PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/postgres
+++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
+++ export PLUGIN_DATA_HOST_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_DATA_HOST_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_DATASTORE_PORTS=('5432')
+++ export PLUGIN_DATASTORE_PORTS
+++ export PLUGIN_DATASTORE_WAIT_PORT=5432
+++ PLUGIN_DATASTORE_WAIT_PORT=5432
+++ export PLUGIN_DEFAULT_ALIAS=DATABASE
+++ PLUGIN_DEFAULT_ALIAS=DATABASE
+++ export PLUGIN_DISABLE_PULL=
+++ PLUGIN_DISABLE_PULL=
+++ export PLUGIN_DISABLE_PULL_VARIABLE=POSTGRES_DISABLE_PULL
+++ PLUGIN_DISABLE_PULL_VARIABLE=POSTGRES_DISABLE_PULL
+++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
+++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
+++ export PLUGIN_IMAGE=postgres
+++ PLUGIN_IMAGE=postgres
+++ export PLUGIN_IMAGE_VERSION=13.4
+++ PLUGIN_IMAGE_VERSION=13.4
+++ export PLUGIN_SCHEME=postgres
+++ PLUGIN_SCHEME=postgres
+++ export PLUGIN_SERVICE=Postgres
+++ PLUGIN_SERVICE=Postgres
+++ export PLUGIN_VARIABLE=POSTGRES
+++ PLUGIN_VARIABLE=POSTGRES
+++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins
+++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins
+++ export PLUGIN_CONFIG_SUFFIX=data
+++ PLUGIN_CONFIG_SUFFIX=data
+++ [[ -n 1 ]]
+++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
+++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
+++ export PLUGIN_BUSYBOX_IMAGE=busybox:1.31.1-uclibc
+++ PLUGIN_BUSYBOX_IMAGE=busybox:1.31.1-uclibc
+++ export PLUGIN_AMBASSADOR_IMAGE=dokku/ambassador:0.3.3
+++ PLUGIN_AMBASSADOR_IMAGE=dokku/ambassador:0.3.3
+++ export PLUGIN_S3BACKUP_IMAGE=dokku/s3backup:0.10.3
+++ PLUGIN_S3BACKUP_IMAGE=dokku/s3backup:0.10.3
+++ export PLUGIN_WAIT_IMAGE=dokku/wait:0.4.3
+++ PLUGIN_WAIT_IMAGE=dokku/wait:0.4.3
+++ export POSTGRES_CONFIG_OPTIONS=
+++ POSTGRES_CONFIG_OPTIONS=
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++++ dirname /var/lib/dokku/plugins/enabled/postgres/functions
+++ cd /var/lib/dokku/plugins/enabled/postgres
+++ pwd
++ source /var/lib/dokku/plugins/enabled/postgres/common-functions
+++++ dirname /var/lib/dokku/plugins/enabled/postgres/common-functions
++++ cd /var/lib/dokku/plugins/enabled/postgres
++++ pwd
+++ source /var/lib/dokku/plugins/enabled/postgres/config
++++++ dirname /var/lib/dokku/plugins/enabled/postgres/config
+++++ cd /var/lib/dokku/plugins/enabled/postgres
+++++ pwd
++++ _DIR=/var/lib/dokku/plugins/enabled/postgres
++++ export POSTGRES_IMAGE=postgres
++++ POSTGRES_IMAGE=postgres
++++ export POSTGRES_IMAGE_VERSION=13.4
++++ POSTGRES_IMAGE_VERSION=13.4
++++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
++++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
++++ export POSTGRES_HOST_ROOT=/var/lib/dokku/services/postgres
++++ POSTGRES_HOST_ROOT=/var/lib/dokku/services/postgres
++++ PLUGIN_UNIMPLEMENTED_SUBCOMMANDS=()
++++ export PLUGIN_UNIMPLEMENTED_SUBCOMMANDS
++++ export PLUGIN_COMMAND_PREFIX=postgres
++++ PLUGIN_COMMAND_PREFIX=postgres
++++ export PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/postgres
++++ PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/postgres
++++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
++++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
++++ export PLUGIN_DATA_HOST_ROOT=/var/lib/dokku/services/postgres
++++ PLUGIN_DATA_HOST_ROOT=/var/lib/dokku/services/postgres
++++ PLUGIN_DATASTORE_PORTS=('5432')
++++ export PLUGIN_DATASTORE_PORTS
++++ export PLUGIN_DATASTORE_WAIT_PORT=5432
++++ PLUGIN_DATASTORE_WAIT_PORT=5432
++++ export PLUGIN_DEFAULT_ALIAS=DATABASE
++++ PLUGIN_DEFAULT_ALIAS=DATABASE
++++ export PLUGIN_DISABLE_PULL=
++++ PLUGIN_DISABLE_PULL=
++++ export PLUGIN_DISABLE_PULL_VARIABLE=POSTGRES_DISABLE_PULL
++++ PLUGIN_DISABLE_PULL_VARIABLE=POSTGRES_DISABLE_PULL
++++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
++++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
++++ export PLUGIN_IMAGE=postgres
++++ PLUGIN_IMAGE=postgres
++++ export PLUGIN_IMAGE_VERSION=13.4
++++ PLUGIN_IMAGE_VERSION=13.4
++++ export PLUGIN_SCHEME=postgres
++++ PLUGIN_SCHEME=postgres
++++ export PLUGIN_SERVICE=Postgres
++++ PLUGIN_SERVICE=Postgres
++++ export PLUGIN_VARIABLE=POSTGRES
++++ PLUGIN_VARIABLE=POSTGRES
++++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins
++++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins
++++ export PLUGIN_CONFIG_SUFFIX=data
++++ PLUGIN_CONFIG_SUFFIX=data
++++ [[ -n 1 ]]
++++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
++++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
++++ export PLUGIN_BUSYBOX_IMAGE=busybox:1.31.1-uclibc
++++ PLUGIN_BUSYBOX_IMAGE=busybox:1.31.1-uclibc
++++ export PLUGIN_AMBASSADOR_IMAGE=dokku/ambassador:0.3.3
++++ PLUGIN_AMBASSADOR_IMAGE=dokku/ambassador:0.3.3
++++ export PLUGIN_S3BACKUP_IMAGE=dokku/s3backup:0.10.3
++++ PLUGIN_S3BACKUP_IMAGE=dokku/s3backup:0.10.3
++++ export PLUGIN_WAIT_IMAGE=dokku/wait:0.4.3
++++ PLUGIN_WAIT_IMAGE=dokku/wait:0.4.3
++++ export POSTGRES_CONFIG_OPTIONS=
++++ POSTGRES_CONFIG_OPTIONS=
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/plugins/available/config/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
++ source /var/lib/dokku/plugins/enabled/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ [[ -f /var/lib/dokku/plugins/available/docker-options/functions ]]
++ source /var/lib/dokku/plugins/available/docker-options/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+++ AVAILABLE_PHASES=(build deploy run)
+ service-create-cmd postgres:create synapsedb --createdb-options '--locale=C --template=template0'
+ declare 'desc=create a Postgres service'
+ argv=('postgres:create' 'synapsedb' '--createdb-options' '--locale=C --template=template0')
+ local cmd=postgres:create argv
+ [[ postgres:create == \p\o\s\t\g\r\e\s\:\c\r\e\a\t\e ]]
+ shift 1
+ CREATE_FLAGS_LIST=('--createdb-options' '--locale=C --template=template0')
+ declare SERVICE=synapsedb CREATE_FLAGS_LIST
+ service_create synapsedb --createdb-options '--locale=C --template=template0'
+ local SERVICE=synapsedb
+ is_valid_service_name synapsedb
+ declare 'desc=validate a service name'
+ declare SERVICE=synapsedb
+ [[ -z synapsedb ]]
+ [[ synapsedb =~ ^[A-Za-z0-9_-]+$ ]]
+ return 0
+ [[ -z synapsedb ]]
+ [[ ! -d /var/lib/dokku/services/postgres/synapsedb ]]
+ SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
+ LINKS_FILE=/var/lib/dokku/services/postgres/synapsedb/LINKS
+ service_parse_args --createdb-options '--locale=C --template=template0'
+ declare 'desc=cli arg parser'
+ local next_index=1
+ local skip=false
+ args=('--createdb-options' '--locale=C --template=template0')
+ local args
+ for arg in "$@"
+ shift
+ case "$arg" in
+ set -- '--locale=C --template=template0' --createdb-options
+ for arg in "$@"
+ shift
+ case "$arg" in
+ set -- --createdb-options '--locale=C --template=template0'
+ OPTIND=1
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
/var/lib/dokku/plugins/enabled/postgres/subcommands/create: illegal option -- -
+ case "$opt" in
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
+ case "$opt" in
+ export PLUGIN_CONFIG_OPTIONS=reatedb-options
+ PLUGIN_CONFIG_OPTIONS=reatedb-options
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
/var/lib/dokku/plugins/enabled/postgres/subcommands/create: illegal option -- -
+ case "$opt" in
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
/var/lib/dokku/plugins/enabled/postgres/subcommands/create: illegal option -- l
+ case "$opt" in
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
/var/lib/dokku/plugins/enabled/postgres/subcommands/create: illegal option -- o
+ case "$opt" in
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
+ case "$opt" in
+ export 'PLUGIN_CONFIG_OPTIONS=ale=C --template=template0'
+ PLUGIN_CONFIG_OPTIONS='ale=C --template=template0'
+ getopts a:c:C:d:i:I:m:p:q:R:r:s:u: opt
+ shift 2
+ service_image_exists synapsedb
+ declare 'desc=check if the current image exists'
+ declare SERVICE=synapsedb
+ local plugin_image=postgres
+ local plugin_image_version=13.4
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/IMAGE ]]
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/IMAGE_VERSION ]]
+ local IMAGE=postgres:13.4
++ docker images -q postgres:13.4
+ [[ cd4b5373985e == '' ]]
+ return 0
+ plugn trigger service-action pre-create synapsedb
+ mkdir -p /var/lib/dokku/services/postgres/synapsedb
+ mkdir -p /var/lib/dokku/services/postgres/synapsedb/data
+ touch /var/lib/dokku/services/postgres/synapsedb/LINKS
++ openssl rand -hex 16
+ PASSWORD=fcaf3d48617e5042d6cf8688693ac0e8
+ [[ -n '' ]]
+ echo fcaf3d48617e5042d6cf8688693ac0e8
+ chmod 640 /var/lib/dokku/services/postgres/synapsedb/PASSWORD
+ service_commit_config synapsedb
+ declare SERVICE=synapsedb
+ local SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
+ local CONFIG_VARIABLE=POSTGRES_CONFIG_OPTIONS
+ local ENV_VARIABLE=POSTGRES_CUSTOM_ENV
+ custom_env=
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo ''
+ config_options=
+ [[ -n ale=C --template=template0 ]]
+ config_options='ale=C --template=template0'
+ [[ -n ale=C --template=template0 ]]
+ echo 'ale=C --template=template0'
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n postgres ]]
+ echo postgres
+ [[ -n 13.4 ]]
+ echo 13.4
+ write_database_name synapsedb
+ declare 'desc=write a sanitized database name'
+ declare SERVICE=synapsedb
+ local SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
+ echo synapsedb
+ tr .- _
+ plugn trigger service-action post-create synapsedb
+ service_create_container synapsedb
+ local SERVICE=synapsedb
+ local SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
+ local SERVICE_HOST_ROOT=/var/lib/dokku/services/postgres/synapsedb
++ get_service_name synapsedb
++ declare 'desc=retrieve a docker service label'
++ declare SERVICE=synapsedb
++ echo dokku.postgres.synapsedb
+ local SERVICE_NAME=dokku.postgres.synapsedb
++ service_password synapsedb
++ declare 'desc=fetch the password for a service'
++ declare SERVICE=synapsedb
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
++ local PASSWORD_FILE=/var/lib/dokku/services/postgres/synapsedb/PASSWORD
++ [[ -f /var/lib/dokku/services/postgres/synapsedb/PASSWORD ]]
++ cat /var/lib/dokku/services/postgres/synapsedb/PASSWORD
+ local PASSWORD=fcaf3d48617e5042d6cf8688693ac0e8
++ get_database_name synapsedb
++ declare 'desc=retrieve a sanitized database name'
++ declare SERVICE=synapsedb
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/synapsedb
++ [[ ! -f /var/lib/dokku/services/postgres/synapsedb/DATABASE_NAME ]]
++ cat /var/lib/dokku/services/postgres/synapsedb/DATABASE_NAME
+ local DATABASE_NAME=synapsedb
+ local PREVIOUS_ID
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/CONFIG_OPTIONS ]]
++ cat /var/lib/dokku/services/postgres/synapsedb/CONFIG_OPTIONS
+ export 'CONFIG_OPTIONS=ale=C --template=template0'
+ CONFIG_OPTIONS='ale=C --template=template0'
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/CREATEDB_OPTIONS ]]
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/SERVICE_MEMORY ]]
+ [[ -n '' ]]
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/SHM_SIZE ]]
+ [[ -n '' ]]
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/IMAGE ]]
++ cat /var/lib/dokku/services/postgres/synapsedb/IMAGE
+ PLUGIN_IMAGE=postgres
+ [[ -f /var/lib/dokku/services/postgres/synapsedb/IMAGE_VERSION ]]
++ cat /var/lib/dokku/services/postgres/synapsedb/IMAGE_VERSION
+ PLUGIN_IMAGE_VERSION=13.4
++ docker run --name dokku.postgres.synapsedb -v /var/lib/dokku/services/postgres/synapsedb/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=fcaf3d48617e5042d6cf8688693ac0e8 --env-file=/var/lib/dokku/services/postgres/synapsedb/ENV -d --restart always --label dokku=service --label dokku.service=postgres postgres:13.4 ale=C --template=template0
+ ID=82ae098a0f73cab3364b1fa560e3cfda8ea33fdef29f32fda2d61815887367a6
+ echo 82ae098a0f73cab3364b1fa560e3cfda8ea33fdef29f32fda2d61815887367a6
+ dokku_log_verbose_quiet 'Waiting for container to be ready'
+ declare 'desc=log verbose formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '       Waiting for container to be ready'
       Waiting for container to be ready
+ docker run --rm --link dokku.postgres.synapsedb:postgres dokku/wait:0.4.3 -p 5432
  ERROR: unable to connect

functions Show resolved Hide resolved
@josegonzalez
Copy link
Member

Would it be better to support custom-env in the database create call?

functions Show resolved Hide resolved
@timaschew
Copy link
Author

Would it be better to support custom-env in the database create call?

You mean one env for the encoding, one for the locale, one for the template, etc. (for all createdb options)?

@josegonzalez
Copy link
Member

josegonzalez commented Oct 7, 2021

Actually ignore that comment about custom-env, I can't remember what I was talking about.

@timaschew timaschew force-pushed the pass-createdb-args branch 2 times, most recently from a2242c7 to 798c9f2 Compare October 7, 2021 21:54
subcommands/create Outdated Show resolved Hide resolved
common-functions Show resolved Hide resolved
@timaschew timaschew force-pushed the pass-createdb-args branch 4 times, most recently from ced1eb7 to c8acd88 Compare October 12, 2021 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants