Giter Club home page Giter Club logo

dokku-postgres's Issues

Cron jobs for scheduled backups are not launched due to insecure permissions

Hello, I use dokku 0.8.0 on ubuntu 16.04 with the most recent version of the postgresql plugin and I have found out that scheduled backups are not launched.

In the logs I have the following messages

Jan 11 13:30:01 dokku-ovh1-002 cron[754]: (*system*dokku-postgres-plumber-prod) INSECURE MODE (group/other writable) (/etc/cron.d/dokku-postgres-plumber-prod)
Jan 11 13:30:01 dokku-ovh1-002 cron[754]: (*system*dokku-postgres-agenda-prod) INSECURE MODE (group/other writable) (/etc/cron.d/dokku-postgres-agenda-prod)

Indeed, created files are group-writable:

# ls -l /etc/cron.d/
total 20
-rw-rw-r-- 1 root root  53 Jan 10 17:21 dokku-postgres-agenda-prod
-rw-rw-r-- 1 root root  54 Jan 10 17:10 dokku-postgres-plumber-prod
-rw-rw-r-- 1 root root  52 Jan 10 16:36 dokku-postgres-vault-prod
-rw-r--r-- 1 root root 589 Jul 16  2014 mdadm
-rw-r--r-- 1 root root 191 Jan 12  2016 popularity-contest

1.0 release

This plugin should be considered as ready for a 1.0 release.

sudo asking for password of dokku user on postgres:backup-schedule

When I launch such command on the dokku machine (not via SSH):

# dokku postgres:backup-schedule myapp "0 4 * * *" mybucket

it ends up on asking for password for dokku

[sudo] password for dokku:

That happens regardless if I call it as root or as dokku.

Other posgres commands work fine.

Dokku 0.8.0.

list function doesn't work

same problem as described here but for dokku-mariadb

I've got this problem.

root@dokku:~# dokku version
v0.5.6-21-g25a2801

if you delete dir * it seems to be fine

root@dokku:~# ls -la /var/lib/dokku/services/postgres
total 52
drwxr-xr-x 13 dokku dokku 4096 May 18 10:21 .
drwxr-xr-x  9 root  root  4096 May 17 07:34 ..
drwxrwxr-x  2 dokku dokku 4096 May 18 10:19 *
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 21ad72b2ac
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 2510dfd74d
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 29d0d9661a
drwxrwxr-x  3 dokku dokku 4096 May 18 10:20 48c75b5374
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 490be2023b
drwxrwxr-x  3 dokku dokku 4096 May 18 10:20 80853c917a
drwxrwxr-x  3 dokku dokku 4096 May 18 10:19 8fa86479e7
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 c3fc65bf66
drwxrwxr-x  3 dokku dokku 4096 May 18 10:20 f86397cfaf
drwxrwxr-x  3 dokku dokku 4096 May 18 10:21 fb474bd1d6

Here is my trace

Enabling dokku trace
root@dokku:~# dokku postgres:list
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ 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_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_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_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_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args postgres:list
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ return 0
+ args=("$@")
+ [[ postgres:list =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ root != \d\o\k\k\u ]]
+ [[ ! postgres:list =~ plugin:* ]]
++ id -un
+ export SSH_USER=root
+ SSH_USER=root
+ sudo -u dokku -E -H /usr/local/bin/dokku postgres:list
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ 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_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_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_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_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args postgres:list
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ return 0
+ args=("$@")
+ [[ postgres:list =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
++ id -un
+ [[ dokku != \r\o\o\t ]]
+ [[ postgres:list =~ ^plugin:.* ]]
+ [[ -n '' ]]
+ dokku_auth postgres:list
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
+ plugn trigger user-auth root default postgres:list
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd postgres:list
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=postgres:list
+ local PLUGIN_CMD=postgres:list
+ local implemented=0
+ local script
+ argv=("$@")
+ 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:list/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/postgres:list/subcommands/postgres:list ]]
+ [[ -x /var/lib/dokku/plugins/enabled/postgres/subcommands/list ]]
+ /var/lib/dokku/plugins/enabled/postgres/subcommands/list postgres:list
+ source /var/lib/dokku/plugins/enabled/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++++ dirname /var/lib/dokku/plugins/enabled/postgres/subcommands/list
+++ 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
+++ export POSTGRES_IMAGE=postgres
+++ POSTGRES_IMAGE=postgres
+++ export POSTGRES_IMAGE_VERSION=9.5.2
+++ POSTGRES_IMAGE_VERSION=9.5.2
+++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
+++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
+++ export PLUGIN_COMMAND_PREFIX=postgres
+++ PLUGIN_COMMAND_PREFIX=postgres
+++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
+++ PLUGIN_DATASTORE_PORTS=(5432)
+++ export PLUGIN_DATASTORE_PORTS
+++ export PLUGIN_DEFAULT_ALIAS=DATABASE
+++ PLUGIN_DEFAULT_ALIAS=DATABASE
+++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
+++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
+++ export PLUGIN_IMAGE=postgres
+++ PLUGIN_IMAGE=postgres
+++ export PLUGIN_IMAGE_VERSION=9.5.2
+++ PLUGIN_IMAGE_VERSION=9.5.2
+++ export PLUGIN_SCHEME=postgres
+++ PLUGIN_SCHEME=postgres
+++ export PLUGIN_SERVICE=Postgres
+++ PLUGIN_SERVICE=Postgres
+++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins
+++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins
+++ [[ -n 1 ]]
+++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
+++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
++ 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/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)
+ postgres-list-cmd postgres:list
+ declare 'desc=list all Postgres services'
+ argv=("$@")
+ local cmd=postgres:list argv
+ [[ postgres:list == \p\o\s\t\g\r\e\s\:\l\i\s\t ]]
+ shift 1
+ service_list
++ ls /var/lib/dokku/services/postgres
+ local 'SERVICES=*
21ad72b2ac
2510dfd74d
29d0d9661a
48c75b5374
490be2023b
80853c917a
8fa86479e7
c3fc65bf66
f86397cfaf
fb474bd1d6'
+ [[ -z *
21ad72b2ac
2510dfd74d
29d0d9661a
48c75b5374
490be2023b
80853c917a
8fa86479e7
c3fc65bf66
f86397cfaf
fb474bd1d6 ]]
+ LIST='NAME,VERSION,STATUS,EXPOSED PORTS,LINKS\n'
+ for SERVICE in '$SERVICES'
++ service_version '*'
++ local 'SERVICE=*'
+++ get_service_name '*'
+++ local 'SERVICE=*'
+++ echo 'dokku.postgres.*'
++ local 'SERVICE_NAME=dokku.postgres.*'
++ docker inspect -f '{{.Config.Image}}' 'dokku.postgres.*'
Error: No such image or container: dokku.postgres.*
++ service_status '*'
++ local 'SERVICE=*'
++ local 'SERVICE_ROOT=/var/lib/dokku/services/postgres/*'
+++ cat '/var/lib/dokku/services/postgres/*/ID'
cat: /var/lib/dokku/services/postgres/*/ID: No such file or directory
++ local ID=
++ is_container_status '' Dead
++ local CID=
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' ''
json: cannot unmarshal array into Go value of type types.ContainerJSON
+++ true
++ local CONTAINER_STATUS=
++ [[ '' == \t\r\u\e ]]
++ return 1
++ is_container_status '' OOMKilled
++ local CID=
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' ''
json: cannot unmarshal array into Go value of type types.ContainerJSON
+++ true
++ local CONTAINER_STATUS=
++ [[ '' == \t\r\u\e ]]
++ return 1
++ is_container_status '' Paused
++ local CID=
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' ''
json: cannot unmarshal array into Go value of type types.ContainerJSON
+++ true
++ local CONTAINER_STATUS=
++ [[ '' == \t\r\u\e ]]
++ return 1
++ is_container_status '' Restarting
++ local CID=
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' ''
json: cannot unmarshal array into Go value of type types.ContainerJSON
+++ true
++ local CONTAINER_STATUS=
++ [[ '' == \t\r\u\e ]]
++ return 1
++ is_container_status '' Running
++ local CID=
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' ''
json: cannot unmarshal array into Go value of type types.ContainerJSON
+++ true
++ local CONTAINER_STATUS=
++ [[ '' == \t\r\u\e ]]
++ return 1
++ echo stopped
++ return 0
++ service_exposed_ports '*'
++ local 'SERVICE=*'
++ local 'SERVICE_ROOT=/var/lib/dokku/services/postgres/*'
++ local 'PORT_FILE=/var/lib/dokku/services/postgres/*/PORT'
++ [[ ! -f /var/lib/dokku/services/postgres/*/PORT ]]
++ echo -
++ return 0
++ service_linked_apps '*'
++ local 'SERVICE=*'
++ local 'SERVICE_ROOT=/var/lib/dokku/services/postgres/*'
++ local 'LINKS_FILE=/var/lib/dokku/services/postgres/*/LINKS'
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='*,,stopped,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 21ad72b2ac
++ local SERVICE=21ad72b2ac
+++ get_service_name 21ad72b2ac
+++ local SERVICE=21ad72b2ac
+++ echo dokku.postgres.21ad72b2ac
++ local SERVICE_NAME=dokku.postgres.21ad72b2ac
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.21ad72b2ac
++ service_status 21ad72b2ac
++ local SERVICE=21ad72b2ac
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/21ad72b2ac
+++ cat /var/lib/dokku/services/postgres/21ad72b2ac/ID
++ local ID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ is_container_status a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037 Dead
++ local CID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037 OOMKilled
++ local CID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037 Paused
++ local CID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037 Restarting
++ local CID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037 Running
++ local CID=a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' a751b0168ebe1b74d5c5839ba4218114d85d8498f742802e873e999f25182037
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 21ad72b2ac
++ local SERVICE=21ad72b2ac
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/21ad72b2ac
++ local PORT_FILE=/var/lib/dokku/services/postgres/21ad72b2ac/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/21ad72b2ac/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 21ad72b2ac
++ local SERVICE=21ad72b2ac
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/21ad72b2ac
++ local LINKS_FILE=/var/lib/dokku/services/postgres/21ad72b2ac/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='21ad72b2ac,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 2510dfd74d
++ local SERVICE=2510dfd74d
+++ get_service_name 2510dfd74d
+++ local SERVICE=2510dfd74d
+++ echo dokku.postgres.2510dfd74d
++ local SERVICE_NAME=dokku.postgres.2510dfd74d
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.2510dfd74d
++ service_status 2510dfd74d
++ local SERVICE=2510dfd74d
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/2510dfd74d
+++ cat /var/lib/dokku/services/postgres/2510dfd74d/ID
++ local ID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ is_container_status ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155 Dead
++ local CID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155 OOMKilled
++ local CID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155 Paused
++ local CID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155 Restarting
++ local CID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155 Running
++ local CID=ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' ce5a8483ec73f714d7b502e4b5c17d6d7abf1ed0f0ba6a0d771b701e9ec5b155
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 2510dfd74d
++ local SERVICE=2510dfd74d
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/2510dfd74d
++ local PORT_FILE=/var/lib/dokku/services/postgres/2510dfd74d/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/2510dfd74d/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 2510dfd74d
++ local SERVICE=2510dfd74d
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/2510dfd74d
++ local LINKS_FILE=/var/lib/dokku/services/postgres/2510dfd74d/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='2510dfd74d,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 29d0d9661a
++ local SERVICE=29d0d9661a
+++ get_service_name 29d0d9661a
+++ local SERVICE=29d0d9661a
+++ echo dokku.postgres.29d0d9661a
++ local SERVICE_NAME=dokku.postgres.29d0d9661a
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.29d0d9661a
++ service_status 29d0d9661a
++ local SERVICE=29d0d9661a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/29d0d9661a
+++ cat /var/lib/dokku/services/postgres/29d0d9661a/ID
++ local ID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ is_container_status c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f Dead
++ local CID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f OOMKilled
++ local CID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f Paused
++ local CID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f Restarting
++ local CID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f Running
++ local CID=c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' c06375e0415c393e810ed0871d162260bfd51e4cf7b6b4526ffafa9bd60e3c4f
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 29d0d9661a
++ local SERVICE=29d0d9661a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/29d0d9661a
++ local PORT_FILE=/var/lib/dokku/services/postgres/29d0d9661a/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/29d0d9661a/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 29d0d9661a
++ local SERVICE=29d0d9661a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/29d0d9661a
++ local LINKS_FILE=/var/lib/dokku/services/postgres/29d0d9661a/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='29d0d9661a,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 48c75b5374
++ local SERVICE=48c75b5374
+++ get_service_name 48c75b5374
+++ local SERVICE=48c75b5374
+++ echo dokku.postgres.48c75b5374
++ local SERVICE_NAME=dokku.postgres.48c75b5374
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.48c75b5374
++ service_status 48c75b5374
++ local SERVICE=48c75b5374
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/48c75b5374
+++ cat /var/lib/dokku/services/postgres/48c75b5374/ID
++ local ID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ is_container_status 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42 Dead
++ local CID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42 OOMKilled
++ local CID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42 Paused
++ local CID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42 Restarting
++ local CID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42 Running
++ local CID=4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' 4b296dd22d04617f136968ecf179d271f8e3e55d22b0677827d3bf6412021d42
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 48c75b5374
++ local SERVICE=48c75b5374
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/48c75b5374
++ local PORT_FILE=/var/lib/dokku/services/postgres/48c75b5374/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/48c75b5374/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 48c75b5374
++ local SERVICE=48c75b5374
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/48c75b5374
++ local LINKS_FILE=/var/lib/dokku/services/postgres/48c75b5374/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='48c75b5374,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 490be2023b
++ local SERVICE=490be2023b
+++ get_service_name 490be2023b
+++ local SERVICE=490be2023b
+++ echo dokku.postgres.490be2023b
++ local SERVICE_NAME=dokku.postgres.490be2023b
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.490be2023b
++ service_status 490be2023b
++ local SERVICE=490be2023b
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/490be2023b
+++ cat /var/lib/dokku/services/postgres/490be2023b/ID
++ local ID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ is_container_status e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45 Dead
++ local CID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45 OOMKilled
++ local CID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45 Paused
++ local CID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45 Restarting
++ local CID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45 Running
++ local CID=e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' e9bc7a5fc341a92da3ea14614d4a5a3203c21383d87a231d7ded24bbee9fbb45
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 490be2023b
++ local SERVICE=490be2023b
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/490be2023b
++ local PORT_FILE=/var/lib/dokku/services/postgres/490be2023b/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/490be2023b/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 490be2023b
++ local SERVICE=490be2023b
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/490be2023b
++ local LINKS_FILE=/var/lib/dokku/services/postgres/490be2023b/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='490be2023b,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 80853c917a
++ local SERVICE=80853c917a
+++ get_service_name 80853c917a
+++ local SERVICE=80853c917a
+++ echo dokku.postgres.80853c917a
++ local SERVICE_NAME=dokku.postgres.80853c917a
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.80853c917a
++ service_status 80853c917a
++ local SERVICE=80853c917a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/80853c917a
+++ cat /var/lib/dokku/services/postgres/80853c917a/ID
++ local ID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ is_container_status 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b Dead
++ local CID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b OOMKilled
++ local CID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b Paused
++ local CID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b Restarting
++ local CID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b Running
++ local CID=98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' 98cf5daecf979166eec70caec452414e9515061946743147e7d3fb22e73e1c2b
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 80853c917a
++ local SERVICE=80853c917a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/80853c917a
++ local PORT_FILE=/var/lib/dokku/services/postgres/80853c917a/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/80853c917a/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 80853c917a
++ local SERVICE=80853c917a
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/80853c917a
++ local LINKS_FILE=/var/lib/dokku/services/postgres/80853c917a/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='80853c917a,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version 8fa86479e7
++ local SERVICE=8fa86479e7
+++ get_service_name 8fa86479e7
+++ local SERVICE=8fa86479e7
+++ echo dokku.postgres.8fa86479e7
++ local SERVICE_NAME=dokku.postgres.8fa86479e7
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.8fa86479e7
++ service_status 8fa86479e7
++ local SERVICE=8fa86479e7
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/8fa86479e7
+++ cat /var/lib/dokku/services/postgres/8fa86479e7/ID
++ local ID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ is_container_status 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38 Dead
++ local CID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38 OOMKilled
++ local CID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38 Paused
++ local CID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38 Restarting
++ local CID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38 Running
++ local CID=5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' 5b94a71de5b1ca4141e04a01b7ad8d79690610fc9ab46d42021244389c4d5a38
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports 8fa86479e7
++ local SERVICE=8fa86479e7
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/8fa86479e7
++ local PORT_FILE=/var/lib/dokku/services/postgres/8fa86479e7/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/8fa86479e7/PORT ]]
++ echo -
++ return 0
++ service_linked_apps 8fa86479e7
++ local SERVICE=8fa86479e7
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/8fa86479e7
++ local LINKS_FILE=/var/lib/dokku/services/postgres/8fa86479e7/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='8fa86479e7,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version c3fc65bf66
++ local SERVICE=c3fc65bf66
+++ get_service_name c3fc65bf66
+++ local SERVICE=c3fc65bf66
+++ echo dokku.postgres.c3fc65bf66
++ local SERVICE_NAME=dokku.postgres.c3fc65bf66
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.c3fc65bf66
++ service_status c3fc65bf66
++ local SERVICE=c3fc65bf66
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/c3fc65bf66
+++ cat /var/lib/dokku/services/postgres/c3fc65bf66/ID
++ local ID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ is_container_status ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f Dead
++ local CID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f OOMKilled
++ local CID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f Paused
++ local CID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f Restarting
++ local CID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f Running
++ local CID=ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' ebada60c7048af7aba3c7a1d0db0c94c0bf4bfd544666716e9e753637297400f
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports c3fc65bf66
++ local SERVICE=c3fc65bf66
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/c3fc65bf66
++ local PORT_FILE=/var/lib/dokku/services/postgres/c3fc65bf66/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/c3fc65bf66/PORT ]]
++ echo -
++ return 0
++ service_linked_apps c3fc65bf66
++ local SERVICE=c3fc65bf66
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/c3fc65bf66
++ local LINKS_FILE=/var/lib/dokku/services/postgres/c3fc65bf66/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='c3fc65bf66,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version f86397cfaf
++ local SERVICE=f86397cfaf
+++ get_service_name f86397cfaf
+++ local SERVICE=f86397cfaf
+++ echo dokku.postgres.f86397cfaf
++ local SERVICE_NAME=dokku.postgres.f86397cfaf
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.f86397cfaf
++ service_status f86397cfaf
++ local SERVICE=f86397cfaf
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/f86397cfaf
+++ cat /var/lib/dokku/services/postgres/f86397cfaf/ID
++ local ID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ is_container_status 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c Dead
++ local CID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c OOMKilled
++ local CID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c Paused
++ local CID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c Restarting
++ local CID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c Running
++ local CID=99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' 99996095c62b6a3783630a4a3017d10c89aa1fe37e8a6d0ea9263d0ccd63d26c
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports f86397cfaf
++ local SERVICE=f86397cfaf
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/f86397cfaf
++ local PORT_FILE=/var/lib/dokku/services/postgres/f86397cfaf/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/f86397cfaf/PORT ]]
++ echo -
++ return 0
++ service_linked_apps f86397cfaf
++ local SERVICE=f86397cfaf
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/f86397cfaf
++ local LINKS_FILE=/var/lib/dokku/services/postgres/f86397cfaf/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='f86397cfaf,postgres:9.5.2,running,-,-\n'
+ for SERVICE in '$SERVICES'
++ service_version fb474bd1d6
++ local SERVICE=fb474bd1d6
+++ get_service_name fb474bd1d6
+++ local SERVICE=fb474bd1d6
+++ echo dokku.postgres.fb474bd1d6
++ local SERVICE_NAME=dokku.postgres.fb474bd1d6
++ docker inspect -f '{{.Config.Image}}' dokku.postgres.fb474bd1d6
++ service_status fb474bd1d6
++ local SERVICE=fb474bd1d6
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/fb474bd1d6
+++ cat /var/lib/dokku/services/postgres/fb474bd1d6/ID
++ local ID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ is_container_status d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e Dead
++ local CID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local 'TEMPLATE={{.State.Dead}}'
+++ docker inspect -f '{{.State.Dead}}' d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e OOMKilled
++ local CID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local 'TEMPLATE={{.State.OOMKilled}}'
+++ docker inspect -f '{{.State.OOMKilled}}' d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e Paused
++ local CID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local 'TEMPLATE={{.State.Paused}}'
+++ docker inspect -f '{{.State.Paused}}' d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e Restarting
++ local CID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local 'TEMPLATE={{.State.Restarting}}'
+++ docker inspect -f '{{.State.Restarting}}' d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local CONTAINER_STATUS=false
++ [[ false == \t\r\u\e ]]
++ return 1
++ is_container_status d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e Running
++ local CID=d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local 'TEMPLATE={{.State.Running}}'
+++ docker inspect -f '{{.State.Running}}' d086fb09e405214a8edb34532eb76b1afd54e9a490f2434461685e427a93552e
++ local CONTAINER_STATUS=true
++ [[ true == \t\r\u\e ]]
++ return 0
++ echo running
++ return 0
++ service_exposed_ports fb474bd1d6
++ local SERVICE=fb474bd1d6
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/fb474bd1d6
++ local PORT_FILE=/var/lib/dokku/services/postgres/fb474bd1d6/PORT
++ [[ ! -f /var/lib/dokku/services/postgres/fb474bd1d6/PORT ]]
++ echo -
++ return 0
++ service_linked_apps fb474bd1d6
++ local SERVICE=fb474bd1d6
++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/fb474bd1d6
++ local LINKS_FILE=/var/lib/dokku/services/postgres/fb474bd1d6/LINKS
++ [[ -z '' ]]
++ echo -
++ return 0
+ LIST+='fb474bd1d6,postgres:9.5.2,running,-,-\n'
+ column -t -s,
+ printf %b 'NAME,VERSION,STATUS,EXPOSED PORTS,LINKS\n*,,stopped,-,-\n21ad72b2ac,postgres:9.5.2,running,-,-\n2510dfd74d,postgres:9.5.2,running,-,-\n29d0d9661a,postgres:9.5.2,running,-,-\n48c75b5374,postgres:9.5.2,running,-,-\n490be2023b,postgres:9.5.2,running,-,-\n80853c917a,postgres:9.5.2,running,-,-\n8fa86479e7,postgres:9.5.2,running,-,-\nc3fc65bf66,postgres:9.5.2,running,-,-\nf86397cfaf,postgres:9.5.2,running,-,-\nfb474bd1d6,postgres:9.5.2,running,-,-\n'
NAME        VERSION         STATUS   EXPOSED PORTS  LINKS
*           stopped         -        -
21ad72b2ac  postgres:9.5.2  running  -              -
2510dfd74d  postgres:9.5.2  running  -              -
29d0d9661a  postgres:9.5.2  running  -              -
48c75b5374  postgres:9.5.2  running  -              -
490be2023b  postgres:9.5.2  running  -              -
80853c917a  postgres:9.5.2  running  -              -
8fa86479e7  postgres:9.5.2  running  -              -
c3fc65bf66  postgres:9.5.2  running  -              -
f86397cfaf  postgres:9.5.2  running  -              -
fb474bd1d6  postgres:9.5.2  running  -              -
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]
+ exit 0

Using local psql to connect to DB?

As I checked this plugin uses the following command when you run dokku postgres:connect:

docker exec -i $SERVICE_TTY_OPTS "$SERVICE_NAME" psql -h localhost -U postgres "$DATABASE_NAME"

Out ream does not like it because of it's limitations (limited number of lines, no search functionality, etc.)

I think it would be better if the plugin installs and uses a local psql command from the host, passing the credentials from DATABASE_URL.

I would be happy to implement this but would like to know your thoughts.

Set postgres image/version with postgres:create option

I know you can choose a non-default postgres version like this:

POSTGRES_IMAGE_VERSION=9.4 dokku postgres:create <name>

But I usually use the dokku shell through SSH, and I don't see a way to set the postgres version when running like this. I'd like to be able to do the following:

ssh dokku@hostname postgres:create <name> -v 9.4

or maybe this way, to also support different images:

ssh dokku@hostname postgres:create <name> -i postgres:9.4

Is there a way to do this already that I'm not seeing? Or would you be open to a PR to add this option?

plugin update is broken

Hello,
I originally reported this as a dokku 0.4 issue dokku/dokku#1531 but in fact it turns out this is a problem with the postgres plugin itself:

dokku plugin:install https://github.com/dokku/dokku-postgres.git

-> OK

then

dokku plugin:update https://github.com/dokku/dokku-postgres.git
fatal: destination path 'postgres' already exists and is not an empty directory.

I believe update should be idempotent en ensure last version is install instead of breaking this way, no?

postgres (without command like :info) should behave like apps and do :list command

When called without arguments (dokku postgres), the plugin "fails" (exits with 1). In contrast, dokku apps outputs the list of installed apps. postgres should do the same (and apps should implement apps:list, imho - should I file a separate issue for that? (implemented 12 days ago...)).

dokku postgres
 !     `postgres` is not a dokku command.
 !     See `dokku help` for a list of available commands.

Multiple Postgres to S3 Backup Schedules

I'm having an issue setting two postgres backup schedules for S3 offsite backups for two different databases.

One of the scheduled backups works, the other scheduled backup doesn't work. Manual backup works fine.

  1. Is there anyway to view the cron jobs for each of the backups?
  2. Where are the cron jobs and S3 authentication credentials stored?

Can't unlink service if not configured for the app

The command postgres:unlink won't complete successfully if the given database is not configured in the environment/config space for the given application. This can happen because the key in question holding the database connection string already holds a different value.

Setting the database's connection string for the given application again allows the command to complete successfully.

This is troublesome because postgres:destroy won't succeed either because the link between the database and the app is still present though. Both commands don't make it clear that this is the problem either.

"gof3r error…" during postgres:backup

I'm trying to backup for the first time.

I created a S3 bucket in region 'us-east-1. But when I run 'postgres:backup' I'm getting this error

/bin/tar: Removing leading `/' from member names
gof3r error: Post https://my-bucket-name.s3-us-east-1x-amz-request-id.amazonaws.com/postgres-get-better-luck-db-2017-04-13-07-05-12.tgz?uploads=: dial tcp: lookup my-bucket-name.s3-us-east-1x-amz-request-id.amazonaws.com on 8.8.8.8:53: no such host

Any clue where to look into? Is it because of some setting in AWS or with the plug itself?

Cannot delete linked service

When I delete the app, deleting a postgres service seems impossible. Always get the "Cannot delete linked service". Tried running unlink but still get the message. Is there any way to force deletion?

Environment Variables Do Not Get Generated

Hello,

After installing the plugin and creating a database for my Ghost blog I checked the config on the blog's container to find only DATABASE_URL has been set after linking the blog's database and the blog's container. I'm not sure if I missed something, but I followed the instructions in the readme.

If you need more info please let me know:
dokku version: 0.4.2
postgres : 9.4.4

Error: No such object when trying to display service's logs

When I am trying to display service's logs I get the following error:

root@dokku-ovh1-003:~# dokku postgres:logs vault-prod
Error: No such container: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18

Then it seems to incorrectly list services:

root@dokku-ovh1-003:~# dokku postgres:list
Error: No such object: d40297b0bedae230898cfa7e67fa336972d528a70f9e392ba5f987a5204ce82e
Error: No such object: d40297b0bedae230898cfa7e67fa336972d528a70f9e392ba5f987a5204ce82e
Error: No such object: d40297b0bedae230898cfa7e67fa336972d528a70f9e392ba5f987a5204ce82e
Error: No such object: d40297b0bedae230898cfa7e67fa336972d528a70f9e392ba5f987a5204ce82e
Error: No such object: d40297b0bedae230898cfa7e67fa336972d528a70f9e392ba5f987a5204ce82e
Error: No such object: e3fa028388f3ee7bd71fccda61a9810d19ea6c87cb9c37759b9ae30c3f8b497c
Error: No such object: e3fa028388f3ee7bd71fccda61a9810d19ea6c87cb9c37759b9ae30c3f8b497c
Error: No such object: e3fa028388f3ee7bd71fccda61a9810d19ea6c87cb9c37759b9ae30c3f8b497c
Error: No such object: e3fa028388f3ee7bd71fccda61a9810d19ea6c87cb9c37759b9ae30c3f8b497c
Error: No such object: e3fa028388f3ee7bd71fccda61a9810d19ea6c87cb9c37759b9ae30c3f8b497c
Error: No such object: 165e76865bbc764ace4a3fdbce35571556d260b5e294e4128d8dc7752c772b09
Error: No such object: 165e76865bbc764ace4a3fdbce35571556d260b5e294e4128d8dc7752c772b09
Error: No such object: 165e76865bbc764ace4a3fdbce35571556d260b5e294e4128d8dc7752c772b09
Error: No such object: 165e76865bbc764ace4a3fdbce35571556d260b5e294e4128d8dc7752c772b09
Error: No such object: 165e76865bbc764ace4a3fdbce35571556d260b5e294e4128d8dc7752c772b09
Error: No such object: a75dc6c45f86b552ebd1c5105a78bb0b652a563a80b2ef57dada0d9f2e140a48
Error: No such object: a75dc6c45f86b552ebd1c5105a78bb0b652a563a80b2ef57dada0d9f2e140a48
Error: No such object: a75dc6c45f86b552ebd1c5105a78bb0b652a563a80b2ef57dada0d9f2e140a48
Error: No such object: a75dc6c45f86b552ebd1c5105a78bb0b652a563a80b2ef57dada0d9f2e140a48
Error: No such object: a75dc6c45f86b552ebd1c5105a78bb0b652a563a80b2ef57dada0d9f2e140a48
Error: No such object: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18
Error: No such object: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18
Error: No such object: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18
Error: No such object: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18
Error: No such object: 4e612c3e4295617e81f92f00b9f0ab613fd14e5546c2944493b90a24d764ea18
NAME          VERSION         STATUS   EXPOSED PORTS  LINKS
agenda-prod   postgres:9.6.1  stopped  -              agenda-prod 
jungle-prod   postgres:9.6.1  stopped  -              jungle-prod 
medium-prod   postgres:9.6.1  stopped  -              medium-prod 
plumber-prod  postgres:9.6.1  stopped  -              plumber-prod 
vault-prod    postgres:9.6.1  stopped  -              vault-prod 

While they are running and functioning properly:

root@dokku-ovh1-003:~# docker ps | grep postgres
53ae14de1864        postgres:9.6.1                           "/docker-entrypoin..."   13 days ago         Up 13 days          5432/tcp            dokku.postgres.medium-prod
9922057c5c90        postgres:9.6.1                           "/docker-entrypoin..."   13 days ago         Up 13 days          5432/tcp            dokku.postgres.plumber-prod
80336adec219        postgres:9.6.1                           "/docker-entrypoin..."   13 days ago         Up 13 days          5432/tcp            dokku.postgres.agenda-prod
9b640e20801c        postgres:9.6.1                           "/docker-entrypoin..."   13 days ago         Up 13 days          5432/tcp            dokku.postgres.jungle-prod
3197206d1baa        postgres:9.6.1                           "/docker-entrypoin..."   13 days ago         Up 13 days          5432/tcp            dokku.postgres.vault-prod

I am using the following script on the server (run by cron) in order to cleanup docker (otherwise it tends to eat all HDD) which might be potential cause of interfering with dokku-postgres:

#!/bin/bash

# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm > /dev/null

# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi > /dev/null

# remove unused volumes:
find '/home/docker-data/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
  docker ps -aq | xargs docker inspect | jq -r '.[] | .Mounts | .[] | .Name | select(.)'
) | xargs -r rm -fr > /dev/null

I am using version eb1c55a

It seems that $SERVICE_ROOT/ID contains old docker container ID.

Environment variable DATABASE_URL not generated

Hi,

It's weird that dokku-postgres works fine on my other two dokku apps, but it won't work on the one app I just created.

Here is some debug info:

root@ubuntu:~# dokku postgres:promote commander commander
Service commander already promoted as DATABASE_URL

root@ubuntu:~# d exec commander.web.1 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=05c1643819e0
DOKKU_POSTGRES_COMMANDER_PORT=tcp://172.17.0.18:5432
DOKKU_POSTGRES_COMMANDER_PORT_5432_TCP=tcp://172.17.0.18:5432
DOKKU_POSTGRES_COMMANDER_PORT_5432_TCP_ADDR=172.17.0.18
DOKKU_POSTGRES_COMMANDER_PORT_5432_TCP_PORT=5432
DOKKU_POSTGRES_COMMANDER_PORT_5432_TCP_PROTO=tcp
DOKKU_POSTGRES_COMMANDER_NAME=/berserk_kowalevski/dokku-postgres-commander
DOKKU_POSTGRES_COMMANDER_ENV_POSTGRES_PASSWORD=password-string
DOKKU_POSTGRES_COMMANDER_ENV_GOSU_VERSION=1.7
DOKKU_POSTGRES_COMMANDER_ENV_LANG=en_US.utf8
DOKKU_POSTGRES_COMMANDER_ENV_PG_MAJOR=9.5
DOKKU_POSTGRES_COMMANDER_ENV_PG_VERSION=9.5.4-1.pgdg80+2
DOKKU_POSTGRES_COMMANDER_ENV_PGDATA=/var/lib/postgresql/data
PORT=5000
USER=herokuishuser
DYNO=web.1
CACHE_PATH=/cache
HOME=/root

root@ubuntu:~# dokku postgres:list
NAME       VERSION         STATUS   EXPOSED PORTS  LINKS
commander  postgres:9.5.4  running  -              commander

root@ubuntu:~# dokku version
0.7.2

root@ubuntu:~# d images
heroku/cedar                    latest              c212928e7f21        10 days ago         1.342 GB
gliderlabs/herokuish            latest              71921045ed63        5 weeks ago         1.397 GB
...

root@ubuntu:~# dokku plugin
plugn: dev
  00_dokku-standard    0.7.2 enabled    dokku core standard plugin
  20_events            0.7.2 enabled    dokku core events logging plugin
  apps                 0.7.2 enabled    dokku core apps plugin
  build-env            0.7.2 enabled    dokku core build-env plugin
  certs                0.7.2 enabled    dokku core certificate management plugin
  checks               0.7.2 enabled    dokku core checks plugin
  common               0.7.2 enabled    dokku core common plugin
  config               0.7.2 enabled    dokku core config plugin
  docker-options       0.7.2 enabled    dokku core docker-options plugin
  domains              0.7.2 enabled    dokku core domains plugin
  enter                0.7.2 enabled    dokku core enter plugin
  git                  0.7.2 enabled    dokku core git plugin
  letsencrypt          0.8.6 enabled    Automated installation of let's encrypt TLS certificates
  logs                 0.7.2 enabled    dokku core logs plugin
  named-containers     0.7.2 enabled    dokku core named containers plugin
  nginx-vhosts         0.7.2 enabled    dokku core nginx-vhosts plugin
  plugin               0.7.2 enabled    dokku core plugin plugin
  postgres             1.0.0 enabled    dokku postgres service plugin
  proxy                0.7.2 enabled    dokku core proxy plugin
  ps                   0.7.2 enabled    dokku core ps plugin
  redis                1.0.0 enabled    dokku redis service plugin
  repo                 0.7.2 enabled    dokku core repo plugin
  shell                0.7.2 enabled    dokku core shell plugin
  ssh-keys             0.7.2 enabled    dokku core ssh-keys plugin
  storage              0.7.2 enabled    dokku core storage plugin
  tags                 0.7.2 enabled    dokku core tags plugin
  tar                  0.7.2 enabled    dokku core tar plugin

PostGIS Extension?

Is it possible to get the PostGIS extension working in a database?

I tried running create extension postgis; and got the following error:

ERROR:  could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory`

I suppose if you could somehow use the mdillon/postgis Docker image instead of the official Postgres one it'd work. Is it possible to somehow override POSTGRES_IMAGE in the config?

Entry missing in /etc/hosts

I'm having issue with the last version of this plugin.

While my container env variables are well set:

DOKKU_ELASTICSEARCH_API_NEW_BRANCH_PORT_9300_TCP=tcp://172.17.0.3:9300
DOKKU_REDIS_API_NEW_BRANCH_PORT_6379_TCP_ADDR=172.17.0.4
DOKKU_ELASTICSEARCH_API_NEW_BRANCH_ENV_JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
DATABASE_URL=postgres://postgres:0c0df0053383591b46747ab94289e5ec@dokku-postgres-api-new-branch:5432/api_new_branch

My /etc/hosts file is missing an entry:

172.17.0.3  dokku-elasticsearch-api-new-branch 5381abfb7e7e dokku.elasticsearch.api-new-branch
172.17.0.4  dokku-redis-api-new-branch 9f337daf8ae8 dokku.redis.api-new-branch
172.17.0.5  c4053c59378b

In my deployment phase:

/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': could not translate host name "dokku-postgres-api-new-branch" to address: Name or service not known

dokku version 0.5.7
dokku plugin

plugn: dev
  00_dokku-standard    0.5.7 enabled    dokku core standard plugin
  20_events            0.5.7 enabled    dokku core events logging plugin
  apps                 0.5.7 enabled    dokku core apps plugin
  build-env            0.5.7 enabled    dokku core build-env plugin
  certs                0.5.7 enabled    dokku core certificate management plugin
  checks               0.5.7 enabled    dokku core checks plugin
  common               0.5.7 enabled    dokku core common plugin
  config               0.5.7 enabled    dokku core config plugin
  docker-options       0.5.7 enabled    dokku core docker-options plugin
  domains              0.5.7 enabled    dokku core domains plugin
  elasticsearch        1.0.0 enabled    dokku elasticsearch service plugin
  enter                0.5.7 enabled    dokku core enter plugin
  git                  0.5.7 enabled    dokku core git plugin
  logs                 0.5.7 enabled    dokku core logs plugin
  memcached            1.0.0 enabled    dokku memcached service plugin
  named-containers     0.5.7 enabled    dokku core named containers plugin
  nginx-vhosts         0.5.7 enabled    dokku core nginx-vhosts plugin
  plugin               0.5.7 enabled    dokku core plugin plugin
  postgres             1.0.0 enabled    dokku postgres service plugin
  proxy                0.5.7 enabled    dokku core proxy plugin
  ps                   0.5.7 enabled    dokku core ps plugin
  redis                1.0.0 enabled    dokku redis service plugin
  shell                0.5.7 enabled    dokku core shell plugin
  storage              0.5.7 enabled    dokku core storage plugin
  tags                 0.5.7 enabled    dokku core tags plugin
  tar                  0.5.7 enabled    dokku core tar plugin

Potentiel issue:
Somehow my app's name got passed to the get_phases function

00:00:20.194 ++ [[ -n api-new-branch ]]
00:00:20.194 ++ OIFS='  
00:00:20.194 '
00:00:20.194 ++ IFS=,
00:00:20.194 ++ read -ra passed_phases
00:00:20.194 ++ IFS='   
00:00:20.194 '
00:00:20.194 ++ for phase in '"${passed_phases[@]}"'
00:00:20.195 ++ [[ api-new-branch = @(build|deploy|run) ]]
00:00:20.195 ++ dokku_log_fail 'Phase(s) must be one of [build deploy run]'
00:00:20.195 ++ declare 'desc=log fail formatter'
00:00:20.195 ++ echo 'Phase(s) must be one of [build deploy run]'
00:00:20.195 Phase(s) must be one of [build deploy run]
00:00:20.195 ++ exit 1
00:00:05.873 + /var/lib/jenkins/.dokku/contrib/dokku_client.sh apps:create api-new-branch
00:00:05.881 -----> Dokku remote added at dokku.finpal.cc
00:00:05.881 -----> Application name is api-new-branch
00:00:06.232 + case "$(lsb_release -si)" in
00:00:06.232 ++ lsb_release -si
00:00:06.267 + export DOKKU_DISTRO=ubuntu
00:00:06.267 + DOKKU_DISTRO=ubuntu
00:00:06.267 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:06.267 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:06.267 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:06.267 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:06.267 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:06.267 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:06.268 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:06.268 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:06.268 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:06.268 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:06.268 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:06.268 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:06.268 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:06.268 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:06.268 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:06.268 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:06.268 + export DOKKU_API_VERSION=1
00:00:06.268 + DOKKU_API_VERSION=1
00:00:06.268 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:06.268 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:06.268 + export DOKKU_VALID_EXIT=0
00:00:06.268 + DOKKU_VALID_EXIT=0
00:00:06.268 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:06.268 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:06.268 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:06.268 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:06.268 + export DOKKU_CONTAINER_LABEL=dokku
00:00:06.268 + DOKKU_CONTAINER_LABEL=dokku
00:00:06.268 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:06.268 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:06.268 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.268 ++ set -eo pipefail
00:00:06.268 ++ [[ -n 1 ]]
00:00:06.268 ++ set -x
00:00:06.271 + parse_args --app api-new-branch apps:create api-new-branch
00:00:06.271 + declare 'desc=top-level cli arg parser'
00:00:06.271 + local next_index=1
00:00:06.271 + local skip=false
00:00:06.271 + args=("$@")
00:00:06.271 + local args
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + false
00:00:06.271 + case "$arg" in
00:00:06.271 + export DOKKU_APP_NAME=api-new-branch
00:00:06.271 + DOKKU_APP_NAME=api-new-branch
00:00:06.271 + skip=true
00:00:06.271 + local next_index=2
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + true
00:00:06.271 + skip=false
00:00:06.271 + continue
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + false
00:00:06.271 + case "$arg" in
00:00:06.271 + local next_index=3
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + false
00:00:06.271 + case "$arg" in
00:00:06.271 + local next_index=4
00:00:06.271 + return 0
00:00:06.271 + args=("$@")
00:00:06.271 + [[ --app =~ ^--.* ]]
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + [[ --app == \-\-\a\p\p ]]
00:00:06.271 + shift 2
00:00:06.271 + for arg in '"$@"'
00:00:06.271 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:06.271 + [[ api-new-branch =~ ^--.* ]]
00:00:06.271 + break
00:00:06.271 + has_tty
00:00:06.271 + declare 'desc=return 0 if we have a tty'
00:00:06.271 ++ /usr/bin/tty
00:00:06.272 ++ true
00:00:06.272 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:06.272 + return 1
00:00:06.272 + DOKKU_QUIET_OUTPUT=1
00:00:06.273 ++ id -un
00:00:06.274 + [[ dokku != \d\o\k\k\u ]]
00:00:06.274 ++ id -un
00:00:06.275 + [[ dokku != \r\o\o\t ]]
00:00:06.275 + [[ apps:create =~ ^plugin:.* ]]
00:00:06.275 + [[ -n --app api-new-branch apps:create api-new-branch ]]
00:00:06.275 + export -n SSH_ORIGINAL_COMMAND
00:00:06.275 + [[ apps:create =~ config-* ]]
00:00:06.275 + [[ apps:create =~ docker-options* ]]
00:00:06.275 + set -f
00:00:06.275 + /usr/local/bin/dokku --app api-new-branch apps:create api-new-branch
00:00:06.277 + case "$(lsb_release -si)" in
00:00:06.277 ++ lsb_release -si
00:00:06.312 + export DOKKU_DISTRO=ubuntu
00:00:06.312 + DOKKU_DISTRO=ubuntu
00:00:06.312 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:06.312 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:06.312 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:06.312 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:06.312 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:06.312 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:06.312 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:06.312 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:06.312 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:06.312 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:06.312 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:06.312 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:06.312 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:06.312 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:06.312 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:06.312 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:06.312 + export DOKKU_API_VERSION=1
00:00:06.312 + DOKKU_API_VERSION=1
00:00:06.312 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:06.312 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:06.312 + export DOKKU_VALID_EXIT=0
00:00:06.312 + DOKKU_VALID_EXIT=0
00:00:06.312 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:06.312 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:06.312 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:06.312 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:06.313 + export DOKKU_CONTAINER_LABEL=dokku
00:00:06.313 + DOKKU_CONTAINER_LABEL=dokku
00:00:06.313 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:06.313 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:06.313 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.313 ++ set -eo pipefail
00:00:06.313 ++ [[ -n 1 ]]
00:00:06.313 ++ set -x
00:00:06.315 + parse_args --app api-new-branch apps:create api-new-branch
00:00:06.315 + declare 'desc=top-level cli arg parser'
00:00:06.315 + local next_index=1
00:00:06.315 + local skip=false
00:00:06.315 + args=("$@")
00:00:06.315 + local args
00:00:06.315 + for arg in '"$@"'
00:00:06.315 + false
00:00:06.315 + case "$arg" in
00:00:06.316 + export DOKKU_APP_NAME=api-new-branch
00:00:06.316 + DOKKU_APP_NAME=api-new-branch
00:00:06.316 + skip=true
00:00:06.316 + local next_index=2
00:00:06.316 + for arg in '"$@"'
00:00:06.316 + true
00:00:06.316 + skip=false
00:00:06.316 + continue
00:00:06.316 + for arg in '"$@"'
00:00:06.316 + false
00:00:06.316 + case "$arg" in
00:00:06.316 + local next_index=3
00:00:06.316 + for arg in '"$@"'
00:00:06.316 + false
00:00:06.316 + case "$arg" in
00:00:06.316 + local next_index=4
00:00:06.316 + return 0
00:00:06.316 + args=("$@")
00:00:06.316 + [[ --app =~ ^--.* ]]
00:00:06.316 + for arg in '"$@"'
00:00:06.316 + [[ --app == \-\-\a\p\p ]]
00:00:06.316 + shift 2
00:00:06.316 + for arg in '"$@"'
00:00:06.316 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:06.316 + [[ api-new-branch =~ ^--.* ]]
00:00:06.316 + break
00:00:06.316 + has_tty
00:00:06.316 + declare 'desc=return 0 if we have a tty'
00:00:06.316 ++ /usr/bin/tty
00:00:06.317 ++ true
00:00:06.317 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:06.317 + return 1
00:00:06.317 + DOKKU_QUIET_OUTPUT=1
00:00:06.317 ++ id -un
00:00:06.318 + [[ dokku != \d\o\k\k\u ]]
00:00:06.318 ++ id -un
00:00:06.319 + [[ dokku != \r\o\o\t ]]
00:00:06.319 + [[ apps:create =~ ^plugin:.* ]]
00:00:06.319 + [[ -n '' ]]
00:00:06.319 + dokku_auth apps:create api-new-branch
00:00:06.319 + declare 'desc=calls user-auth plugin trigger'
00:00:06.319 + export SSH_USER=dokku
00:00:06.319 + SSH_USER=dokku
00:00:06.319 + export SSH_NAME=jenkins
00:00:06.319 + SSH_NAME=jenkins
00:00:06.320 + plugn trigger user-auth dokku jenkins apps:create api-new-branch
00:00:06.364 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.364 ++ set -eo pipefail
00:00:06.364 ++ [[ -n 1 ]]
00:00:06.364 ++ set -x
00:00:06.367 + [[ ! -n '' ]]
00:00:06.450 + return 0
00:00:06.451 + case "$1" in
00:00:06.451 + execute_dokku_cmd apps:create api-new-branch
00:00:06.451 + declare 'desc=executes dokku sub-commands'
00:00:06.451 + local PLUGIN_NAME=apps:create
00:00:06.451 + local PLUGIN_CMD=apps:create
00:00:06.451 + local implemented=0
00:00:06.451 + local script
00:00:06.451 + argv=("$@")
00:00:06.451 + local argv
00:00:06.451 + case "$PLUGIN_NAME" in
00:00:06.451 ++ readlink -f /var/lib/dokku/plugins/enabled/apps
00:00:06.452 + [[ /var/lib/dokku/core-plugins/available/apps == *core-plugins* ]]
00:00:06.452 + [[ apps:create == \a\p\p\s\:\c\r\e\a\t\e ]]
00:00:06.452 + shift 1
00:00:06.452 + [[ ! -z api-new-branch ]]
00:00:06.452 + [[ apps:create == config* ]]
00:00:06.452 + set -- api-new-branch api-new-branch
00:00:06.452 + set -- apps:create api-new-branch api-new-branch
00:00:06.452 + [[ -x /var/lib/dokku/plugins/enabled/apps:create/subcommands/default ]]
00:00:06.452 + [[ -x /var/lib/dokku/plugins/enabled/apps:create/subcommands/apps:create ]]
00:00:06.452 + [[ -x /var/lib/dokku/plugins/enabled/apps/subcommands/create ]]
00:00:06.453 + /var/lib/dokku/plugins/enabled/apps/subcommands/create apps:create api-new-branch api-new-branch
00:00:06.454 + source /var/lib/dokku/plugins/available/apps/functions
00:00:06.454 ++ set -eo pipefail
00:00:06.454 ++ [[ -n 1 ]]
00:00:06.454 ++ set -x
00:00:06.454 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.454 +++ set -eo pipefail
00:00:06.454 +++ [[ -n 1 ]]
00:00:06.454 +++ set -x
00:00:06.457 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:06.457 +++ set -eo pipefail
00:00:06.457 +++ [[ -n 1 ]]
00:00:06.457 +++ set -x
00:00:06.457 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.457 ++++ set -eo pipefail
00:00:06.457 ++++ [[ -n 1 ]]
00:00:06.457 ++++ set -x
00:00:06.461 + apps_create_cmd apps:create api-new-branch api-new-branch
00:00:06.461 + declare 'desc=creates app via command line'
00:00:06.461 + local cmd=apps:create
00:00:06.461 + apps_create api-new-branch
00:00:06.461 + declare 'desc=verifies app name and creates an app'
00:00:06.461 + [[ -z api-new-branch ]]
00:00:06.461 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:06.461 + [[ -d /home/dokku/api-new-branch ]]
00:00:06.461 + local APP=api-new-branch
00:00:06.461 + mkdir -p /home/dokku/api-new-branch
00:00:06.462 Creating api-new-branch... done
00:00:06.462 + echo 'Creating api-new-branch... done'
00:00:06.462 + plugn trigger post-create api-new-branch
00:00:06.506 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:06.506 ++ set -eo pipefail
00:00:06.506 ++ [[ -n 1 ]]
00:00:06.506 ++ set -x
00:00:06.509 + [[ ! -n '' ]]
00:00:06.594 + implemented=1
00:00:06.594 + [[ 1 -eq 0 ]]
00:00:06.594 + [[ 1 -eq 0 ]]
00:00:06.594 + set +f
00:00:06.594 + exit 0
00:00:06.595 + sleep 4
00:00:10.596 + /var/lib/jenkins/.dokku/contrib/dokku_client.sh config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:10.960 + case "$(lsb_release -si)" in
00:00:10.961 ++ lsb_release -si
00:00:10.996 + export DOKKU_DISTRO=ubuntu
00:00:10.996 + DOKKU_DISTRO=ubuntu
00:00:10.996 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:10.996 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:10.996 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:10.996 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:10.996 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:10.996 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:10.996 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:10.996 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:10.996 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:10.996 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:10.996 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:10.996 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:10.996 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:10.996 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:10.996 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:10.996 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:10.996 + export DOKKU_API_VERSION=1
00:00:10.996 + DOKKU_API_VERSION=1
00:00:10.996 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:10.997 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:10.997 + export DOKKU_VALID_EXIT=0
00:00:10.997 + DOKKU_VALID_EXIT=0
00:00:10.997 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:10.997 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:10.997 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:10.997 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:10.997 + export DOKKU_CONTAINER_LABEL=dokku
00:00:10.997 + DOKKU_CONTAINER_LABEL=dokku
00:00:10.997 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:10.997 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:10.997 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:10.997 ++ set -eo pipefail
00:00:10.997 ++ [[ -n 1 ]]
00:00:10.997 ++ set -x
00:00:11.000 + parse_args --app api-new-branch config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.000 + declare 'desc=top-level cli arg parser'
00:00:11.000 + local next_index=1
00:00:11.000 + local skip=false
00:00:11.000 + args=("$@")
00:00:11.000 + local args
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + false
00:00:11.000 + case "$arg" in
00:00:11.000 + export DOKKU_APP_NAME=api-new-branch
00:00:11.000 + DOKKU_APP_NAME=api-new-branch
00:00:11.000 + skip=true
00:00:11.000 + local next_index=2
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + true
00:00:11.000 + skip=false
00:00:11.000 + continue
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + false
00:00:11.000 + case "$arg" in
00:00:11.000 + local next_index=3
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + false
00:00:11.000 + case "$arg" in
00:00:11.000 + local next_index=4
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + false
00:00:11.000 + case "$arg" in
00:00:11.000 + local next_index=5
00:00:11.000 + return 0
00:00:11.000 + args=("$@")
00:00:11.000 + [[ --app =~ ^--.* ]]
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + [[ --app == \-\-\a\p\p ]]
00:00:11.000 + shift 2
00:00:11.000 + for arg in '"$@"'
00:00:11.000 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:11.000 + [[ api-new-branch =~ ^--.* ]]
00:00:11.000 + break
00:00:11.000 + has_tty
00:00:11.000 + declare 'desc=return 0 if we have a tty'
00:00:11.000 ++ /usr/bin/tty
00:00:11.001 ++ true
00:00:11.002 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:11.002 + return 1
00:00:11.002 + DOKKU_QUIET_OUTPUT=1
00:00:11.002 ++ id -un
00:00:11.003 + [[ dokku != \d\o\k\k\u ]]
00:00:11.003 ++ id -un
00:00:11.004 + [[ dokku != \r\o\o\t ]]
00:00:11.004 + [[ config:set =~ ^plugin:.* ]]
00:00:11.004 + [[ -n --app api-new-branch config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git ]]
00:00:11.004 + export -n SSH_ORIGINAL_COMMAND
00:00:11.004 + [[ config:set =~ config-* ]]
00:00:11.004 + xargs /usr/local/bin/dokku
00:00:11.007 + case "$(lsb_release -si)" in
00:00:11.007 ++ lsb_release -si
00:00:11.042 + export DOKKU_DISTRO=ubuntu
00:00:11.042 + DOKKU_DISTRO=ubuntu
00:00:11.042 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.042 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.042 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.042 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.042 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.042 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.042 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.042 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.042 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.042 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.042 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.042 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.043 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.043 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.043 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.043 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.043 + export DOKKU_API_VERSION=1
00:00:11.043 + DOKKU_API_VERSION=1
00:00:11.043 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.043 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.043 + export DOKKU_VALID_EXIT=0
00:00:11.043 + DOKKU_VALID_EXIT=0
00:00:11.043 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.043 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.043 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.043 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.043 + export DOKKU_CONTAINER_LABEL=dokku
00:00:11.043 + DOKKU_CONTAINER_LABEL=dokku
00:00:11.043 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.043 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.043 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.043 ++ set -eo pipefail
00:00:11.043 ++ [[ -n 1 ]]
00:00:11.043 ++ set -x
00:00:11.046 + parse_args --app api-new-branch config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.046 + declare 'desc=top-level cli arg parser'
00:00:11.046 + local next_index=1
00:00:11.046 + local skip=false
00:00:11.046 + args=("$@")
00:00:11.046 + local args
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + false
00:00:11.046 + case "$arg" in
00:00:11.046 + export DOKKU_APP_NAME=api-new-branch
00:00:11.046 + DOKKU_APP_NAME=api-new-branch
00:00:11.046 + skip=true
00:00:11.046 + local next_index=2
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + true
00:00:11.046 + skip=false
00:00:11.046 + continue
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + false
00:00:11.046 + case "$arg" in
00:00:11.046 + local next_index=3
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + false
00:00:11.046 + case "$arg" in
00:00:11.046 + local next_index=4
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + false
00:00:11.046 + case "$arg" in
00:00:11.046 + local next_index=5
00:00:11.046 + return 0
00:00:11.046 + args=("$@")
00:00:11.046 + [[ --app =~ ^--.* ]]
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + [[ --app == \-\-\a\p\p ]]
00:00:11.046 + shift 2
00:00:11.046 + for arg in '"$@"'
00:00:11.046 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:11.046 + [[ api-new-branch =~ ^--.* ]]
00:00:11.046 + break
00:00:11.046 + has_tty
00:00:11.046 + declare 'desc=return 0 if we have a tty'
00:00:11.046 ++ /usr/bin/tty
00:00:11.047 ++ true
00:00:11.047 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:11.047 + return 1
00:00:11.047 + DOKKU_QUIET_OUTPUT=1
00:00:11.048 ++ id -un
00:00:11.049 + [[ dokku != \d\o\k\k\u ]]
00:00:11.049 ++ id -un
00:00:11.050 + [[ dokku != \r\o\o\t ]]
00:00:11.050 + [[ config:set =~ ^plugin:.* ]]
00:00:11.050 + [[ -n '' ]]
00:00:11.050 + dokku_auth config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.050 + declare 'desc=calls user-auth plugin trigger'
00:00:11.050 + export SSH_USER=dokku
00:00:11.050 + SSH_USER=dokku
00:00:11.050 + export SSH_NAME=jenkins
00:00:11.050 + SSH_NAME=jenkins
00:00:11.050 + plugn trigger user-auth dokku jenkins config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.092 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.092 ++ set -eo pipefail
00:00:11.092 ++ [[ -n 1 ]]
00:00:11.092 ++ set -x
00:00:11.095 + [[ ! -n '' ]]
00:00:11.181 + return 0
00:00:11.182 + case "$1" in
00:00:11.182 + execute_dokku_cmd config:set api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.182 + declare 'desc=executes dokku sub-commands'
00:00:11.182 + local PLUGIN_NAME=config:set
00:00:11.182 + local PLUGIN_CMD=config:set
00:00:11.182 + local implemented=0
00:00:11.182 + local script
00:00:11.182 + argv=("$@")
00:00:11.182 + local argv
00:00:11.182 + case "$PLUGIN_NAME" in
00:00:11.182 ++ readlink -f /var/lib/dokku/plugins/enabled/config
00:00:11.183 + [[ /var/lib/dokku/core-plugins/available/config == *core-plugins* ]]
00:00:11.183 + [[ config:set == \c\o\n\f\i\g\:\s\e\t ]]
00:00:11.183 + shift 1
00:00:11.183 + [[ ! -z api-new-branch ]]
00:00:11.183 + [[ config:set == config* ]]
00:00:11.183 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.183 + set -- api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.183 + set -- config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.183 + [[ -x /var/lib/dokku/plugins/enabled/config:set/subcommands/default ]]
00:00:11.183 + [[ -x /var/lib/dokku/plugins/enabled/config:set/subcommands/config:set ]]
00:00:11.183 + [[ -x /var/lib/dokku/plugins/enabled/config/subcommands/set ]]
00:00:11.183 + /var/lib/dokku/plugins/enabled/config/subcommands/set config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.184 + source /var/lib/dokku/plugins/available/config/functions
00:00:11.184 ++ set -eo pipefail
00:00:11.184 ++ [[ -n 1 ]]
00:00:11.184 ++ set -x
00:00:11.185 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.185 +++ set -eo pipefail
00:00:11.185 +++ [[ -n 1 ]]
00:00:11.185 +++ set -x
00:00:11.188 + config_set_cmd config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.188 + declare 'desc=set specified config vars for app via command line'
00:00:11.189 + local cmd=config:set
00:00:11.189 + config_set config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.189 + declare 'desc=set value of given config var'
00:00:11.189 + [[ config:set == \c\o\n\f\i\g\:\s\e\t ]]
00:00:11.189 + config_parse_args config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.189 + declare 'desc=parse config plugin args'
00:00:11.189 + unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:11.189 + for var in '"$@"'
00:00:11.189 + [[ config:set == \-\-\g\l\o\b\a\l ]]
00:00:11.189 + [[ config:set == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.189 + [[ config:set == \-\-\e\x\p\o\r\t ]]
00:00:11.189 + [[ config:set == \-\-\s\h\e\l\l ]]
00:00:11.189 + for var in '"$@"'
00:00:11.189 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:11.189 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.189 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:11.189 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:11.189 + for var in '"$@"'
00:00:11.189 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:11.189 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.189 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:11.189 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:11.189 + for var in '"$@"'
00:00:11.189 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\g\l\o\b\a\l ]]
00:00:11.189 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.189 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\e\x\p\o\r\t ]]
00:00:11.189 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\s\h\e\l\l ]]
00:00:11.189 + SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:11.189 ++ get_sanitized_config_args config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.190 ++ local 'desc=return sanitized arguments for config plugin'
00:00:11.190 ++ SANITIZED_ARGS=("$@")
00:00:11.190 ++ local SANITIZED_ARGS
00:00:11.190 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:11.190 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:11.190 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:11.190 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:11.190 ++ echo config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.190 + local SANITIZED_ARGS
00:00:11.190 + set -- config:set api-new-branch api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.190 + DOKKU_CONFIG_TYPE=app
00:00:11.190 + DOKKU_CONFIG_RESTART=true
00:00:11.190 + [[ app == \a\p\p ]]
00:00:11.190 + [[ -z api-new-branch ]]
00:00:11.190 + verify_app_name api-new-branch
00:00:11.190 + declare 'desc=verify app name format and app existence'
00:00:11.190 + local APP=api-new-branch
00:00:11.190 + [[ ! -n api-new-branch ]]
00:00:11.190 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:11.190 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:11.190 + return 0
00:00:11.190 + APP=api-new-branch
00:00:11.190 + ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:11.190 + export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:11.190 + [[ -z api-new-branch BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git ]]
00:00:11.190 + config_create /home/dokku/api-new-branch/ENV
00:00:11.190 + declare 'desc=create config env file'
00:00:11.190 + local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:11.190 + [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:11.191 + touch /home/dokku/api-new-branch/ENV
00:00:11.191 + local ENV_ADD=
00:00:11.191 ++ cat /home/dokku/api-new-branch/ENV
00:00:11.192 + local ENV_TEMP=
00:00:11.192 + local RESTART_APP=false
00:00:11.192 + shift 2
00:00:11.192 + for var in '"$@"'
00:00:11.192 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:11.192 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.192 + [[ -n api-new-branch ]]
00:00:11.192 + [[ api-new-branch == \a\p\i\-\n\e\w\-\b\r\a\n\c\h ]]
00:00:11.192 + shift 1
00:00:11.192 + for var in '"$@"'
00:00:11.192 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\g\l\o\b\a\l ]]
00:00:11.192 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.192 + [[ -n api-new-branch ]]
00:00:11.192 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git == \a\p\i\-\n\e\w\-\b\r\a\n\c\h ]]
00:00:11.192 + [[ BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git != *\=* ]]
00:00:11.192 + for var in '"$@"'
00:00:11.193 ++ echo BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.193 ++ cut -d= -f1
00:00:11.194 + local KEY=BUILDPACK_URL
00:00:11.194 ++ echo BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.195 ++ cut -d= -f2-
00:00:11.195 + local VALUE=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.195 + [[ BUILDPACK_URL =~ [a-zA-Z_][a-zA-Z0-9_]* ]]
00:00:11.195 + local RESTART_APP=true
00:00:11.196 ++ echo ''
00:00:11.196 ++ sed '/^export BUILDPACK_URL=/ d'
00:00:11.197 + local ENV_TEMP=
00:00:11.197 + local 'ENV_TEMP=
00:00:11.197 export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:11.198 ++ echo -e ''
00:00:11.198 ++ sed '/^BUILDPACK_URL=/ d'
00:00:11.199 + local ENV_ADD=
00:00:11.199 + local 'ENV_ADD=$
00:00:11.199 BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:11.199 ++ echo '$
00:00:11.199 BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:11.199 ++ tail -n +2
00:00:11.200 + local ENV_ADD=BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.200 + [[ -n true ]]
00:00:11.200 + dokku_log_info1 'Setting config vars'
00:00:11.200 + declare 'desc=log info1 formatter'
00:00:11.200 + echo '-----> Setting config vars'
00:00:11.200 -----> Setting config vars
00:00:11.200 + config_styled_hash BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git '       '
00:00:11.200 + declare 'desc=internal config hash'
00:00:11.201 + local vars=BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.201 + local 'prefix=       '
00:00:11.201 + local longest=
00:00:11.201 + read -r word
00:00:11.201 ++ echo BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.201 ++ cut -d= -f1
00:00:11.202 + local KEY=BUILDPACK_URL
00:00:11.202 + [[ 13 -gt 0 ]]
00:00:11.202 + local longest=BUILDPACK_URL
00:00:11.202 + read -r word
00:00:11.202 + read -r word
00:00:11.202 ++ echo BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.202 ++ cut -d= -f1
00:00:11.203 + local KEY=BUILDPACK_URL
00:00:11.204 ++ echo BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.204 ++ sed -e 's/^'\''//' -e 's/'\''$//' -e 's/$$//g'
00:00:11.204 ++ cut -d= -f2-
00:00:11.205 + local VALUE=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.205 + local num_zeros=0
00:00:11.205 + local 'zeros= '
00:00:11.205 + [[ 0 -gt 0 ]]
00:00:11.205        BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.205 + echo '       BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:11.205 + read -r word
00:00:11.205 + config_write '
00:00:11.205 export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:11.205 + declare 'desc=writes config vars out to appropriate file path'
00:00:11.205 + local 'ENV_TEMP=
00:00:11.205 export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:11.205 + local ENV_FILE_TEMP=/home/dokku/api-new-branch/ENV.tmp
00:00:11.205 + echo '
00:00:11.205 + sed '/^$/d'
00:00:11.205 export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:11.206 + sort
00:00:11.207 + cmp -s /home/dokku/api-new-branch/ENV /home/dokku/api-new-branch/ENV.tmp
00:00:11.207 + cp -f /home/dokku/api-new-branch/ENV.tmp /home/dokku/api-new-branch/ENV
00:00:11.208 + chmod 600 /home/dokku/api-new-branch/ENV
00:00:11.209 + rm -f /home/dokku/api-new-branch/ENV.tmp
00:00:11.209 + plugn trigger post-config-update api-new-branch set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:11.334 + [[ -n api-new-branch ]]
00:00:11.335 ++ config_get api-new-branch DOKKU_APP_RESTORE
00:00:11.335 ++ declare 'desc=get value of given config var'
00:00:11.335 ++ [[ api-new-branch == \c\o\n\f\i\g\:\g\e\t ]]
00:00:11.335 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.335 ++ config_parse_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.335 ++ declare 'desc=parse config plugin args'
00:00:11.335 ++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:11.335 ++ for var in '"$@"'
00:00:11.335 ++ [[ config:get == \-\-\g\l\o\b\a\l ]]
00:00:11.335 ++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.335 ++ [[ config:get == \-\-\e\x\p\o\r\t ]]
00:00:11.335 ++ [[ config:get == \-\-\s\h\e\l\l ]]
00:00:11.336 ++ for var in '"$@"'
00:00:11.336 ++ [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:11.336 ++ [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.336 ++ [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:11.336 ++ [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:11.336 ++ for var in '"$@"'
00:00:11.336 ++ [[ DOKKU_APP_RESTORE == \-\-\g\l\o\b\a\l ]]
00:00:11.336 ++ [[ DOKKU_APP_RESTORE == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:11.336 ++ [[ DOKKU_APP_RESTORE == \-\-\e\x\p\o\r\t ]]
00:00:11.336 ++ [[ DOKKU_APP_RESTORE == \-\-\s\h\e\l\l ]]
00:00:11.336 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:11.336 +++ get_sanitized_config_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.336 +++ local 'desc=return sanitized arguments for config plugin'
00:00:11.336 +++ SANITIZED_ARGS=("$@")
00:00:11.336 +++ local SANITIZED_ARGS
00:00:11.336 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:11.336 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:11.336 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:11.336 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:11.336 +++ echo config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.336 ++ local SANITIZED_ARGS
00:00:11.336 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.336 ++ DOKKU_CONFIG_TYPE=app
00:00:11.336 ++ DOKKU_CONFIG_RESTART=true
00:00:11.336 ++ [[ app == \a\p\p ]]
00:00:11.337 ++ [[ -z api-new-branch ]]
00:00:11.337 ++ verify_app_name api-new-branch
00:00:11.337 ++ declare 'desc=verify app name format and app existence'
00:00:11.337 ++ local APP=api-new-branch
00:00:11.337 ++ [[ ! -n api-new-branch ]]
00:00:11.337 ++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:11.337 ++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:11.337 ++ return 0
00:00:11.337 ++ APP=api-new-branch
00:00:11.337 ++ ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:11.337 ++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:11.337 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:11.337 +++ get_sanitized_config_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.337 +++ local 'desc=return sanitized arguments for config plugin'
00:00:11.337 +++ SANITIZED_ARGS=("$@")
00:00:11.337 +++ local SANITIZED_ARGS
00:00:11.337 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:11.337 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:11.337 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:11.337 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:11.337 +++ echo config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.337 ++ local SANITIZED_ARGS
00:00:11.338 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:11.338 ++ [[ -z api-new-branch ]]
00:00:11.338 ++ config_create /home/dokku/api-new-branch/ENV
00:00:11.338 ++ declare 'desc=create config env file'
00:00:11.338 ++ local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:11.338 ++ [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:11.338 ++ [[ ! -s /home/dokku/api-new-branch/ENV ]]
00:00:11.338 ++ local KEY=DOKKU_APP_RESTORE
00:00:11.338 ++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/api-new-branch/ENV
00:00:11.338 ++ grep '^export DOKKU_APP_RESTORE='
00:00:11.339 ++ cut -d= -f2-
00:00:11.339 ++ sed -e 's/^'\''//' -e 's/'\''$//'
00:00:11.340 ++ true
00:00:11.340 + local DOKKU_APP_RESTORE=
00:00:11.340 + [[ true == \t\r\u\e ]]
00:00:11.340 + [[ '' != 0 ]]
00:00:11.340 + dokku_log_info1 'Restarting app api-new-branch'
00:00:11.340 + declare 'desc=log info1 formatter'
00:00:11.340 -----> Restarting app api-new-branch
00:00:11.340 + echo '-----> Restarting app api-new-branch'
00:00:11.340 + dokku ps:restart api-new-branch
00:00:11.342 + case "$(lsb_release -si)" in
00:00:11.342 ++ lsb_release -si
00:00:11.377 + export DOKKU_DISTRO=ubuntu
00:00:11.377 + DOKKU_DISTRO=ubuntu
00:00:11.377 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.377 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.377 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.377 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.377 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.377 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.377 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.377 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.377 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.377 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.377 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.377 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.377 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.377 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.377 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.377 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.377 + export DOKKU_API_VERSION=1
00:00:11.377 + DOKKU_API_VERSION=1
00:00:11.377 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.377 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.377 + export DOKKU_VALID_EXIT=0
00:00:11.377 + DOKKU_VALID_EXIT=0
00:00:11.377 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.377 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.378 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.378 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.378 + export DOKKU_CONTAINER_LABEL=dokku
00:00:11.378 + DOKKU_CONTAINER_LABEL=dokku
00:00:11.378 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.378 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.378 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.378 ++ set -eo pipefail
00:00:11.378 ++ [[ -n 1 ]]
00:00:11.378 ++ set -x
00:00:11.380 + parse_args ps:restart api-new-branch
00:00:11.380 + declare 'desc=top-level cli arg parser'
00:00:11.380 + local next_index=1
00:00:11.380 + local skip=false
00:00:11.380 + args=("$@")
00:00:11.380 + local args
00:00:11.380 + for arg in '"$@"'
00:00:11.380 + false
00:00:11.380 + case "$arg" in
00:00:11.380 + local next_index=2
00:00:11.380 + for arg in '"$@"'
00:00:11.380 + false
00:00:11.380 + case "$arg" in
00:00:11.380 + local next_index=3
00:00:11.381 + return 0
00:00:11.381 + args=("$@")
00:00:11.381 + [[ ps:restart =~ ^--.* ]]
00:00:11.381 + has_tty
00:00:11.381 + declare 'desc=return 0 if we have a tty'
00:00:11.381 ++ /usr/bin/tty
00:00:11.381 ++ true
00:00:11.381 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:11.381 + return 1
00:00:11.381 + DOKKU_QUIET_OUTPUT=1
00:00:11.382 ++ id -un
00:00:11.383 + [[ dokku != \d\o\k\k\u ]]
00:00:11.383 ++ id -un
00:00:11.384 + [[ dokku != \r\o\o\t ]]
00:00:11.384 + [[ ps:restart =~ ^plugin:.* ]]
00:00:11.384 + [[ -n '' ]]
00:00:11.384 + dokku_auth ps:restart api-new-branch
00:00:11.384 + declare 'desc=calls user-auth plugin trigger'
00:00:11.384 + export SSH_USER=dokku
00:00:11.384 + SSH_USER=dokku
00:00:11.384 + export SSH_NAME=jenkins
00:00:11.384 + SSH_NAME=jenkins
00:00:11.384 + plugn trigger user-auth dokku jenkins ps:restart api-new-branch
00:00:11.427 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.427 ++ set -eo pipefail
00:00:11.427 ++ [[ -n 1 ]]
00:00:11.427 ++ set -x
00:00:11.430 + [[ ! -n '' ]]
00:00:11.514 + return 0
00:00:11.515 + case "$1" in
00:00:11.515 + execute_dokku_cmd ps:restart api-new-branch
00:00:11.515 + declare 'desc=executes dokku sub-commands'
00:00:11.515 + local PLUGIN_NAME=ps:restart
00:00:11.515 + local PLUGIN_CMD=ps:restart
00:00:11.515 + local implemented=0
00:00:11.515 + local script
00:00:11.515 + argv=("$@")
00:00:11.515 + local argv
00:00:11.515 + case "$PLUGIN_NAME" in
00:00:11.515 ++ readlink -f /var/lib/dokku/plugins/enabled/ps
00:00:11.516 + [[ /var/lib/dokku/core-plugins/available/ps == *core-plugins* ]]
00:00:11.516 + [[ ps:restart == \p\s\:\r\e\s\t\a\r\t ]]
00:00:11.516 + shift 1
00:00:11.516 + [[ ! -z api-new-branch ]]
00:00:11.516 + [[ ps:restart == config* ]]
00:00:11.516 + set -- api-new-branch api-new-branch
00:00:11.516 + set -- ps:restart api-new-branch api-new-branch
00:00:11.516 + [[ -x /var/lib/dokku/plugins/enabled/ps:restart/subcommands/default ]]
00:00:11.516 + [[ -x /var/lib/dokku/plugins/enabled/ps:restart/subcommands/ps:restart ]]
00:00:11.516 + [[ -x /var/lib/dokku/plugins/enabled/ps/subcommands/restart ]]
00:00:11.516 + /var/lib/dokku/plugins/enabled/ps/subcommands/restart ps:restart api-new-branch api-new-branch
00:00:11.518 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.518 ++ set -eo pipefail
00:00:11.518 ++ [[ -n 1 ]]
00:00:11.518 ++ set -x
00:00:11.520 + source /var/lib/dokku/plugins/available/ps/functions
00:00:11.520 ++ set -eo pipefail
00:00:11.520 ++ [[ -n 1 ]]
00:00:11.520 ++ set -x
00:00:11.521 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.521 +++ set -eo pipefail
00:00:11.521 +++ [[ -n 1 ]]
00:00:11.521 +++ set -x
00:00:11.523 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:11.523 +++ set -eo pipefail
00:00:11.523 +++ [[ -n 1 ]]
00:00:11.523 +++ set -x
00:00:11.523 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.524 ++++ set -eo pipefail
00:00:11.524 ++++ [[ -n 1 ]]
00:00:11.524 ++++ set -x
00:00:11.528 + ps_restart_cmd ps:restart api-new-branch api-new-branch
00:00:11.528 + declare 'desc=restarts app via command line'
00:00:11.528 + local cmd=ps:restart
00:00:11.528 + [[ -z api-new-branch ]]
00:00:11.528 + ps_restart api-new-branch
00:00:11.528 + declare 'desc=restarts app'
00:00:11.528 + local APP=api-new-branch
00:00:11.528 + verify_app_name api-new-branch
00:00:11.528 + declare 'desc=verify app name format and app existence'
00:00:11.528 + local APP=api-new-branch
00:00:11.528 + [[ ! -n api-new-branch ]]
00:00:11.529 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:11.529 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:11.529 + return 0
00:00:11.529 ++ get_running_image_tag api-new-branch
00:00:11.529 ++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'
00:00:11.529 ++ local APP=api-new-branch
00:00:11.529 ++ [[ ! -n api-new-branch ]]
00:00:11.529 ++ verify_app_name api-new-branch
00:00:11.529 ++ declare 'desc=verify app name format and app existence'
00:00:11.529 ++ local APP=api-new-branch
00:00:11.529 ++ [[ ! -n api-new-branch ]]
00:00:11.529 ++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:11.529 ++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:11.529 ++ return 0
00:00:11.529 ++ CIDS=($(get_app_container_ids "$APP"))
00:00:11.530 +++ get_app_container_ids api-new-branch
00:00:11.530 +++ declare 'desc=returns list of docker container ids for given app'
00:00:11.530 +++ local APP=api-new-branch
00:00:11.530 +++ local CONTAINER_TYPE=
00:00:11.530 +++ verify_app_name api-new-branch
00:00:11.530 +++ declare 'desc=verify app name format and app existence'
00:00:11.530 +++ local APP=api-new-branch
00:00:11.530 +++ [[ ! -n api-new-branch ]]
00:00:11.530 +++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:11.530 +++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:11.530 +++ return 0
00:00:11.530 +++ [[ -f /home/dokku/api-new-branch/CONTAINER ]]
00:00:11.530 +++ [[ -n '' ]]
00:00:11.530 +++ local 'CONTAINER_PATTERN=/home/dokku/api-new-branch/CONTAINER.*'
00:00:11.530 +++ shopt -s nullglob
00:00:11.530 +++ local DOKKU_CID_FILE
00:00:11.530 +++ shopt -u nullglob
00:00:11.530 +++ echo ''
00:00:11.531 ++ local CIDS
00:00:11.531 +++ docker inspect -f '{{ .Config.Image }}'
00:00:11.531 +++ awk -F: '{ print $2 }'
00:00:11.544 +++ echo ''
00:00:11.544 ++ local RUNNING_IMAGE_TAG=
00:00:11.544 ++ echo ''
00:00:11.544 + local IMAGE_TAG=
00:00:11.544 + is_deployed api-new-branch
00:00:11.544 + declare 'desc=return 0 if given app has a running container'
00:00:11.544 + local APP=api-new-branch
00:00:11.544 + [[ -f /home/dokku/api-new-branch/CONTAINER ]]
00:00:11.545 ++ ls '/home/dokku/api-new-branch/CONTAINER.*'
00:00:11.546 ++ echo 2
00:00:11.546 + [[ 2 -eq 0 ]]
00:00:11.546 + return 1
00:00:11.546 App api-new-branch has not been deployed
00:00:11.546 + echo 'App api-new-branch has not been deployed'
00:00:11.546 + implemented=1
00:00:11.546 + [[ 1 -eq 0 ]]
00:00:11.546 + [[ 1 -eq 0 ]]
00:00:11.547 + implemented=1
00:00:11.547 + [[ 1 -eq 0 ]]
00:00:11.547 + [[ 1 -eq 0 ]]
00:00:11.547 + exit 0
00:00:11.548 + /var/lib/jenkins/.dokku/contrib/dokku_client.sh postgres:create api-new-branch
00:00:11.904 + case "$(lsb_release -si)" in
00:00:11.904 ++ lsb_release -si
00:00:11.938 + export DOKKU_DISTRO=ubuntu
00:00:11.938 + DOKKU_DISTRO=ubuntu
00:00:11.938 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.938 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.938 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.938 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.938 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.938 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.938 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.938 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.938 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.938 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.938 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.938 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.938 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.938 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.938 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.938 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.938 + export DOKKU_API_VERSION=1
00:00:11.938 + DOKKU_API_VERSION=1
00:00:11.939 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.939 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.939 + export DOKKU_VALID_EXIT=0
00:00:11.939 + DOKKU_VALID_EXIT=0
00:00:11.939 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.939 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.939 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.939 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.939 + export DOKKU_CONTAINER_LABEL=dokku
00:00:11.939 + DOKKU_CONTAINER_LABEL=dokku
00:00:11.939 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.939 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.939 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.939 ++ set -eo pipefail
00:00:11.939 ++ [[ -n 1 ]]
00:00:11.939 ++ set -x
00:00:11.941 + parse_args --app api-new-branch postgres:create api-new-branch
00:00:11.941 + declare 'desc=top-level cli arg parser'
00:00:11.941 + local next_index=1
00:00:11.941 + local skip=false
00:00:11.942 + args=("$@")
00:00:11.942 + local args
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + false
00:00:11.942 + case "$arg" in
00:00:11.942 + export DOKKU_APP_NAME=api-new-branch
00:00:11.942 + DOKKU_APP_NAME=api-new-branch
00:00:11.942 + skip=true
00:00:11.942 + local next_index=2
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + true
00:00:11.942 + skip=false
00:00:11.942 + continue
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + false
00:00:11.942 + case "$arg" in
00:00:11.942 + local next_index=3
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + false
00:00:11.942 + case "$arg" in
00:00:11.942 + local next_index=4
00:00:11.942 + return 0
00:00:11.942 + args=("$@")
00:00:11.942 + [[ --app =~ ^--.* ]]
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + [[ --app == \-\-\a\p\p ]]
00:00:11.942 + shift 2
00:00:11.942 + for arg in '"$@"'
00:00:11.942 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:11.942 + [[ api-new-branch =~ ^--.* ]]
00:00:11.942 + break
00:00:11.942 + has_tty
00:00:11.942 + declare 'desc=return 0 if we have a tty'
00:00:11.942 ++ /usr/bin/tty
00:00:11.943 ++ true
00:00:11.943 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:11.943 + return 1
00:00:11.943 + DOKKU_QUIET_OUTPUT=1
00:00:11.943 ++ id -un
00:00:11.944 + [[ dokku != \d\o\k\k\u ]]
00:00:11.945 ++ id -un
00:00:11.946 + [[ dokku != \r\o\o\t ]]
00:00:11.946 + [[ postgres:create =~ ^plugin:.* ]]
00:00:11.946 + [[ -n --app api-new-branch postgres:create api-new-branch ]]
00:00:11.946 + export -n SSH_ORIGINAL_COMMAND
00:00:11.946 + [[ postgres:create =~ config-* ]]
00:00:11.946 + [[ postgres:create =~ docker-options* ]]
00:00:11.946 + set -f
00:00:11.946 + /usr/local/bin/dokku --app api-new-branch postgres:create api-new-branch
00:00:11.947 + case "$(lsb_release -si)" in
00:00:11.948 ++ lsb_release -si
00:00:11.982 + export DOKKU_DISTRO=ubuntu
00:00:11.982 + DOKKU_DISTRO=ubuntu
00:00:11.982 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.982 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:11.982 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.982 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:11.982 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.982 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:11.982 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.982 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:11.982 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.982 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:11.982 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.982 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:11.982 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.982 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:11.982 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.982 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:11.982 + export DOKKU_API_VERSION=1
00:00:11.982 + DOKKU_API_VERSION=1
00:00:11.982 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.982 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:11.982 + export DOKKU_VALID_EXIT=0
00:00:11.982 + DOKKU_VALID_EXIT=0
00:00:11.982 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.983 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:11.983 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.983 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:11.983 + export DOKKU_CONTAINER_LABEL=dokku
00:00:11.983 + DOKKU_CONTAINER_LABEL=dokku
00:00:11.983 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.983 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:11.983 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:11.983 ++ set -eo pipefail
00:00:11.983 ++ [[ -n 1 ]]
00:00:11.983 ++ set -x
00:00:11.985 + parse_args --app api-new-branch postgres:create api-new-branch
00:00:11.985 + declare 'desc=top-level cli arg parser'
00:00:11.985 + local next_index=1
00:00:11.985 + local skip=false
00:00:11.985 + args=("$@")
00:00:11.985 + local args
00:00:11.985 + for arg in '"$@"'
00:00:11.985 + false
00:00:11.985 + case "$arg" in
00:00:11.985 + export DOKKU_APP_NAME=api-new-branch
00:00:11.985 + DOKKU_APP_NAME=api-new-branch
00:00:11.985 + skip=true
00:00:11.985 + local next_index=2
00:00:11.985 + for arg in '"$@"'
00:00:11.985 + true
00:00:11.985 + skip=false
00:00:11.985 + continue
00:00:11.985 + for arg in '"$@"'
00:00:11.985 + false
00:00:11.985 + case "$arg" in
00:00:11.986 + local next_index=3
00:00:11.986 + for arg in '"$@"'
00:00:11.986 + false
00:00:11.986 + case "$arg" in
00:00:11.986 + local next_index=4
00:00:11.986 + return 0
00:00:11.986 + args=("$@")
00:00:11.986 + [[ --app =~ ^--.* ]]
00:00:11.986 + for arg in '"$@"'
00:00:11.986 + [[ --app == \-\-\a\p\p ]]
00:00:11.986 + shift 2
00:00:11.986 + for arg in '"$@"'
00:00:11.986 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:11.986 + [[ api-new-branch =~ ^--.* ]]
00:00:11.986 + break
00:00:11.986 + has_tty
00:00:11.986 + declare 'desc=return 0 if we have a tty'
00:00:11.986 ++ /usr/bin/tty
00:00:11.986 ++ true
00:00:11.987 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:11.987 + return 1
00:00:11.987 + DOKKU_QUIET_OUTPUT=1
00:00:11.987 ++ id -un
00:00:11.988 + [[ dokku != \d\o\k\k\u ]]
00:00:11.988 ++ id -un
00:00:11.989 + [[ dokku != \r\o\o\t ]]
00:00:11.989 + [[ postgres:create =~ ^plugin:.* ]]
00:00:11.989 + [[ -n '' ]]
00:00:11.989 + dokku_auth postgres:create api-new-branch
00:00:11.989 + declare 'desc=calls user-auth plugin trigger'
00:00:11.989 + export SSH_USER=dokku
00:00:11.989 + SSH_USER=dokku
00:00:11.989 + export SSH_NAME=jenkins
00:00:11.989 + SSH_NAME=jenkins
00:00:11.989 + plugn trigger user-auth dokku jenkins postgres:create api-new-branch
00:00:12.033 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.033 ++ set -eo pipefail
00:00:12.033 ++ [[ -n 1 ]]
00:00:12.033 ++ set -x
00:00:12.036 + [[ ! -n '' ]]
00:00:12.119 + return 0
00:00:12.120 + case "$1" in
00:00:12.120 + execute_dokku_cmd postgres:create api-new-branch
00:00:12.120 + declare 'desc=executes dokku sub-commands'
00:00:12.120 + local PLUGIN_NAME=postgres:create
00:00:12.120 + local PLUGIN_CMD=postgres:create
00:00:12.120 + local implemented=0
00:00:12.120 + local script
00:00:12.120 + argv=("$@")
00:00:12.120 + local argv
00:00:12.120 + case "$PLUGIN_NAME" in
00:00:12.120 ++ readlink -f /var/lib/dokku/plugins/enabled/postgres
00:00:12.121 + [[ /var/lib/dokku/plugins/available/postgres == *core-plugins* ]]
00:00:12.121 + [[ -x /var/lib/dokku/plugins/enabled/postgres:create/subcommands/default ]]
00:00:12.121 + [[ -x /var/lib/dokku/plugins/enabled/postgres:create/subcommands/postgres:create ]]
00:00:12.121 + [[ -x /var/lib/dokku/plugins/enabled/postgres/subcommands/create ]]
00:00:12.121 + [[ 0 -eq 0 ]]
00:00:12.121 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.121 + set +e
00:00:12.121 + /var/lib/dokku/plugins/enabled/00_dokku-standard/commands postgres:create api-new-branch
00:00:12.123 + exit_code=10
00:00:12.123 + set -e
00:00:12.123 + [[ 10 -eq 10 ]]
00:00:12.123 + continue
00:00:12.123 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.123 + set +e
00:00:12.123 + /var/lib/dokku/plugins/enabled/20_events/commands postgres:create api-new-branch
00:00:12.125 + exit_code=10
00:00:12.125 + set -e
00:00:12.125 + [[ 10 -eq 10 ]]
00:00:12.125 + continue
00:00:12.125 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.125 + set +e
00:00:12.125 + /var/lib/dokku/plugins/enabled/apps/commands postgres:create api-new-branch
00:00:12.126 + exit_code=10
00:00:12.126 + set -e
00:00:12.126 + [[ 10 -eq 10 ]]
00:00:12.126 + continue
00:00:12.126 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.126 + set +e
00:00:12.126 + /var/lib/dokku/plugins/enabled/certs/commands postgres:create api-new-branch
00:00:12.128 + exit_code=10
00:00:12.128 + set -e
00:00:12.128 + [[ 10 -eq 10 ]]
00:00:12.128 + continue
00:00:12.128 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.128 + set +e
00:00:12.128 + /var/lib/dokku/plugins/enabled/checks/commands postgres:create api-new-branch
00:00:12.129 + exit_code=10
00:00:12.129 + set -e
00:00:12.129 + [[ 10 -eq 10 ]]
00:00:12.129 + continue
00:00:12.129 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.129 + set +e
00:00:12.129 + /var/lib/dokku/plugins/enabled/config/commands postgres:create api-new-branch
00:00:12.131 + exit_code=10
00:00:12.131 + set -e
00:00:12.131 + [[ 10 -eq 10 ]]
00:00:12.131 + continue
00:00:12.131 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.131 + set +e
00:00:12.131 + /var/lib/dokku/plugins/enabled/docker-options/commands postgres:create api-new-branch
00:00:12.132 + exit_code=10
00:00:12.132 + set -e
00:00:12.132 + [[ 10 -eq 10 ]]
00:00:12.132 + continue
00:00:12.132 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.132 + set +e
00:00:12.132 + /var/lib/dokku/plugins/enabled/domains/commands postgres:create api-new-branch
00:00:12.134 + exit_code=10
00:00:12.134 + set -e
00:00:12.134 + [[ 10 -eq 10 ]]
00:00:12.134 + continue
00:00:12.134 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.134 + set +e
00:00:12.134 + /var/lib/dokku/plugins/enabled/elasticsearch/commands postgres:create api-new-branch
00:00:12.137 + exit_code=10
00:00:12.137 + set -e
00:00:12.137 + [[ 10 -eq 10 ]]
00:00:12.137 + continue
00:00:12.137 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.137 + set +e
00:00:12.137 + /var/lib/dokku/plugins/enabled/enter/commands postgres:create api-new-branch
00:00:12.139 + exit_code=10
00:00:12.139 + set -e
00:00:12.139 + [[ 10 -eq 10 ]]
00:00:12.139 + continue
00:00:12.139 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.139 + set +e
00:00:12.139 + /var/lib/dokku/plugins/enabled/git/commands postgres:create api-new-branch
00:00:12.140 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.140 ++ set -eo pipefail
00:00:12.140 ++ [[ -n 1 ]]
00:00:12.140 ++ set -x
00:00:12.143 + source /var/lib/dokku/plugins/available/apps/functions
00:00:12.143 ++ set -eo pipefail
00:00:12.143 ++ [[ -n 1 ]]
00:00:12.143 ++ set -x
00:00:12.143 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.143 +++ set -eo pipefail
00:00:12.143 +++ [[ -n 1 ]]
00:00:12.143 +++ set -x
00:00:12.146 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:12.146 +++ set -eo pipefail
00:00:12.146 +++ [[ -n 1 ]]
00:00:12.146 +++ set -x
00:00:12.146 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.146 ++++ set -eo pipefail
00:00:12.146 ++++ [[ -n 1 ]]
00:00:12.146 ++++ set -x
00:00:12.150 + source /var/lib/dokku/plugins/available/config/functions
00:00:12.150 ++ set -eo pipefail
00:00:12.150 ++ [[ -n 1 ]]
00:00:12.150 ++ set -x
00:00:12.150 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.150 +++ set -eo pipefail
00:00:12.150 +++ [[ -n 1 ]]
00:00:12.150 +++ set -x
00:00:12.155 + case "$1" in
00:00:12.155 + exit 10
00:00:12.155 + exit_code=10
00:00:12.155 + set -e
00:00:12.155 + [[ 10 -eq 10 ]]
00:00:12.155 + continue
00:00:12.155 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.155 + set +e
00:00:12.155 + /var/lib/dokku/plugins/enabled/logs/commands postgres:create api-new-branch
00:00:12.156 + exit_code=10
00:00:12.156 + set -e
00:00:12.156 + [[ 10 -eq 10 ]]
00:00:12.156 + continue
00:00:12.156 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.156 + set +e
00:00:12.156 + /var/lib/dokku/plugins/enabled/memcached/commands postgres:create api-new-branch
00:00:12.160 + exit_code=10
00:00:12.160 + set -e
00:00:12.160 + [[ 10 -eq 10 ]]
00:00:12.160 + continue
00:00:12.160 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.160 + set +e
00:00:12.160 + /var/lib/dokku/plugins/enabled/nginx-vhosts/commands postgres:create api-new-branch
00:00:12.161 + exit_code=10
00:00:12.161 + set -e
00:00:12.161 + [[ 10 -eq 10 ]]
00:00:12.161 + continue
00:00:12.161 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.161 + set +e
00:00:12.161 + /var/lib/dokku/plugins/enabled/plugin/commands postgres:create api-new-branch
00:00:12.163 + exit_code=10
00:00:12.163 + set -e
00:00:12.163 + [[ 10 -eq 10 ]]
00:00:12.163 + continue
00:00:12.163 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:12.163 + set +e
00:00:12.163 + /var/lib/dokku/plugins/enabled/postgres/commands postgres:create api-new-branch
00:00:12.164 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins
00:00:12.164 + [[ -n 1 ]]
00:00:12.164 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
00:00:12.164 + source /var/lib/dokku/plugins/enabled/common/functions
00:00:12.164 ++ set -eo pipefail
00:00:12.164 ++ [[ -n 1 ]]
00:00:12.164 ++ set -x
00:00:12.167 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:12.168 + source /var/lib/dokku/plugins/enabled/postgres/functions
00:00:12.168 ++ set -eo pipefail
00:00:12.168 ++ [[ -n 1 ]]
00:00:12.168 ++ set -x
00:00:12.168 +++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:12.169 ++ source /var/lib/dokku/plugins/enabled/postgres/config
00:00:12.169 +++ export POSTGRES_IMAGE=postgres
00:00:12.169 +++ POSTGRES_IMAGE=postgres
00:00:12.169 +++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:12.169 +++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:12.169 +++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:12.169 +++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:12.169 +++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:12.169 +++ PLUGIN_COMMAND_PREFIX=postgres
00:00:12.169 +++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:12.169 +++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:12.169 +++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:12.169 +++ export PLUGIN_DATASTORE_PORTS
00:00:12.169 +++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:12.169 +++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:12.169 +++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:12.169 +++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:12.169 +++ export PLUGIN_IMAGE=postgres
00:00:12.170 +++ PLUGIN_IMAGE=postgres
00:00:12.170 +++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:12.170 +++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:12.170 +++ export PLUGIN_SCHEME=postgres
00:00:12.170 +++ PLUGIN_SCHEME=postgres
00:00:12.170 +++ export PLUGIN_SERVICE=Postgres
00:00:12.170 +++ PLUGIN_SERVICE=Postgres
00:00:12.170 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:12.170 +++ set -eo pipefail
00:00:12.170 +++ [[ -n 1 ]]
00:00:12.170 +++ set -x
00:00:12.170 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:12.170 ++++ set -eo pipefail
00:00:12.170 ++++ [[ -n 1 ]]
00:00:12.170 ++++ set -x
00:00:12.176 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:12.176 + source /var/lib/dokku/plugins/enabled/postgres/config
00:00:12.176 ++ export POSTGRES_IMAGE=postgres
00:00:12.176 ++ POSTGRES_IMAGE=postgres
00:00:12.176 ++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:12.176 ++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:12.176 ++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:12.176 ++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:12.176 ++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:12.176 ++ PLUGIN_COMMAND_PREFIX=postgres
00:00:12.176 ++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:12.176 ++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:12.176 ++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:12.176 ++ export PLUGIN_DATASTORE_PORTS
00:00:12.177 ++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:12.177 ++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:12.177 ++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:12.177 ++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:12.177 ++ export PLUGIN_IMAGE=postgres
00:00:12.177 ++ PLUGIN_IMAGE=postgres
00:00:12.177 ++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:12.177 ++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:12.177 ++ export PLUGIN_SCHEME=postgres
00:00:12.177 ++ PLUGIN_SCHEME=postgres
00:00:12.177 ++ export PLUGIN_SERVICE=Postgres
00:00:12.177 ++ PLUGIN_SERVICE=Postgres
00:00:12.177 + [[ postgres:create == postgres:* ]]
00:00:12.177 + [[ ! -d /var/lib/dokku/services/postgres ]]
00:00:12.177 + [[ -d /var/lib/dokku/services/postgres/* ]]
00:00:12.177 + case "$1" in
00:00:12.177 + [[ -z api-new-branch ]]
00:00:12.177 + [[ ! -d /var/lib/dokku/services/postgres/api-new-branch ]]
00:00:12.177 + SERVICE=api-new-branch
00:00:12.177 + SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:12.177 + LINKS_FILE=/var/lib/dokku/services/postgres/api-new-branch/LINKS
00:00:12.178 + docker images
00:00:12.179 + grep -q ' 9.5.2 '
00:00:12.180 + grep -e '^postgres '
00:00:12.197 + mkdir -p /var/lib/dokku/services/postgres/api-new-branch
00:00:12.198 ++ openssl rand -hex 16
00:00:12.201 + password=d7a7c814e7127cf1b0ebf89b5663d452
00:00:12.201 + echo d7a7c814e7127cf1b0ebf89b5663d452
00:00:12.201 + chmod 640 /var/lib/dokku/services/postgres/api-new-branch/PASSWORD
00:00:12.202 + touch /var/lib/dokku/services/postgres/api-new-branch/LINKS
00:00:12.202 + [[ -n '' ]]
00:00:12.202 + echo ''
00:00:12.202 + service_create_container api-new-branch
00:00:12.203 + local SERVICE=api-new-branch
00:00:12.203 + local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:12.203 ++ get_service_name api-new-branch
00:00:12.203 ++ local SERVICE=api-new-branch
00:00:12.203 ++ echo dokku.postgres.api-new-branch
00:00:12.203 + local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:12.203 ++ cat /var/lib/dokku/services/postgres/api-new-branch/PASSWORD
00:00:12.204 + local PASSWORD=d7a7c814e7127cf1b0ebf89b5663d452
00:00:12.204 + local PREVIOUS_ID
00:00:12.204 ++ docker run --name dokku.postgres.api-new-branch -v /var/lib/dokku/services/postgres/api-new-branch/data:/var/lib/postgresql/data -v /var/lib/dokku/services/postgres/api-new-branch/backups:/var/lib/postgresql/backups -e POSTGRES_PASSWORD=d7a7c814e7127cf1b0ebf89b5663d452 --env-file=/var/lib/dokku/services/postgres/api-new-branch/ENV -d --restart always --label dokku=service --label dokku.service=postgres postgres:9.5.2
00:00:12.359        Waiting for container to be ready
00:00:12.359 + ID=d15b65c1ad96561ae974368daaa1984a34693925fa755318e8a3cc692f3f1373
00:00:12.359 + echo d15b65c1ad96561ae974368daaa1984a34693925fa755318e8a3cc692f3f1373
00:00:12.359 + dokku_log_verbose_quiet 'Waiting for container to be ready'
00:00:12.359 + declare 'desc=log verbose formatter (with quiet option)'
00:00:12.359 + [[ -z '' ]]
00:00:12.359 + echo '       Waiting for container to be ready'
00:00:12.359 + docker run --rm --link dokku.postgres.api-new-branch:postgres dokkupaas/wait
00:00:16.898 + dokku_log_verbose_quiet 'Creating container database'
00:00:16.898 + declare 'desc=log verbose formatter (with quiet option)'
00:00:16.898        Creating container database
00:00:16.898 + [[ -z '' ]]
00:00:16.898 + echo '       Creating container database'
00:00:16.898 ++ get_database_name api-new-branch
00:00:16.898 ++ echo api-new-branch
00:00:16.899 ++ tr .- _
00:00:16.899 + DATABASE_NAME=api_new_branch
00:00:16.899 + docker exec dokku.postgres.api-new-branch su - postgres -c 'createdb -E utf8 api_new_branch'
00:00:17.201 + dokku_log_verbose_quiet 'Securing connection to database'
00:00:17.201 + declare 'desc=log verbose formatter (with quiet option)'
00:00:17.201        Securing connection to database
00:00:17.201 + [[ -z '' ]]
00:00:17.201 + echo '       Securing connection to database'
00:00:17.201 + service_stop api-new-branch
00:00:17.201 + local SERVICE=api-new-branch
00:00:17.201 + local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:17.202 ++ get_service_name api-new-branch
00:00:17.202 ++ local SERVICE=api-new-branch
00:00:17.202 ++ echo dokku.postgres.api-new-branch
00:00:17.202 + local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:17.202 ++ docker ps -f status=running
00:00:17.203 ++ grep -e 'dokku.postgres.api-new-branch$'
00:00:17.207 ++ awk '{print $1}'
00:00:17.217 + local ID=d15b65c1ad96
00:00:17.217 + [[ -z d15b65c1ad96 ]]
00:00:17.217 + [[ -n d15b65c1ad96 ]]
00:00:17.217 + dokku_log_info1_quiet 'Stopping container'
00:00:17.218 + declare 'desc=log info1 formatter (with quiet option)'
00:00:17.218 + [[ -z '' ]]
00:00:17.218 + echo '-----> Stopping container'
00:00:17.218 + docker stop dokku.postgres.api-new-branch
00:00:17.398 + service_port_pause api-new-branch
00:00:17.398 + local SERVICE=api-new-branch
00:00:17.398 + local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:17.398 ++ get_service_name api-new-branch
00:00:17.398 ++ local SERVICE=api-new-branch
00:00:17.398 ++ echo dokku.postgres.api-new-branch
00:00:17.399 + local EXPOSED_NAME=dokku.postgres.api-new-branch.ambassador
00:00:17.399 + local PORT_FILE=/var/lib/dokku/services/postgres/api-new-branch/PORT
00:00:17.399 + local LOG_FAIL=
00:00:17.399 + [[ '' == \t\r\u\e ]]
00:00:17.399 + [[ ! -f /var/lib/dokku/services/postgres/api-new-branch/PORT ]]
00:00:17.399 + return 0
00:00:17.399 + dokku_log_info2 'Container stopped'
00:00:17.399 + declare 'desc=log info2 formatter'
00:00:17.399 + echo '=====> Container stopped'
00:00:17.399 + docker run --rm -i -v /var/lib/dokku/services/postgres/api-new-branch/data:/var/lib/postgresql/data postgres:9.5.2 bash -s
00:00:17.399 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:18.727 ++ docker ps -f status=exited
00:00:18.727 ++ grep -e 'dokku.postgres.api-new-branch$'
00:00:18.729 ++ awk '{print $1}'
00:00:18.743 + PREVIOUS_ID=d15b65c1ad96
00:00:18.743 + docker start d15b65c1ad96
00:00:18.879 + service_port_unpause api-new-branch
00:00:18.879 + local SERVICE=api-new-branch
00:00:18.879 + local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:18.879 ++ get_service_name api-new-branch
00:00:18.879 ++ local SERVICE=api-new-branch
00:00:18.879 ++ echo dokku.postgres.api-new-branch
00:00:18.880 + local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:18.880 + local EXPOSED_NAME=dokku.postgres.api-new-branch.ambassador
00:00:18.880 + local PORT_FILE=/var/lib/dokku/services/postgres/api-new-branch/PORT
00:00:18.880 + local LOG_FAIL=
00:00:18.880 + PORTS=(${@:3})
00:00:18.880 + local PORTS
00:00:18.880 + PORTS=(${PORTS[@]:-$(get_random_ports ${#PLUGIN_DATASTORE_PORTS[@]})})
00:00:18.880 ++ get_random_ports 1
00:00:18.880 ++ local iterations=1
00:00:18.880 ++ (( i=0 ))
00:00:18.880 ++ (( i < iterations ))
00:00:18.880 ++ local port=28779
00:00:18.880 ++ local quit=0
00:00:18.880 ++ '[' 0 -ne 1 ']'
00:00:18.880 ++ netstat -an
00:00:18.880 ++ grep 28779
00:00:18.882 ++ '[' 1 -gt 0 ']'
00:00:18.882 ++ quit=1
00:00:18.882 ++ '[' 1 -ne 1 ']'
00:00:18.882 ++ echo 28779
00:00:18.882 ++ (( i++  ))
00:00:18.882 ++ (( i < iterations ))
00:00:18.882 ++ cat /var/lib/dokku/services/postgres/api-new-branch/ID
00:00:18.883 =====> Postgres container created: api-new-branch
00:00:18.883 + local ID=d15b65c1ad96561ae974368daaa1984a34693925fa755318e8a3cc692f3f1373
00:00:18.883 + [[ 1 != \1 ]]
00:00:18.883 + [[ '' == \t\r\u\e ]]
00:00:18.883 + [[ ! -f /var/lib/dokku/services/postgres/api-new-branch/PORT ]]
00:00:18.883 + return 0
00:00:18.883 + dokku_log_info2 'Postgres container created: api-new-branch'
00:00:18.883 + declare 'desc=log info2 formatter'
00:00:18.883 + echo '=====> Postgres container created: api-new-branch'
00:00:18.883 + dokku postgres:info api-new-branch
00:00:18.885 + case "$(lsb_release -si)" in
00:00:18.885 ++ lsb_release -si
00:00:18.922 + export DOKKU_DISTRO=ubuntu
00:00:18.922 + DOKKU_DISTRO=ubuntu
00:00:18.922 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:18.922 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:18.922 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:18.922 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:18.922 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:18.922 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:18.923 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:18.923 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:18.923 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:18.923 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:18.923 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:18.923 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:18.923 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:18.923 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:18.923 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:18.923 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:18.923 + export DOKKU_API_VERSION=1
00:00:18.923 + DOKKU_API_VERSION=1
00:00:18.923 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:18.923 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:18.923 + export DOKKU_VALID_EXIT=0
00:00:18.923 + DOKKU_VALID_EXIT=0
00:00:18.923 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:18.923 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:18.923 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:18.923 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:18.923 + export DOKKU_CONTAINER_LABEL=dokku
00:00:18.923 + DOKKU_CONTAINER_LABEL=dokku
00:00:18.923 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:18.923 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:18.923 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:18.923 ++ set -eo pipefail
00:00:18.923 ++ [[ -n 1 ]]
00:00:18.923 ++ set -x
00:00:18.925 + parse_args postgres:info api-new-branch
00:00:18.925 + declare 'desc=top-level cli arg parser'
00:00:18.925 + local next_index=1
00:00:18.925 + local skip=false
00:00:18.925 + args=("$@")
00:00:18.925 + local args
00:00:18.925 + for arg in '"$@"'
00:00:18.925 + false
00:00:18.925 + case "$arg" in
00:00:18.925 + local next_index=2
00:00:18.925 + for arg in '"$@"'
00:00:18.925 + false
00:00:18.925 + case "$arg" in
00:00:18.925 + local next_index=3
00:00:18.925 + return 0
00:00:18.926 + args=("$@")
00:00:18.926 + [[ postgres:info =~ ^--.* ]]
00:00:18.926 + has_tty
00:00:18.926 + declare 'desc=return 0 if we have a tty'
00:00:18.926 ++ /usr/bin/tty
00:00:18.926 ++ true
00:00:18.927 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:18.927 + return 1
00:00:18.927 + DOKKU_QUIET_OUTPUT=1
00:00:18.927 ++ id -un
00:00:18.928 + [[ dokku != \d\o\k\k\u ]]
00:00:18.928 ++ id -un
00:00:18.929 + [[ dokku != \r\o\o\t ]]
00:00:18.929 + [[ postgres:info =~ ^plugin:.* ]]
00:00:18.929 + [[ -n '' ]]
00:00:18.929 + dokku_auth postgres:info api-new-branch
00:00:18.929 + declare 'desc=calls user-auth plugin trigger'
00:00:18.929 + export SSH_USER=dokku
00:00:18.929 + SSH_USER=dokku
00:00:18.929 + export SSH_NAME=jenkins
00:00:18.929 + SSH_NAME=jenkins
00:00:18.929 + plugn trigger user-auth dokku jenkins postgres:info api-new-branch
00:00:18.973 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:18.973 ++ set -eo pipefail
00:00:18.973 ++ [[ -n 1 ]]
00:00:18.973 ++ set -x
00:00:18.976 + [[ ! -n '' ]]
00:00:19.058 + return 0
00:00:19.059 + case "$1" in
00:00:19.059 + execute_dokku_cmd postgres:info api-new-branch
00:00:19.059 + declare 'desc=executes dokku sub-commands'
00:00:19.059 + local PLUGIN_NAME=postgres:info
00:00:19.059 + local PLUGIN_CMD=postgres:info
00:00:19.059 + local implemented=0
00:00:19.059 + local script
00:00:19.059 + argv=("$@")
00:00:19.059 + local argv
00:00:19.059 + case "$PLUGIN_NAME" in
00:00:19.059 ++ readlink -f /var/lib/dokku/plugins/enabled/postgres
00:00:19.060 + [[ /var/lib/dokku/plugins/available/postgres == *core-plugins* ]]
00:00:19.060 + [[ -x /var/lib/dokku/plugins/enabled/postgres:info/subcommands/default ]]
00:00:19.060 + [[ -x /var/lib/dokku/plugins/enabled/postgres:info/subcommands/postgres:info ]]
00:00:19.060 + [[ -x /var/lib/dokku/plugins/enabled/postgres/subcommands/info ]]
00:00:19.060 + [[ 0 -eq 0 ]]
00:00:19.060 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.060 + set +e
00:00:19.060 + /var/lib/dokku/plugins/enabled/00_dokku-standard/commands postgres:info api-new-branch
00:00:19.062 + exit_code=10
00:00:19.062 + set -e
00:00:19.062 + [[ 10 -eq 10 ]]
00:00:19.062 + continue
00:00:19.062 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.062 + set +e
00:00:19.062 + /var/lib/dokku/plugins/enabled/20_events/commands postgres:info api-new-branch
00:00:19.063 + exit_code=10
00:00:19.063 + set -e
00:00:19.063 + [[ 10 -eq 10 ]]
00:00:19.063 + continue
00:00:19.063 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.063 + set +e
00:00:19.064 + /var/lib/dokku/plugins/enabled/apps/commands postgres:info api-new-branch
00:00:19.065 + exit_code=10
00:00:19.065 + set -e
00:00:19.065 + [[ 10 -eq 10 ]]
00:00:19.065 + continue
00:00:19.065 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.065 + set +e
00:00:19.065 + /var/lib/dokku/plugins/enabled/certs/commands postgres:info api-new-branch
00:00:19.067 + exit_code=10
00:00:19.067 + set -e
00:00:19.067 + [[ 10 -eq 10 ]]
00:00:19.067 + continue
00:00:19.067 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.067 + set +e
00:00:19.067 + /var/lib/dokku/plugins/enabled/checks/commands postgres:info api-new-branch
00:00:19.068 + exit_code=10
00:00:19.068 + set -e
00:00:19.068 + [[ 10 -eq 10 ]]
00:00:19.068 + continue
00:00:19.068 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.068 + set +e
00:00:19.068 + /var/lib/dokku/plugins/enabled/config/commands postgres:info api-new-branch
00:00:19.070 + exit_code=10
00:00:19.070 + set -e
00:00:19.070 + [[ 10 -eq 10 ]]
00:00:19.070 + continue
00:00:19.070 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.070 + set +e
00:00:19.070 + /var/lib/dokku/plugins/enabled/docker-options/commands postgres:info api-new-branch
00:00:19.071 + exit_code=10
00:00:19.071 + set -e
00:00:19.071 + [[ 10 -eq 10 ]]
00:00:19.071 + continue
00:00:19.071 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.071 + set +e
00:00:19.071 + /var/lib/dokku/plugins/enabled/domains/commands postgres:info api-new-branch
00:00:19.073 + exit_code=10
00:00:19.073 + set -e
00:00:19.073 + [[ 10 -eq 10 ]]
00:00:19.073 + continue
00:00:19.073 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.073 + set +e
00:00:19.073 + /var/lib/dokku/plugins/enabled/elasticsearch/commands postgres:info api-new-branch
00:00:19.076 + exit_code=10
00:00:19.076 + set -e
00:00:19.076 + [[ 10 -eq 10 ]]
00:00:19.076 + continue
00:00:19.076 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.076 + set +e
00:00:19.076 + /var/lib/dokku/plugins/enabled/enter/commands postgres:info api-new-branch
00:00:19.077 + exit_code=10
00:00:19.077 + set -e
00:00:19.077 + [[ 10 -eq 10 ]]
00:00:19.077 + continue
00:00:19.077 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.077 + set +e
00:00:19.078 + /var/lib/dokku/plugins/enabled/git/commands postgres:info api-new-branch
00:00:19.079 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.079 ++ set -eo pipefail
00:00:19.079 ++ [[ -n 1 ]]
00:00:19.079 ++ set -x
00:00:19.082 + source /var/lib/dokku/plugins/available/apps/functions
00:00:19.082 ++ set -eo pipefail
00:00:19.082 ++ [[ -n 1 ]]
00:00:19.082 ++ set -x
00:00:19.082 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.082 +++ set -eo pipefail
00:00:19.082 +++ [[ -n 1 ]]
00:00:19.082 +++ set -x
00:00:19.085 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:19.085 +++ set -eo pipefail
00:00:19.085 +++ [[ -n 1 ]]
00:00:19.085 +++ set -x
00:00:19.085 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.085 ++++ set -eo pipefail
00:00:19.085 ++++ [[ -n 1 ]]
00:00:19.085 ++++ set -x
00:00:19.089 + source /var/lib/dokku/plugins/available/config/functions
00:00:19.089 ++ set -eo pipefail
00:00:19.089 ++ [[ -n 1 ]]
00:00:19.089 ++ set -x
00:00:19.089 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.089 +++ set -eo pipefail
00:00:19.089 +++ [[ -n 1 ]]
00:00:19.089 +++ set -x
00:00:19.093 + case "$1" in
00:00:19.093 + exit 10
00:00:19.093 + exit_code=10
00:00:19.093 + set -e
00:00:19.093 + [[ 10 -eq 10 ]]
00:00:19.093 + continue
00:00:19.093 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.093 + set +e
00:00:19.093 + /var/lib/dokku/plugins/enabled/logs/commands postgres:info api-new-branch
00:00:19.095 + exit_code=10
00:00:19.095 + set -e
00:00:19.095 + [[ 10 -eq 10 ]]
00:00:19.095 + continue
00:00:19.095 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.095 + set +e
00:00:19.095 + /var/lib/dokku/plugins/enabled/memcached/commands postgres:info api-new-branch
00:00:19.098 + exit_code=10
00:00:19.098 + set -e
00:00:19.098 + [[ 10 -eq 10 ]]
00:00:19.098 + continue
00:00:19.098 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.098 + set +e
00:00:19.098 + /var/lib/dokku/plugins/enabled/nginx-vhosts/commands postgres:info api-new-branch
00:00:19.100 + exit_code=10
00:00:19.100 + set -e
00:00:19.100 + [[ 10 -eq 10 ]]
00:00:19.100 + continue
00:00:19.100 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.100 + set +e
00:00:19.100 + /var/lib/dokku/plugins/enabled/plugin/commands postgres:info api-new-branch
00:00:19.101 + exit_code=10
00:00:19.101 + set -e
00:00:19.101 + [[ 10 -eq 10 ]]
00:00:19.101 + continue
00:00:19.101 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.101 + set +e
00:00:19.101 + /var/lib/dokku/plugins/enabled/postgres/commands postgres:info api-new-branch
00:00:19.103 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins
00:00:19.103 + [[ -n 1 ]]
00:00:19.103 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
00:00:19.103 + source /var/lib/dokku/plugins/enabled/common/functions
00:00:19.103 ++ set -eo pipefail
00:00:19.103 ++ [[ -n 1 ]]
00:00:19.103 ++ set -x
00:00:19.106 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.107 + source /var/lib/dokku/plugins/enabled/postgres/functions
00:00:19.107 ++ set -eo pipefail
00:00:19.107 ++ [[ -n 1 ]]
00:00:19.107 ++ set -x
00:00:19.107 +++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.108 ++ source /var/lib/dokku/plugins/enabled/postgres/config
00:00:19.108 +++ export POSTGRES_IMAGE=postgres
00:00:19.108 +++ POSTGRES_IMAGE=postgres
00:00:19.108 +++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.108 +++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.108 +++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.108 +++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.108 +++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:19.108 +++ PLUGIN_COMMAND_PREFIX=postgres
00:00:19.108 +++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.108 +++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.108 +++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:19.108 +++ export PLUGIN_DATASTORE_PORTS
00:00:19.108 +++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.108 +++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.108 +++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.108 +++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.108 +++ export PLUGIN_IMAGE=postgres
00:00:19.108 +++ PLUGIN_IMAGE=postgres
00:00:19.108 +++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.108 +++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.108 +++ export PLUGIN_SCHEME=postgres
00:00:19.108 +++ PLUGIN_SCHEME=postgres
00:00:19.108 +++ export PLUGIN_SERVICE=Postgres
00:00:19.108 +++ PLUGIN_SERVICE=Postgres
00:00:19.108 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:19.108 +++ set -eo pipefail
00:00:19.108 +++ [[ -n 1 ]]
00:00:19.108 +++ set -x
00:00:19.108 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.109 ++++ set -eo pipefail
00:00:19.109 ++++ [[ -n 1 ]]
00:00:19.109 ++++ set -x
00:00:19.114 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.115 + source /var/lib/dokku/plugins/enabled/postgres/config
00:00:19.115 ++ export POSTGRES_IMAGE=postgres
00:00:19.115 ++ POSTGRES_IMAGE=postgres
00:00:19.115 ++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.115 ++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.115 ++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.115 ++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.115 ++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:19.115 ++ PLUGIN_COMMAND_PREFIX=postgres
00:00:19.115 ++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.115 ++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.115 ++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:19.115 ++ export PLUGIN_DATASTORE_PORTS
00:00:19.115 ++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.115 ++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.115 ++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.115 ++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.116 ++ export PLUGIN_IMAGE=postgres
00:00:19.116 ++ PLUGIN_IMAGE=postgres
00:00:19.116 ++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.116 ++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.116 ++ export PLUGIN_SCHEME=postgres
00:00:19.116 ++ PLUGIN_SCHEME=postgres
00:00:19.116 ++ export PLUGIN_SERVICE=Postgres
00:00:19.116 ++ PLUGIN_SERVICE=Postgres
00:00:19.116 + [[ postgres:info == postgres:* ]]
00:00:19.116 + [[ ! -d /var/lib/dokku/services/postgres ]]
00:00:19.116 + [[ -d /var/lib/dokku/services/postgres/* ]]
00:00:19.116 + case "$1" in
00:00:19.116 + [[ -z api-new-branch ]]
00:00:19.116 + verify_service_name api-new-branch
00:00:19.116 + local SERVICE=api-new-branch
00:00:19.116 + [[ ! -n api-new-branch ]]
00:00:19.116 + [[ ! -d /var/lib/dokku/services/postgres/api-new-branch ]]
00:00:19.116 + return 0
00:00:19.116 + service_info api-new-branch
00:00:19.116 + local SERVICE=api-new-branch
00:00:19.117 ++ service_url api-new-branch
00:00:19.117 ++ local SERVICE=api-new-branch
00:00:19.117 ++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:19.117 +++ cat /var/lib/dokku/services/postgres/api-new-branch/PASSWORD
00:00:19.118 ++ local PASSWORD=d7a7c814e7127cf1b0ebf89b5663d452
00:00:19.118 +++ get_database_name api-new-branch
00:00:19.118 +++ echo api-new-branch
00:00:19.118 +++ tr .- _
00:00:19.119 ++ local DATABASE_NAME=api_new_branch
00:00:19.120 +++ service_alias api-new-branch
00:00:19.120 +++ local SERVICE=api-new-branch
00:00:19.120 ++++ get_service_name api-new-branch
00:00:19.120 ++++ local SERVICE=api-new-branch
00:00:19.120 ++++ echo dokku.postgres.api-new-branch
00:00:19.120 +++ local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:19.120 +++ echo dokku.postgres.api-new-branch
00:00:19.120 +++ tr ._ -
00:00:19.121 ++ local SERVICE_ALIAS=dokku-postgres-api-new-branch
00:00:19.121 ++ echo postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.122 + local SERVICE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.122 + echo '       DSN: postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'
00:00:19.122        DSN: postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.122 + exit_code=0
00:00:19.122 + set -e
00:00:19.122 + [[ 0 -eq 10 ]]
00:00:19.122 + implemented=1
00:00:19.122 + [[ 0 -ne 0 ]]
00:00:19.122 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.122 + set +e
00:00:19.122 + /var/lib/dokku/plugins/enabled/proxy/commands postgres:info api-new-branch
00:00:19.123 + exit_code=10
00:00:19.123 + set -e
00:00:19.123 + [[ 10 -eq 10 ]]
00:00:19.123 + continue
00:00:19.123 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.123 + set +e
00:00:19.123 + /var/lib/dokku/plugins/enabled/ps/commands postgres:info api-new-branch
00:00:19.125 + exit_code=10
00:00:19.125 + set -e
00:00:19.125 + [[ 10 -eq 10 ]]
00:00:19.125 + continue
00:00:19.125 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.125 + set +e
00:00:19.125 + /var/lib/dokku/plugins/enabled/redis/commands postgres:info api-new-branch
00:00:19.128 + exit_code=10
00:00:19.128 + set -e
00:00:19.128 + [[ 10 -eq 10 ]]
00:00:19.128 + continue
00:00:19.128 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.128 + set +e
00:00:19.128 + /var/lib/dokku/plugins/enabled/shell/commands postgres:info api-new-branch
00:00:19.130 + exit_code=10
00:00:19.130 + set -e
00:00:19.130 + [[ 10 -eq 10 ]]
00:00:19.130 + continue
00:00:19.130 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.130 + set +e
00:00:19.130 + /var/lib/dokku/plugins/enabled/storage/commands postgres:info api-new-branch
00:00:19.131 + exit_code=10
00:00:19.131 + set -e
00:00:19.131 + [[ 10 -eq 10 ]]
00:00:19.131 + continue
00:00:19.131 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.131 + set +e
00:00:19.132 + /var/lib/dokku/plugins/enabled/tags/commands postgres:info api-new-branch
00:00:19.133 + exit_code=10
00:00:19.133 + set -e
00:00:19.133 + [[ 10 -eq 10 ]]
00:00:19.133 + continue
00:00:19.133 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.133 + set +e
00:00:19.133 + /var/lib/dokku/plugins/enabled/tar/commands postgres:info api-new-branch
00:00:19.135 + exit_code=10
00:00:19.135 + set -e
00:00:19.135 + [[ 10 -eq 10 ]]
00:00:19.135 + continue
00:00:19.135 + [[ 1 -eq 0 ]]
00:00:19.135 + exit_code=0
00:00:19.135 + set -e
00:00:19.135 + [[ 0 -eq 10 ]]
00:00:19.135 + implemented=1
00:00:19.135 + [[ 0 -ne 0 ]]
00:00:19.135 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.135 + set +e
00:00:19.135 + /var/lib/dokku/plugins/enabled/proxy/commands postgres:create api-new-branch
00:00:19.137 + exit_code=10
00:00:19.137 + set -e
00:00:19.137 + [[ 10 -eq 10 ]]
00:00:19.137 + continue
00:00:19.137 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.137 + set +e
00:00:19.137 + /var/lib/dokku/plugins/enabled/ps/commands postgres:create api-new-branch
00:00:19.138 + exit_code=10
00:00:19.138 + set -e
00:00:19.138 + [[ 10 -eq 10 ]]
00:00:19.138 + continue
00:00:19.138 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.138 + set +e
00:00:19.138 + /var/lib/dokku/plugins/enabled/redis/commands postgres:create api-new-branch
00:00:19.142 + exit_code=10
00:00:19.142 + set -e
00:00:19.142 + [[ 10 -eq 10 ]]
00:00:19.142 + continue
00:00:19.142 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.142 + set +e
00:00:19.142 + /var/lib/dokku/plugins/enabled/shell/commands postgres:create api-new-branch
00:00:19.143 + exit_code=10
00:00:19.143 + set -e
00:00:19.143 + [[ 10 -eq 10 ]]
00:00:19.143 + continue
00:00:19.143 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.143 + set +e
00:00:19.143 + /var/lib/dokku/plugins/enabled/storage/commands postgres:create api-new-branch
00:00:19.145 + exit_code=10
00:00:19.145 + set -e
00:00:19.145 + [[ 10 -eq 10 ]]
00:00:19.145 + continue
00:00:19.145 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.145 + set +e
00:00:19.145 + /var/lib/dokku/plugins/enabled/tags/commands postgres:create api-new-branch
00:00:19.146 + exit_code=10
00:00:19.146 + set -e
00:00:19.146 + [[ 10 -eq 10 ]]
00:00:19.146 + continue
00:00:19.146 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.146 + set +e
00:00:19.146 + /var/lib/dokku/plugins/enabled/tar/commands postgres:create api-new-branch
00:00:19.148 + exit_code=10
00:00:19.148 + set -e
00:00:19.148 + [[ 10 -eq 10 ]]
00:00:19.148 + continue
00:00:19.148 + [[ 1 -eq 0 ]]
00:00:19.148 + set +f
00:00:19.148 + exit 0
00:00:19.149 + /var/lib/jenkins/.dokku/contrib/dokku_client.sh postgres:link api-new-branch api-new-branch
00:00:19.504 + case "$(lsb_release -si)" in
00:00:19.504 ++ lsb_release -si
00:00:19.539 + export DOKKU_DISTRO=ubuntu
00:00:19.539 + DOKKU_DISTRO=ubuntu
00:00:19.539 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.539 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.539 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.539 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.540 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.540 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.540 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.540 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.540 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.540 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.540 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.540 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.540 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.540 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.540 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.540 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.540 + export DOKKU_API_VERSION=1
00:00:19.540 + DOKKU_API_VERSION=1
00:00:19.540 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.540 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.540 + export DOKKU_VALID_EXIT=0
00:00:19.540 + DOKKU_VALID_EXIT=0
00:00:19.540 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.540 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.540 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.540 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.540 + export DOKKU_CONTAINER_LABEL=dokku
00:00:19.540 + DOKKU_CONTAINER_LABEL=dokku
00:00:19.540 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.540 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.540 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.540 ++ set -eo pipefail
00:00:19.540 ++ [[ -n 1 ]]
00:00:19.540 ++ set -x
00:00:19.543 + parse_args --app api-new-branch postgres:link api-new-branch api-new-branch
00:00:19.543 + declare 'desc=top-level cli arg parser'
00:00:19.543 + local next_index=1
00:00:19.543 + local skip=false
00:00:19.543 + args=("$@")
00:00:19.543 + local args
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + false
00:00:19.543 + case "$arg" in
00:00:19.543 + export DOKKU_APP_NAME=api-new-branch
00:00:19.543 + DOKKU_APP_NAME=api-new-branch
00:00:19.543 + skip=true
00:00:19.543 + local next_index=2
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + true
00:00:19.543 + skip=false
00:00:19.543 + continue
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + false
00:00:19.543 + case "$arg" in
00:00:19.543 + local next_index=3
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + false
00:00:19.543 + case "$arg" in
00:00:19.543 + local next_index=4
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + false
00:00:19.543 + case "$arg" in
00:00:19.543 + local next_index=5
00:00:19.543 + return 0
00:00:19.543 + args=("$@")
00:00:19.543 + [[ --app =~ ^--.* ]]
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + [[ --app == \-\-\a\p\p ]]
00:00:19.543 + shift 2
00:00:19.543 + for arg in '"$@"'
00:00:19.543 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:19.543 + [[ api-new-branch =~ ^--.* ]]
00:00:19.543 + break
00:00:19.543 + has_tty
00:00:19.543 + declare 'desc=return 0 if we have a tty'
00:00:19.544 ++ /usr/bin/tty
00:00:19.544 ++ true
00:00:19.545 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:19.545 + return 1
00:00:19.545 + DOKKU_QUIET_OUTPUT=1
00:00:19.545 ++ id -un
00:00:19.546 + [[ dokku != \d\o\k\k\u ]]
00:00:19.546 ++ id -un
00:00:19.547 + [[ dokku != \r\o\o\t ]]
00:00:19.547 + [[ postgres:link =~ ^plugin:.* ]]
00:00:19.547 + [[ -n --app api-new-branch postgres:link api-new-branch api-new-branch ]]
00:00:19.547 + export -n SSH_ORIGINAL_COMMAND
00:00:19.547 + [[ postgres:link =~ config-* ]]
00:00:19.547 + [[ postgres:link =~ docker-options* ]]
00:00:19.547 + set -f
00:00:19.547 + /usr/local/bin/dokku --app api-new-branch postgres:link api-new-branch api-new-branch
00:00:19.549 + case "$(lsb_release -si)" in
00:00:19.549 ++ lsb_release -si
00:00:19.583 + export DOKKU_DISTRO=ubuntu
00:00:19.583 + DOKKU_DISTRO=ubuntu
00:00:19.583 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.583 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.583 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.583 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.583 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.583 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.583 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.583 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.583 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.583 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.583 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.583 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.584 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.584 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.584 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.584 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.584 + export DOKKU_API_VERSION=1
00:00:19.584 + DOKKU_API_VERSION=1
00:00:19.584 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.584 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.584 + export DOKKU_VALID_EXIT=0
00:00:19.584 + DOKKU_VALID_EXIT=0
00:00:19.584 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.584 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.584 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.584 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.584 + export DOKKU_CONTAINER_LABEL=dokku
00:00:19.584 + DOKKU_CONTAINER_LABEL=dokku
00:00:19.584 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.584 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.584 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.584 ++ set -eo pipefail
00:00:19.584 ++ [[ -n 1 ]]
00:00:19.584 ++ set -x
00:00:19.587 + parse_args --app api-new-branch postgres:link api-new-branch api-new-branch
00:00:19.587 + declare 'desc=top-level cli arg parser'
00:00:19.587 + local next_index=1
00:00:19.587 + local skip=false
00:00:19.587 + args=("$@")
00:00:19.587 + local args
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + false
00:00:19.587 + case "$arg" in
00:00:19.587 + export DOKKU_APP_NAME=api-new-branch
00:00:19.587 + DOKKU_APP_NAME=api-new-branch
00:00:19.587 + skip=true
00:00:19.587 + local next_index=2
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + true
00:00:19.587 + skip=false
00:00:19.587 + continue
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + false
00:00:19.587 + case "$arg" in
00:00:19.587 + local next_index=3
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + false
00:00:19.587 + case "$arg" in
00:00:19.587 + local next_index=4
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + false
00:00:19.587 + case "$arg" in
00:00:19.587 + local next_index=5
00:00:19.587 + return 0
00:00:19.587 + args=("$@")
00:00:19.587 + [[ --app =~ ^--.* ]]
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + [[ --app == \-\-\a\p\p ]]
00:00:19.587 + shift 2
00:00:19.587 + for arg in '"$@"'
00:00:19.587 + [[ api-new-branch == \-\-\a\p\p ]]
00:00:19.587 + [[ api-new-branch =~ ^--.* ]]
00:00:19.587 + break
00:00:19.587 + has_tty
00:00:19.587 + declare 'desc=return 0 if we have a tty'
00:00:19.587 ++ /usr/bin/tty
00:00:19.588 ++ true
00:00:19.588 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:19.588 + return 1
00:00:19.588 + DOKKU_QUIET_OUTPUT=1
00:00:19.589 ++ id -un
00:00:19.590 + [[ dokku != \d\o\k\k\u ]]
00:00:19.590 ++ id -un
00:00:19.591 + [[ dokku != \r\o\o\t ]]
00:00:19.591 + [[ postgres:link =~ ^plugin:.* ]]
00:00:19.591 + [[ -n '' ]]
00:00:19.591 + dokku_auth postgres:link api-new-branch api-new-branch
00:00:19.591 + declare 'desc=calls user-auth plugin trigger'
00:00:19.591 + export SSH_USER=dokku
00:00:19.591 + SSH_USER=dokku
00:00:19.591 + export SSH_NAME=jenkins
00:00:19.591 + SSH_NAME=jenkins
00:00:19.591 + plugn trigger user-auth dokku jenkins postgres:link api-new-branch api-new-branch
00:00:19.636 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.636 ++ set -eo pipefail
00:00:19.636 ++ [[ -n 1 ]]
00:00:19.636 ++ set -x
00:00:19.639 + [[ ! -n '' ]]
00:00:19.723 + return 0
00:00:19.724 + case "$1" in
00:00:19.724 + execute_dokku_cmd postgres:link api-new-branch api-new-branch
00:00:19.724 + declare 'desc=executes dokku sub-commands'
00:00:19.724 + local PLUGIN_NAME=postgres:link
00:00:19.724 + local PLUGIN_CMD=postgres:link
00:00:19.724 + local implemented=0
00:00:19.724 + local script
00:00:19.724 + argv=("$@")
00:00:19.724 + local argv
00:00:19.724 + case "$PLUGIN_NAME" in
00:00:19.725 ++ readlink -f /var/lib/dokku/plugins/enabled/postgres
00:00:19.725 + [[ /var/lib/dokku/plugins/available/postgres == *core-plugins* ]]
00:00:19.725 + [[ -x /var/lib/dokku/plugins/enabled/postgres:link/subcommands/default ]]
00:00:19.725 + [[ -x /var/lib/dokku/plugins/enabled/postgres:link/subcommands/postgres:link ]]
00:00:19.725 + [[ -x /var/lib/dokku/plugins/enabled/postgres/subcommands/link ]]
00:00:19.725 + [[ 0 -eq 0 ]]
00:00:19.725 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.725 + set +e
00:00:19.725 + /var/lib/dokku/plugins/enabled/00_dokku-standard/commands postgres:link api-new-branch api-new-branch
00:00:19.727 + exit_code=10
00:00:19.727 + set -e
00:00:19.727 + [[ 10 -eq 10 ]]
00:00:19.727 + continue
00:00:19.727 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.727 + set +e
00:00:19.727 + /var/lib/dokku/plugins/enabled/20_events/commands postgres:link api-new-branch api-new-branch
00:00:19.729 + exit_code=10
00:00:19.729 + set -e
00:00:19.729 + [[ 10 -eq 10 ]]
00:00:19.729 + continue
00:00:19.729 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.729 + set +e
00:00:19.729 + /var/lib/dokku/plugins/enabled/apps/commands postgres:link api-new-branch api-new-branch
00:00:19.730 + exit_code=10
00:00:19.730 + set -e
00:00:19.730 + [[ 10 -eq 10 ]]
00:00:19.730 + continue
00:00:19.730 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.730 + set +e
00:00:19.730 + /var/lib/dokku/plugins/enabled/certs/commands postgres:link api-new-branch api-new-branch
00:00:19.732 + exit_code=10
00:00:19.732 + set -e
00:00:19.732 + [[ 10 -eq 10 ]]
00:00:19.732 + continue
00:00:19.732 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.732 + set +e
00:00:19.732 + /var/lib/dokku/plugins/enabled/checks/commands postgres:link api-new-branch api-new-branch
00:00:19.733 + exit_code=10
00:00:19.733 + set -e
00:00:19.733 + [[ 10 -eq 10 ]]
00:00:19.733 + continue
00:00:19.733 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.733 + set +e
00:00:19.733 + /var/lib/dokku/plugins/enabled/config/commands postgres:link api-new-branch api-new-branch
00:00:19.735 + exit_code=10
00:00:19.735 + set -e
00:00:19.735 + [[ 10 -eq 10 ]]
00:00:19.735 + continue
00:00:19.735 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.735 + set +e
00:00:19.735 + /var/lib/dokku/plugins/enabled/docker-options/commands postgres:link api-new-branch api-new-branch
00:00:19.736 + exit_code=10
00:00:19.736 + set -e
00:00:19.737 + [[ 10 -eq 10 ]]
00:00:19.737 + continue
00:00:19.737 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.737 + set +e
00:00:19.737 + /var/lib/dokku/plugins/enabled/domains/commands postgres:link api-new-branch api-new-branch
00:00:19.738 + exit_code=10
00:00:19.738 + set -e
00:00:19.738 + [[ 10 -eq 10 ]]
00:00:19.738 + continue
00:00:19.738 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.738 + set +e
00:00:19.738 + /var/lib/dokku/plugins/enabled/elasticsearch/commands postgres:link api-new-branch api-new-branch
00:00:19.741 + exit_code=10
00:00:19.741 + set -e
00:00:19.741 + [[ 10 -eq 10 ]]
00:00:19.741 + continue
00:00:19.741 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.741 + set +e
00:00:19.742 + /var/lib/dokku/plugins/enabled/enter/commands postgres:link api-new-branch api-new-branch
00:00:19.743 + exit_code=10
00:00:19.743 + set -e
00:00:19.743 + [[ 10 -eq 10 ]]
00:00:19.743 + continue
00:00:19.743 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.743 + set +e
00:00:19.743 + /var/lib/dokku/plugins/enabled/git/commands postgres:link api-new-branch api-new-branch
00:00:19.744 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.744 ++ set -eo pipefail
00:00:19.745 ++ [[ -n 1 ]]
00:00:19.745 ++ set -x
00:00:19.747 + source /var/lib/dokku/plugins/available/apps/functions
00:00:19.747 ++ set -eo pipefail
00:00:19.747 ++ [[ -n 1 ]]
00:00:19.747 ++ set -x
00:00:19.748 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.748 +++ set -eo pipefail
00:00:19.748 +++ [[ -n 1 ]]
00:00:19.748 +++ set -x
00:00:19.750 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:19.750 +++ set -eo pipefail
00:00:19.750 +++ [[ -n 1 ]]
00:00:19.750 +++ set -x
00:00:19.750 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.751 ++++ set -eo pipefail
00:00:19.751 ++++ [[ -n 1 ]]
00:00:19.751 ++++ set -x
00:00:19.754 + source /var/lib/dokku/plugins/available/config/functions
00:00:19.755 ++ set -eo pipefail
00:00:19.755 ++ [[ -n 1 ]]
00:00:19.755 ++ set -x
00:00:19.755 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.755 +++ set -eo pipefail
00:00:19.755 +++ [[ -n 1 ]]
00:00:19.755 +++ set -x
00:00:19.759 + case "$1" in
00:00:19.759 + exit 10
00:00:19.759 + exit_code=10
00:00:19.759 + set -e
00:00:19.759 + [[ 10 -eq 10 ]]
00:00:19.759 + continue
00:00:19.759 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.759 + set +e
00:00:19.759 + /var/lib/dokku/plugins/enabled/logs/commands postgres:link api-new-branch api-new-branch
00:00:19.761 + exit_code=10
00:00:19.761 + set -e
00:00:19.761 + [[ 10 -eq 10 ]]
00:00:19.761 + continue
00:00:19.761 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.761 + set +e
00:00:19.761 + /var/lib/dokku/plugins/enabled/memcached/commands postgres:link api-new-branch api-new-branch
00:00:19.764 + exit_code=10
00:00:19.764 + set -e
00:00:19.764 + [[ 10 -eq 10 ]]
00:00:19.764 + continue
00:00:19.764 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.764 + set +e
00:00:19.764 + /var/lib/dokku/plugins/enabled/nginx-vhosts/commands postgres:link api-new-branch api-new-branch
00:00:19.766 + exit_code=10
00:00:19.766 + set -e
00:00:19.766 + [[ 10 -eq 10 ]]
00:00:19.766 + continue
00:00:19.766 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.766 + set +e
00:00:19.766 + /var/lib/dokku/plugins/enabled/plugin/commands postgres:link api-new-branch api-new-branch
00:00:19.767 + exit_code=10
00:00:19.767 + set -e
00:00:19.767 + [[ 10 -eq 10 ]]
00:00:19.767 + continue
00:00:19.767 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:19.767 + set +e
00:00:19.767 + /var/lib/dokku/plugins/enabled/postgres/commands postgres:link api-new-branch api-new-branch
00:00:19.769 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins
00:00:19.769 + [[ -n 1 ]]
00:00:19.769 + PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
00:00:19.769 + source /var/lib/dokku/plugins/enabled/common/functions
00:00:19.769 ++ set -eo pipefail
00:00:19.769 ++ [[ -n 1 ]]
00:00:19.769 ++ set -x
00:00:19.772 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.772 + source /var/lib/dokku/plugins/enabled/postgres/functions
00:00:19.772 ++ set -eo pipefail
00:00:19.772 ++ [[ -n 1 ]]
00:00:19.772 ++ set -x
00:00:19.773 +++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.773 ++ source /var/lib/dokku/plugins/enabled/postgres/config
00:00:19.774 +++ export POSTGRES_IMAGE=postgres
00:00:19.774 +++ POSTGRES_IMAGE=postgres
00:00:19.774 +++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.774 +++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.774 +++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.774 +++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.774 +++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:19.774 +++ PLUGIN_COMMAND_PREFIX=postgres
00:00:19.774 +++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.774 +++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.774 +++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:19.774 +++ export PLUGIN_DATASTORE_PORTS
00:00:19.774 +++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.774 +++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.774 +++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.774 +++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.774 +++ export PLUGIN_IMAGE=postgres
00:00:19.774 +++ PLUGIN_IMAGE=postgres
00:00:19.774 +++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.774 +++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.774 +++ export PLUGIN_SCHEME=postgres
00:00:19.774 +++ PLUGIN_SCHEME=postgres
00:00:19.774 +++ export PLUGIN_SERVICE=Postgres
00:00:19.774 +++ PLUGIN_SERVICE=Postgres
00:00:19.774 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:19.774 +++ set -eo pipefail
00:00:19.774 +++ [[ -n 1 ]]
00:00:19.774 +++ set -x
00:00:19.774 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.774 ++++ set -eo pipefail
00:00:19.774 ++++ [[ -n 1 ]]
00:00:19.774 ++++ set -x
00:00:19.780 ++ dirname /var/lib/dokku/plugins/enabled/postgres/commands
00:00:19.781 + source /var/lib/dokku/plugins/enabled/postgres/config
00:00:19.781 ++ export POSTGRES_IMAGE=postgres
00:00:19.781 ++ POSTGRES_IMAGE=postgres
00:00:19.781 ++ export POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.781 ++ POSTGRES_IMAGE_VERSION=9.5.2
00:00:19.781 ++ export POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.781 ++ POSTGRES_ROOT=/var/lib/dokku/services/postgres
00:00:19.781 ++ export PLUGIN_COMMAND_PREFIX=postgres
00:00:19.781 ++ PLUGIN_COMMAND_PREFIX=postgres
00:00:19.781 ++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.781 ++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/postgres
00:00:19.781 ++ PLUGIN_DATASTORE_PORTS=(5432)
00:00:19.781 ++ export PLUGIN_DATASTORE_PORTS
00:00:19.781 ++ export PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.781 ++ PLUGIN_DEFAULT_ALIAS=DATABASE
00:00:19.781 ++ export PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.781 ++ PLUGIN_ALT_ALIAS=DOKKU_POSTGRES
00:00:19.781 ++ export PLUGIN_IMAGE=postgres
00:00:19.781 ++ PLUGIN_IMAGE=postgres
00:00:19.781 ++ export PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.781 ++ PLUGIN_IMAGE_VERSION=9.5.2
00:00:19.781 ++ export PLUGIN_SCHEME=postgres
00:00:19.781 ++ PLUGIN_SCHEME=postgres
00:00:19.781 ++ export PLUGIN_SERVICE=Postgres
00:00:19.781 ++ PLUGIN_SERVICE=Postgres
00:00:19.781 + [[ postgres:link == postgres:* ]]
00:00:19.781 + [[ ! -d /var/lib/dokku/services/postgres ]]
00:00:19.782 + [[ -d /var/lib/dokku/services/postgres/* ]]
00:00:19.782 + case "$1" in
00:00:19.782 + [[ -z api-new-branch ]]
00:00:19.782 + [[ -z api-new-branch ]]
00:00:19.782 + verify_app_name api-new-branch
00:00:19.782 + declare 'desc=verify app name format and app existence'
00:00:19.782 + local APP=api-new-branch
00:00:19.782 + [[ ! -n api-new-branch ]]
00:00:19.782 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:19.782 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:19.782 + return 0
00:00:19.782 + verify_service_name api-new-branch
00:00:19.782 + local SERVICE=api-new-branch
00:00:19.782 + [[ ! -n api-new-branch ]]
00:00:19.782 + [[ ! -d /var/lib/dokku/services/postgres/api-new-branch ]]
00:00:19.782 + return 0
00:00:19.782 + service_link api-new-branch api-new-branch
00:00:19.782 + local APP=api-new-branch
00:00:19.782 + local SERVICE=api-new-branch
00:00:19.782 + update_plugin_scheme_for_app api-new-branch
00:00:19.782 + local APP=api-new-branch
00:00:19.783 ++ config_get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.783 ++ declare 'desc=get value of given config var'
00:00:19.783 ++ [[ api-new-branch == \c\o\n\f\i\g\:\g\e\t ]]
00:00:19.783 ++ set -- config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.783 ++ config_parse_args config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.783 ++ declare 'desc=parse config plugin args'
00:00:19.783 ++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:19.783 ++ for var in '"$@"'
00:00:19.783 ++ [[ config:get == \-\-\g\l\o\b\a\l ]]
00:00:19.783 ++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.783 ++ [[ config:get == \-\-\e\x\p\o\r\t ]]
00:00:19.783 ++ [[ config:get == \-\-\s\h\e\l\l ]]
00:00:19.783 ++ for var in '"$@"'
00:00:19.783 ++ [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:19.783 ++ [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.783 ++ [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:19.783 ++ [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:19.783 ++ for var in '"$@"'
00:00:19.783 ++ [[ POSTGRES_DATABASE_SCHEME == \-\-\g\l\o\b\a\l ]]
00:00:19.783 ++ [[ POSTGRES_DATABASE_SCHEME == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.783 ++ [[ POSTGRES_DATABASE_SCHEME == \-\-\e\x\p\o\r\t ]]
00:00:19.783 ++ [[ POSTGRES_DATABASE_SCHEME == \-\-\s\h\e\l\l ]]
00:00:19.783 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:19.783 +++ get_sanitized_config_args config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.783 +++ local 'desc=return sanitized arguments for config plugin'
00:00:19.783 +++ SANITIZED_ARGS=("$@")
00:00:19.783 +++ local SANITIZED_ARGS
00:00:19.783 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:19.783 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:19.783 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:19.783 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:19.784 +++ echo config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.784 ++ local SANITIZED_ARGS
00:00:19.784 ++ set -- config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.784 ++ DOKKU_CONFIG_TYPE=app
00:00:19.784 ++ DOKKU_CONFIG_RESTART=true
00:00:19.784 ++ [[ app == \a\p\p ]]
00:00:19.784 ++ [[ -z api-new-branch ]]
00:00:19.784 ++ verify_app_name api-new-branch
00:00:19.784 ++ declare 'desc=verify app name format and app existence'
00:00:19.784 ++ local APP=api-new-branch
00:00:19.784 ++ [[ ! -n api-new-branch ]]
00:00:19.784 ++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:19.784 ++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:19.784 ++ return 0
00:00:19.784 ++ APP=api-new-branch
00:00:19.784 ++ ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:19.784 ++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:19.784 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:19.784 +++ get_sanitized_config_args config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.784 +++ local 'desc=return sanitized arguments for config plugin'
00:00:19.785 +++ SANITIZED_ARGS=("$@")
00:00:19.785 +++ local SANITIZED_ARGS
00:00:19.785 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:19.785 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:19.785 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:19.785 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:19.785 +++ echo config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.785 ++ local SANITIZED_ARGS
00:00:19.785 ++ set -- config:get api-new-branch POSTGRES_DATABASE_SCHEME
00:00:19.785 ++ [[ -z api-new-branch ]]
00:00:19.785 ++ config_create /home/dokku/api-new-branch/ENV
00:00:19.785 ++ declare 'desc=create config env file'
00:00:19.785 ++ local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:19.785 ++ [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:19.785 ++ [[ ! -s /home/dokku/api-new-branch/ENV ]]
00:00:19.785 ++ local KEY=POSTGRES_DATABASE_SCHEME
00:00:19.785 ++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/api-new-branch/ENV
00:00:19.785 ++ sed -e 's/^'\''//' -e 's/'\''$//'
00:00:19.787 ++ cut -d= -f2-
00:00:19.787 ++ grep '^export POSTGRES_DATABASE_SCHEME='
00:00:19.788 + local POSTGRES_DATABASE_SCHEME=
00:00:19.788 + PLUGIN_SCHEME=postgres
00:00:19.789 ++ service_url api-new-branch
00:00:19.789 ++ local SERVICE=api-new-branch
00:00:19.789 ++ local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:19.789 +++ cat /var/lib/dokku/services/postgres/api-new-branch/PASSWORD
00:00:19.790 ++ local PASSWORD=d7a7c814e7127cf1b0ebf89b5663d452
00:00:19.790 +++ get_database_name api-new-branch
00:00:19.790 +++ echo api-new-branch
00:00:19.790 +++ tr .- _
00:00:19.791 ++ local DATABASE_NAME=api_new_branch
00:00:19.792 +++ service_alias api-new-branch
00:00:19.792 +++ local SERVICE=api-new-branch
00:00:19.792 ++++ get_service_name api-new-branch
00:00:19.792 ++++ local SERVICE=api-new-branch
00:00:19.792 ++++ echo dokku.postgres.api-new-branch
00:00:19.792 +++ local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:19.792 +++ echo dokku.postgres.api-new-branch
00:00:19.792 +++ tr ._ -
00:00:19.793 ++ local SERVICE_ALIAS=dokku-postgres-api-new-branch
00:00:19.793 ++ echo postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.794 + local SERVICE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.794 ++ get_service_name api-new-branch
00:00:19.794 ++ local SERVICE=api-new-branch
00:00:19.794 ++ echo dokku.postgres.api-new-branch
00:00:19.794 + local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:19.794 + local SERVICE_ROOT=/var/lib/dokku/services/postgres/api-new-branch
00:00:19.794 ++ dokku config api-new-branch
00:00:19.796 + case "$(lsb_release -si)" in
00:00:19.796 ++ lsb_release -si
00:00:19.833 + export DOKKU_DISTRO=ubuntu
00:00:19.833 + DOKKU_DISTRO=ubuntu
00:00:19.833 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.833 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:19.833 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.833 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:19.833 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.833 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:19.833 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.833 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:19.833 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.833 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:19.833 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.833 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:19.833 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.833 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:19.833 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.833 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:19.833 + export DOKKU_API_VERSION=1
00:00:19.833 + DOKKU_API_VERSION=1
00:00:19.833 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.833 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:19.833 + export DOKKU_VALID_EXIT=0
00:00:19.833 + DOKKU_VALID_EXIT=0
00:00:19.833 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.833 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:19.833 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.833 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:19.833 + export DOKKU_CONTAINER_LABEL=dokku
00:00:19.833 + DOKKU_CONTAINER_LABEL=dokku
00:00:19.833 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.833 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:19.833 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.833 ++ set -eo pipefail
00:00:19.833 ++ [[ -n 1 ]]
00:00:19.833 ++ set -x
00:00:19.836 + parse_args config api-new-branch
00:00:19.836 + declare 'desc=top-level cli arg parser'
00:00:19.836 + local next_index=1
00:00:19.836 + local skip=false
00:00:19.836 + args=("$@")
00:00:19.836 + local args
00:00:19.836 + for arg in '"$@"'
00:00:19.836 + false
00:00:19.836 + case "$arg" in
00:00:19.836 + local next_index=2
00:00:19.836 + for arg in '"$@"'
00:00:19.836 + false
00:00:19.836 + case "$arg" in
00:00:19.836 + local next_index=3
00:00:19.836 + return 0
00:00:19.836 + args=("$@")
00:00:19.836 + [[ config =~ ^--.* ]]
00:00:19.836 + has_tty
00:00:19.836 + declare 'desc=return 0 if we have a tty'
00:00:19.837 ++ /usr/bin/tty
00:00:19.837 ++ true
00:00:19.838 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:19.838 + return 1
00:00:19.838 + DOKKU_QUIET_OUTPUT=1
00:00:19.838 ++ id -un
00:00:19.839 + [[ dokku != \d\o\k\k\u ]]
00:00:19.839 ++ id -un
00:00:19.840 + [[ dokku != \r\o\o\t ]]
00:00:19.840 + [[ config =~ ^plugin:.* ]]
00:00:19.840 + [[ -n '' ]]
00:00:19.840 + dokku_auth config api-new-branch
00:00:19.840 + declare 'desc=calls user-auth plugin trigger'
00:00:19.840 + export SSH_USER=dokku
00:00:19.840 + SSH_USER=dokku
00:00:19.840 + export SSH_NAME=jenkins
00:00:19.840 + SSH_NAME=jenkins
00:00:19.840 + plugn trigger user-auth dokku jenkins config api-new-branch
00:00:19.885 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.885 ++ set -eo pipefail
00:00:19.885 ++ [[ -n 1 ]]
00:00:19.885 ++ set -x
00:00:19.888 + [[ ! -n '' ]]
00:00:19.975 + return 0
00:00:19.975 + case "$1" in
00:00:19.975 + execute_dokku_cmd config api-new-branch
00:00:19.975 + declare 'desc=executes dokku sub-commands'
00:00:19.975 + local PLUGIN_NAME=config
00:00:19.975 + local PLUGIN_CMD=config
00:00:19.976 + local implemented=0
00:00:19.976 + local script
00:00:19.976 + argv=("$@")
00:00:19.976 + local argv
00:00:19.976 + case "$PLUGIN_NAME" in
00:00:19.976 ++ readlink -f /var/lib/dokku/plugins/enabled/config
00:00:19.976 + [[ /var/lib/dokku/core-plugins/available/config == *core-plugins* ]]
00:00:19.976 + [[ config == \c\o\n\f\i\g ]]
00:00:19.976 + shift 1
00:00:19.976 + [[ ! -z api-new-branch ]]
00:00:19.976 + [[ config == config* ]]
00:00:19.976 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.977 + set -- api-new-branch api-new-branch
00:00:19.977 + set -- config api-new-branch api-new-branch
00:00:19.977 + [[ -x /var/lib/dokku/plugins/enabled/config/subcommands/default ]]
00:00:19.977 + /var/lib/dokku/plugins/enabled/config/subcommands/default config api-new-branch api-new-branch
00:00:19.978 + source /var/lib/dokku/plugins/available/config/functions
00:00:19.978 ++ set -eo pipefail
00:00:19.978 ++ [[ -n 1 ]]
00:00:19.978 ++ set -x
00:00:19.978 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:19.978 +++ set -eo pipefail
00:00:19.978 +++ [[ -n 1 ]]
00:00:19.978 +++ set -x
00:00:19.982 + config_main_cmd config api-new-branch api-new-branch
00:00:19.982 + declare 'desc=print config vars for app via command line'
00:00:19.982 + local cmd=config
00:00:19.982 + config_all config api-new-branch api-new-branch
00:00:19.982 + declare 'desc=print or export config vars'
00:00:19.982 + [[ config == \c\o\n\f\i\g ]]
00:00:19.983 + config_parse_args config api-new-branch api-new-branch
00:00:19.983 + declare 'desc=parse config plugin args'
00:00:19.983 + unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:19.983 + for var in '"$@"'
00:00:19.983 + [[ config == \-\-\g\l\o\b\a\l ]]
00:00:19.983 + [[ config == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.983 + [[ config == \-\-\e\x\p\o\r\t ]]
00:00:19.983 + [[ config == \-\-\s\h\e\l\l ]]
00:00:19.983 + for var in '"$@"'
00:00:19.983 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:19.983 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.984 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:19.984 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:19.984 + for var in '"$@"'
00:00:19.984 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:19.984 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:19.984 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:19.984 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:19.984 + SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:19.984 ++ get_sanitized_config_args config api-new-branch api-new-branch
00:00:19.984 ++ local 'desc=return sanitized arguments for config plugin'
00:00:19.984 ++ SANITIZED_ARGS=("$@")
00:00:19.984 ++ local SANITIZED_ARGS
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:19.984 ++ echo config api-new-branch api-new-branch
00:00:19.984 + local SANITIZED_ARGS
00:00:19.984 + set -- config api-new-branch api-new-branch
00:00:19.984 + DOKKU_CONFIG_TYPE=app
00:00:19.984 + DOKKU_CONFIG_RESTART=true
00:00:19.984 + [[ app == \a\p\p ]]
00:00:19.984 + [[ -z api-new-branch ]]
00:00:19.984 + verify_app_name api-new-branch
00:00:19.984 + declare 'desc=verify app name format and app existence'
00:00:19.984 + local APP=api-new-branch
00:00:19.984 + [[ ! -n api-new-branch ]]
00:00:19.984 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:19.984 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:19.984 + return 0
00:00:19.984 + APP=api-new-branch
00:00:19.984 + ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:19.984 + export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:19.984 + SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:19.984 ++ get_sanitized_config_args config api-new-branch api-new-branch
00:00:19.984 ++ local 'desc=return sanitized arguments for config plugin'
00:00:19.984 ++ SANITIZED_ARGS=("$@")
00:00:19.984 ++ local SANITIZED_ARGS
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:19.984 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:19.984 ++ echo config api-new-branch api-new-branch
00:00:19.984 + local SANITIZED_ARGS
00:00:19.984 + set -- config api-new-branch api-new-branch
00:00:19.985 + config_create /home/dokku/api-new-branch/ENV
00:00:19.985 + declare 'desc=create config env file'
00:00:19.985 + local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:19.985 + [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:19.985 + [[ -n '' ]]
00:00:19.985 + [[ -n api-new-branch ]]
00:00:19.985 + local DOKKU_CONFIG_TYPE=api-new-branch
00:00:19.985 + [[ ! -s /home/dokku/api-new-branch/ENV ]]
00:00:19.985 ++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/api-new-branch/ENV
00:00:19.985 ++ cut '-d ' -f2-
00:00:19.986 + local 'VARS=BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.986 + [[ -n '' ]]
00:00:19.986 + dokku_log_info2_quiet 'api-new-branch config vars'
00:00:19.986 + declare 'desc=log info2 formatter (with quiet option)'
00:00:19.986 + [[ -z '' ]]
00:00:19.987 + echo '=====> api-new-branch config vars'
00:00:19.987 + config_styled_hash 'BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.987 + declare 'desc=internal config hash'
00:00:19.987 + local 'vars=BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.987 + local prefix=
00:00:19.987 + local longest=
00:00:19.987 + read -r word
00:00:19.987 ++ echo 'BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.987 ++ cut -d= -f1
00:00:19.988 + local KEY=BUILDPACK_URL
00:00:19.988 + [[ 13 -gt 0 ]]
00:00:19.988 + local longest=BUILDPACK_URL
00:00:19.988 + read -r word
00:00:19.988 + read -r word
00:00:19.988 ++ echo 'BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.988 ++ cut -d= -f1
00:00:19.989 + local KEY=BUILDPACK_URL
00:00:19.989 ++ echo 'BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:19.990 ++ cut -d= -f2-
00:00:19.990 ++ sed -e 's/^'\''//' -e 's/'\''$//' -e 's/$$//g'
00:00:19.991 + local VALUE=https://github.com/heroku/heroku-buildpack-ruby.git
00:00:19.991 + local num_zeros=0
00:00:19.991 + local 'zeros= '
00:00:19.992 + [[ 0 -gt 0 ]]
00:00:19.992 + echo 'BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:19.992 + read -r word
00:00:19.992 + implemented=1
00:00:19.992 + [[ 1 -eq 0 ]]
00:00:19.992 + [[ 1 -eq 0 ]]
00:00:19.992 + local 'EXISTING_CONFIG======> api-new-branch config vars
00:00:19.992 BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:19.992 ++ echo '=====> api-new-branch config vars
00:00:19.992 BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:19.993 ++ grep postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:19.993 ++ cut -d: -f1
00:00:19.994 + local LINK=
00:00:19.994 ++ echo '=====> api-new-branch config vars
00:00:19.994 BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-ruby.git'
00:00:19.995 ++ grep DATABASE_URL
00:00:19.995 + local DEFAULT_ALIAS=
00:00:19.996 ++ service_alias api-new-branch
00:00:19.996 ++ local SERVICE=api-new-branch
00:00:19.996 +++ get_service_name api-new-branch
00:00:19.996 +++ local SERVICE=api-new-branch
00:00:19.996 +++ echo dokku.postgres.api-new-branch
00:00:19.996 ++ local SERVICE_NAME=dokku.postgres.api-new-branch
00:00:19.997 ++ echo dokku.postgres.api-new-branch
00:00:19.997 ++ tr ._ -
00:00:19.997 + local SERVICE_ALIAS=dokku-postgres-api-new-branch
00:00:19.997 + local LINKS_FILE=/var/lib/dokku/services/postgres/api-new-branch/LINKS
00:00:19.997 + [[ -n '' ]]
00:00:19.997 + mkdir -p /var/lib/dokku/services/postgres/api-new-branch
00:00:19.998 + touch /var/lib/dokku/services/postgres/api-new-branch/LINKS
00:00:19.999 + echo api-new-branch
00:00:19.999 + sort /var/lib/dokku/services/postgres/api-new-branch/LINKS -u -o /var/lib/dokku/services/postgres/api-new-branch/LINKS
00:00:20.000 + local ALIAS=DATABASE
00:00:20.000 + [[ -n '' ]]
00:00:20.000 + dokku docker-options:add api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.002 + case "$(lsb_release -si)" in
00:00:20.002 ++ lsb_release -si
00:00:20.038 + export DOKKU_DISTRO=ubuntu
00:00:20.038 + DOKKU_DISTRO=ubuntu
00:00:20.038 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.038 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.038 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.038 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.038 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.038 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.038 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.038 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.038 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.038 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.039 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.039 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.039 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.039 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.039 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.039 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.039 + export DOKKU_API_VERSION=1
00:00:20.039 + DOKKU_API_VERSION=1
00:00:20.039 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.039 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.039 + export DOKKU_VALID_EXIT=0
00:00:20.039 + DOKKU_VALID_EXIT=0
00:00:20.039 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.039 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.039 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.039 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.039 + export DOKKU_CONTAINER_LABEL=dokku
00:00:20.039 + DOKKU_CONTAINER_LABEL=dokku
00:00:20.039 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.039 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.039 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.040 ++ set -eo pipefail
00:00:20.040 ++ [[ -n 1 ]]
00:00:20.040 ++ set -x
00:00:20.041 + parse_args docker-options:add api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.041 + declare 'desc=top-level cli arg parser'
00:00:20.041 + local next_index=1
00:00:20.041 + local skip=false
00:00:20.042 + args=("$@")
00:00:20.042 + local args
00:00:20.042 + for arg in '"$@"'
00:00:20.042 + false
00:00:20.042 + case "$arg" in
00:00:20.042 + local next_index=2
00:00:20.042 + for arg in '"$@"'
00:00:20.042 + false
00:00:20.042 + case "$arg" in
00:00:20.042 + local next_index=3
00:00:20.042 + for arg in '"$@"'
00:00:20.042 + false
00:00:20.042 + case "$arg" in
00:00:20.042 + local next_index=4
00:00:20.042 + for arg in '"$@"'
00:00:20.043 + false
00:00:20.043 + case "$arg" in
00:00:20.043 + local next_index=5
00:00:20.043 + return 0
00:00:20.043 + args=("$@")
00:00:20.043 + [[ docker-options:add =~ ^--.* ]]
00:00:20.043 + has_tty
00:00:20.043 + declare 'desc=return 0 if we have a tty'
00:00:20.043 ++ /usr/bin/tty
00:00:20.043 ++ true
00:00:20.043 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:20.043 + return 1
00:00:20.043 + DOKKU_QUIET_OUTPUT=1
00:00:20.044 ++ id -un
00:00:20.044 + [[ dokku != \d\o\k\k\u ]]
00:00:20.045 ++ id -un
00:00:20.046 + [[ dokku != \r\o\o\t ]]
00:00:20.046 + [[ docker-options:add =~ ^plugin:.* ]]
00:00:20.046 + [[ -n '' ]]
00:00:20.046 + dokku_auth docker-options:add api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.046 + declare 'desc=calls user-auth plugin trigger'
00:00:20.046 + export SSH_USER=dokku
00:00:20.046 + SSH_USER=dokku
00:00:20.046 + export SSH_NAME=jenkins
00:00:20.046 + SSH_NAME=jenkins
00:00:20.046 + plugn trigger user-auth dokku jenkins docker-options:add api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.092 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.092 ++ set -eo pipefail
00:00:20.092 ++ [[ -n 1 ]]
00:00:20.092 ++ set -x
00:00:20.095 + [[ ! -n '' ]]
00:00:20.182 + return 0
00:00:20.182 + case "$1" in
00:00:20.182 + execute_dokku_cmd docker-options:add api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.182 + declare 'desc=executes dokku sub-commands'
00:00:20.182 + local PLUGIN_NAME=docker-options:add
00:00:20.182 + local PLUGIN_CMD=docker-options:add
00:00:20.182 + local implemented=0
00:00:20.183 + local script
00:00:20.183 + argv=("$@")
00:00:20.183 + local argv
00:00:20.183 + case "$PLUGIN_NAME" in
00:00:20.183 ++ readlink -f /var/lib/dokku/plugins/enabled/docker-options
00:00:20.183 + [[ /var/lib/dokku/core-plugins/available/docker-options == *core-plugins* ]]
00:00:20.183 + [[ docker-options:add == \d\o\c\k\e\r\-\o\p\t\i\o\n\s\:\a\d\d ]]
00:00:20.183 + shift 1
00:00:20.183 + [[ ! -z api-new-branch ]]
00:00:20.184 + [[ docker-options:add == config* ]]
00:00:20.184 + set -- api-new-branch api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.184 + set -- docker-options:add api-new-branch api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.184 + [[ -x /var/lib/dokku/plugins/enabled/docker-options:add/subcommands/default ]]
00:00:20.184 + [[ -x /var/lib/dokku/plugins/enabled/docker-options:add/subcommands/docker-options:add ]]
00:00:20.184 + [[ -x /var/lib/dokku/plugins/enabled/docker-options/subcommands/add ]]
00:00:20.184 + /var/lib/dokku/plugins/enabled/docker-options/subcommands/add docker-options:add api-new-branch api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.185 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.185 ++ set -eo pipefail
00:00:20.185 ++ [[ -n 1 ]]
00:00:20.186 ++ set -x
00:00:20.188 + source /var/lib/dokku/core-plugins/available/docker-options/functions
00:00:20.188 ++ set -eo pipefail
00:00:20.188 ++ [[ -n 1 ]]
00:00:20.188 ++ set -x
00:00:20.189 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.189 +++ set -eo pipefail
00:00:20.189 +++ [[ -n 1 ]]
00:00:20.189 +++ set -x
00:00:20.191 ++ AVAILABLE_PHASES=(build deploy run)
00:00:20.192 + docker_options_add_cmd docker-options:add api-new-branch api-new-branch build,deploy,run '--link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.192 + declare 'desc=Add a docker option to application'
00:00:20.192 + local cmd=docker-options:add
00:00:20.192 + verify_app_name api-new-branch
00:00:20.192 + declare 'desc=verify app name format and app existence'
00:00:20.192 + local APP=api-new-branch
00:00:20.192 + [[ ! -n api-new-branch ]]
00:00:20.192 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.192 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.192 + return 0
00:00:20.193 + local APP=api-new-branch
00:00:20.193 + read -ra passed_phases
00:00:20.193 ++ get_phases api-new-branch
00:00:20.193 ++ declare 'desc=returns array of passed passes if all are in allowed array'
00:00:20.193 ++ local passed_phases_list=api-new-branch
00:00:20.193 +++ sed -e 's/ /\|/g'
00:00:20.194 ++ local -r 'phases_allowed=build|deploy|run'
00:00:20.194 ++ local phase
00:00:20.194 ++ local passed_phases
00:00:20.194 ++ [[ -n api-new-branch ]]
00:00:20.194 ++ OIFS='  
00:00:20.194 '
00:00:20.194 ++ IFS=,
00:00:20.194 ++ read -ra passed_phases
00:00:20.194 ++ IFS='   
00:00:20.194 '
00:00:20.194 ++ for phase in '"${passed_phases[@]}"'
00:00:20.195 ++ [[ api-new-branch = @(build|deploy|run) ]]
00:00:20.195 ++ dokku_log_fail 'Phase(s) must be one of [build deploy run]'
00:00:20.195 ++ declare 'desc=log fail formatter'
00:00:20.195 ++ echo 'Phase(s) must be one of [build deploy run]'
00:00:20.195 Phase(s) must be one of [build deploy run]
00:00:20.195 ++ exit 1
00:00:20.195 + shift 3
00:00:20.195 + local 'passed_docker_option=build,deploy,run --link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.195 + [[ -z build,deploy,run --link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch ]]
00:00:20.195 + add_passed_docker_option 'passed_phases[@]' 'build,deploy,run --link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.196 + declare 'desc=adds docker option to specified phases'
00:00:20.196 + passed_phases=("${!1}")
00:00:20.196 + local passed_phases
00:00:20.196 + shift
00:00:20.196 + local 'passed_option_string=build,deploy,run --link dokku.postgres.api-new-branch:dokku-postgres-api-new-branch'
00:00:20.196 + local phase
00:00:20.196 + implemented=1
00:00:20.196 + [[ 1 -eq 0 ]]
00:00:20.196 + [[ 1 -eq 0 ]]
00:00:20.196 + dokku config:set api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.197 + case "$(lsb_release -si)" in
00:00:20.197 ++ lsb_release -si
00:00:20.233 + export DOKKU_DISTRO=ubuntu
00:00:20.233 + DOKKU_DISTRO=ubuntu
00:00:20.233 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.233 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.233 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.233 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.234 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.234 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.234 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.234 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.234 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.234 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.234 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.234 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.234 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.234 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.234 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.234 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.234 + export DOKKU_API_VERSION=1
00:00:20.234 + DOKKU_API_VERSION=1
00:00:20.234 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.234 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.234 + export DOKKU_VALID_EXIT=0
00:00:20.234 + DOKKU_VALID_EXIT=0
00:00:20.234 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.234 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.234 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.234 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.234 + export DOKKU_CONTAINER_LABEL=dokku
00:00:20.234 + DOKKU_CONTAINER_LABEL=dokku
00:00:20.235 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.235 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.235 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.235 ++ set -eo pipefail
00:00:20.235 ++ [[ -n 1 ]]
00:00:20.235 ++ set -x
00:00:20.237 + parse_args config:set api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.237 + declare 'desc=top-level cli arg parser'
00:00:20.237 + local next_index=1
00:00:20.237 + local skip=false
00:00:20.237 + args=("$@")
00:00:20.237 + local args
00:00:20.237 + for arg in '"$@"'
00:00:20.237 + false
00:00:20.237 + case "$arg" in
00:00:20.237 + local next_index=2
00:00:20.237 + for arg in '"$@"'
00:00:20.238 + false
00:00:20.238 + case "$arg" in
00:00:20.238 + local next_index=3
00:00:20.238 + for arg in '"$@"'
00:00:20.238 + false
00:00:20.238 + case "$arg" in
00:00:20.238 + local next_index=4
00:00:20.238 + return 0
00:00:20.238 + args=("$@")
00:00:20.238 + [[ config:set =~ ^--.* ]]
00:00:20.238 + has_tty
00:00:20.238 + declare 'desc=return 0 if we have a tty'
00:00:20.239 ++ /usr/bin/tty
00:00:20.239 ++ true
00:00:20.239 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:20.239 + return 1
00:00:20.239 + DOKKU_QUIET_OUTPUT=1
00:00:20.239 ++ id -un
00:00:20.240 + [[ dokku != \d\o\k\k\u ]]
00:00:20.240 ++ id -un
00:00:20.241 + [[ dokku != \r\o\o\t ]]
00:00:20.241 + [[ config:set =~ ^plugin:.* ]]
00:00:20.241 + [[ -n '' ]]
00:00:20.241 + dokku_auth config:set api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.241 + declare 'desc=calls user-auth plugin trigger'
00:00:20.241 + export SSH_USER=dokku
00:00:20.241 + SSH_USER=dokku
00:00:20.242 + export SSH_NAME=jenkins
00:00:20.242 + SSH_NAME=jenkins
00:00:20.242 + plugn trigger user-auth dokku jenkins config:set api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.287 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.287 ++ set -eo pipefail
00:00:20.287 ++ [[ -n 1 ]]
00:00:20.287 ++ set -x
00:00:20.290 + [[ ! -n '' ]]
00:00:20.378 + return 0
00:00:20.378 + case "$1" in
00:00:20.378 + execute_dokku_cmd config:set api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.378 + declare 'desc=executes dokku sub-commands'
00:00:20.378 + local PLUGIN_NAME=config:set
00:00:20.378 + local PLUGIN_CMD=config:set
00:00:20.378 + local implemented=0
00:00:20.378 + local script
00:00:20.378 + argv=("$@")
00:00:20.378 + local argv
00:00:20.378 + case "$PLUGIN_NAME" in
00:00:20.379 ++ readlink -f /var/lib/dokku/plugins/enabled/config
00:00:20.379 + [[ /var/lib/dokku/core-plugins/available/config == *core-plugins* ]]
00:00:20.379 + [[ config:set == \c\o\n\f\i\g\:\s\e\t ]]
00:00:20.379 + shift 1
00:00:20.379 + [[ ! -z api-new-branch ]]
00:00:20.379 + [[ config:set == config* ]]
00:00:20.379 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.379 + set -- api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.379 + set -- config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.379 + [[ -x /var/lib/dokku/plugins/enabled/config:set/subcommands/default ]]
00:00:20.379 + [[ -x /var/lib/dokku/plugins/enabled/config:set/subcommands/config:set ]]
00:00:20.379 + [[ -x /var/lib/dokku/plugins/enabled/config/subcommands/set ]]
00:00:20.380 + /var/lib/dokku/plugins/enabled/config/subcommands/set config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.381 + source /var/lib/dokku/plugins/available/config/functions
00:00:20.381 ++ set -eo pipefail
00:00:20.381 ++ [[ -n 1 ]]
00:00:20.381 ++ set -x
00:00:20.381 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.381 +++ set -eo pipefail
00:00:20.381 +++ [[ -n 1 ]]
00:00:20.381 +++ set -x
00:00:20.385 + config_set_cmd config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.385 + declare 'desc=set specified config vars for app via command line'
00:00:20.385 + local cmd=config:set
00:00:20.385 + config_set config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.385 + declare 'desc=set value of given config var'
00:00:20.385 + [[ config:set == \c\o\n\f\i\g\:\s\e\t ]]
00:00:20.386 + config_parse_args config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.386 + declare 'desc=parse config plugin args'
00:00:20.386 + unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:20.386 + for var in '"$@"'
00:00:20.386 + [[ config:set == \-\-\g\l\o\b\a\l ]]
00:00:20.386 + [[ config:set == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.386 + [[ config:set == \-\-\e\x\p\o\r\t ]]
00:00:20.386 + [[ config:set == \-\-\s\h\e\l\l ]]
00:00:20.386 + for var in '"$@"'
00:00:20.386 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:20.387 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.387 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:20.387 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:20.387 + for var in '"$@"'
00:00:20.387 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:20.387 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.387 + [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:20.387 + [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:20.387 + for var in '"$@"'
00:00:20.387 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\g\l\o\b\a\l ]]
00:00:20.387 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.387 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\e\x\p\o\r\t ]]
00:00:20.387 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\s\h\e\l\l ]]
00:00:20.387 + SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:20.387 ++ get_sanitized_config_args config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.388 ++ local 'desc=return sanitized arguments for config plugin'
00:00:20.388 ++ SANITIZED_ARGS=("$@")
00:00:20.388 ++ local SANITIZED_ARGS
00:00:20.388 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:20.388 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:20.388 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:20.388 ++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:20.388 ++ echo config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.388 + local SANITIZED_ARGS
00:00:20.388 + set -- config:set api-new-branch api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.388 + DOKKU_CONFIG_TYPE=app
00:00:20.388 + DOKKU_CONFIG_RESTART=true
00:00:20.388 + [[ app == \a\p\p ]]
00:00:20.388 + [[ -z api-new-branch ]]
00:00:20.388 + verify_app_name api-new-branch
00:00:20.388 + declare 'desc=verify app name format and app existence'
00:00:20.388 + local APP=api-new-branch
00:00:20.388 + [[ ! -n api-new-branch ]]
00:00:20.388 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.388 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.388 + return 0
00:00:20.388 + APP=api-new-branch
00:00:20.388 + ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:20.388 + export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:20.388 + [[ -z api-new-branch DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch ]]
00:00:20.388 + config_create /home/dokku/api-new-branch/ENV
00:00:20.388 + declare 'desc=create config env file'
00:00:20.388 + local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:20.388 + [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:20.388 + local ENV_ADD=
00:00:20.388 ++ cat /home/dokku/api-new-branch/ENV
00:00:20.388 + local 'ENV_TEMP=export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:20.388 + local RESTART_APP=false
00:00:20.388 + shift 2
00:00:20.388 + for var in '"$@"'
00:00:20.389 + [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:20.389 + [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.389 + [[ -n api-new-branch ]]
00:00:20.389 + [[ api-new-branch == \a\p\i\-\n\e\w\-\b\r\a\n\c\h ]]
00:00:20.389 + shift 1
00:00:20.389 + for var in '"$@"'
00:00:20.389 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\g\l\o\b\a\l ]]
00:00:20.389 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.389 + [[ -n api-new-branch ]]
00:00:20.389 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch == \a\p\i\-\n\e\w\-\b\r\a\n\c\h ]]
00:00:20.389 + [[ DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch != *\=* ]]
00:00:20.390 + for var in '"$@"'
00:00:20.390 ++ echo DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.390 ++ cut -d= -f1
00:00:20.390 + local KEY=DATABASE_URL
00:00:20.390 ++ echo DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.391 ++ cut -d= -f2-
00:00:20.391 + local VALUE=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.391 + [[ DATABASE_URL =~ [a-zA-Z_][a-zA-Z0-9_]* ]]
00:00:20.391 + local RESTART_APP=true
00:00:20.392 ++ echo 'export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:20.392 ++ sed '/^export DATABASE_URL=/ d'
00:00:20.393 + local 'ENV_TEMP=export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\'''
00:00:20.393 + local 'ENV_TEMP=export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\''
00:00:20.393 export DATABASE_URL='\''postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'\'''
00:00:20.393 ++ echo -e ''
00:00:20.394 ++ sed '/^DATABASE_URL=/ d'
00:00:20.395 + local ENV_ADD=
00:00:20.395 + local 'ENV_ADD=$
00:00:20.395 DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'
00:00:20.395 ++ echo '$
00:00:20.395 DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'
00:00:20.395 ++ tail -n +2
00:00:20.396 + local ENV_ADD=DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.396 + [[ -n true ]]
00:00:20.396 + dokku_log_info1 'Setting config vars'
00:00:20.396 + declare 'desc=log info1 formatter'
00:00:20.396 + echo '-----> Setting config vars'
00:00:20.397 -----> Setting config vars
00:00:20.397 + config_styled_hash DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch '       '
00:00:20.397 + declare 'desc=internal config hash'
00:00:20.397 + local vars=DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.397 + local 'prefix=       '
00:00:20.397 + local longest=
00:00:20.397 + read -r word
00:00:20.397 ++ echo DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.397 ++ cut -d= -f1
00:00:20.398 + local KEY=DATABASE_URL
00:00:20.398 + [[ 12 -gt 0 ]]
00:00:20.398 + local longest=DATABASE_URL
00:00:20.398 + read -r word
00:00:20.398 + read -r word
00:00:20.398 ++ echo DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.398 ++ cut -d= -f1
00:00:20.399 + local KEY=DATABASE_URL
00:00:20.400 ++ echo DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.400 ++ sed -e 's/^'\''//' -e 's/'\''$//' -e 's/$$//g'
00:00:20.400 ++ cut -d= -f2-
00:00:20.401 + local VALUE=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.401 + local num_zeros=0
00:00:20.401 + local 'zeros= '
00:00:20.401 + [[ 0 -gt 0 ]]
00:00:20.401        DATABASE_URL: postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.401 + echo '       DATABASE_URL: postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'
00:00:20.401 + read -r word
00:00:20.401 + config_write 'export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\''
00:00:20.401 export DATABASE_URL='\''postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'\'''
00:00:20.401 + declare 'desc=writes config vars out to appropriate file path'
00:00:20.401 + local 'ENV_TEMP=export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\''
00:00:20.401 export DATABASE_URL='\''postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'\'''
00:00:20.401 + local ENV_FILE_TEMP=/home/dokku/api-new-branch/ENV.tmp
00:00:20.401 + echo 'export BUILDPACK_URL='\''https://github.com/heroku/heroku-buildpack-ruby.git'\''
00:00:20.401 + sed '/^$/d'
00:00:20.402 export DATABASE_URL='\''postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch'\'''
00:00:20.402 + sort
00:00:20.403 + cmp -s /home/dokku/api-new-branch/ENV /home/dokku/api-new-branch/ENV.tmp
00:00:20.404 + cp -f /home/dokku/api-new-branch/ENV.tmp /home/dokku/api-new-branch/ENV
00:00:20.405 + chmod 600 /home/dokku/api-new-branch/ENV
00:00:20.405 + rm -f /home/dokku/api-new-branch/ENV.tmp
00:00:20.406 + plugn trigger post-config-update api-new-branch set DATABASE_URL=postgres://postgres:d7a7c814e7127cf1b0ebf89b5663d452@dokku-postgres-api-new-branch:5432/api_new_branch
00:00:20.533 + [[ -n api-new-branch ]]
00:00:20.533 ++ config_get api-new-branch DOKKU_APP_RESTORE
00:00:20.533 ++ declare 'desc=get value of given config var'
00:00:20.533 ++ [[ api-new-branch == \c\o\n\f\i\g\:\g\e\t ]]
00:00:20.533 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.534 ++ config_parse_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.534 ++ declare 'desc=parse config plugin args'
00:00:20.534 ++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:20.534 ++ for var in '"$@"'
00:00:20.534 ++ [[ config:get == \-\-\g\l\o\b\a\l ]]
00:00:20.534 ++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.534 ++ [[ config:get == \-\-\e\x\p\o\r\t ]]
00:00:20.534 ++ [[ config:get == \-\-\s\h\e\l\l ]]
00:00:20.534 ++ for var in '"$@"'
00:00:20.534 ++ [[ api-new-branch == \-\-\g\l\o\b\a\l ]]
00:00:20.534 ++ [[ api-new-branch == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.534 ++ [[ api-new-branch == \-\-\e\x\p\o\r\t ]]
00:00:20.534 ++ [[ api-new-branch == \-\-\s\h\e\l\l ]]
00:00:20.534 ++ for var in '"$@"'
00:00:20.534 ++ [[ DOKKU_APP_RESTORE == \-\-\g\l\o\b\a\l ]]
00:00:20.535 ++ [[ DOKKU_APP_RESTORE == \-\-\n\o\-\r\e\s\t\a\r\t ]]
00:00:20.535 ++ [[ DOKKU_APP_RESTORE == \-\-\e\x\p\o\r\t ]]
00:00:20.535 ++ [[ DOKKU_APP_RESTORE == \-\-\s\h\e\l\l ]]
00:00:20.535 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:20.535 +++ get_sanitized_config_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.535 +++ local 'desc=return sanitized arguments for config plugin'
00:00:20.535 +++ SANITIZED_ARGS=("$@")
00:00:20.535 +++ local SANITIZED_ARGS
00:00:20.535 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:20.535 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:20.535 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:20.535 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:20.535 +++ echo config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.535 ++ local SANITIZED_ARGS
00:00:20.535 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.535 ++ DOKKU_CONFIG_TYPE=app
00:00:20.535 ++ DOKKU_CONFIG_RESTART=true
00:00:20.535 ++ [[ app == \a\p\p ]]
00:00:20.535 ++ [[ -z api-new-branch ]]
00:00:20.535 ++ verify_app_name api-new-branch
00:00:20.535 ++ declare 'desc=verify app name format and app existence'
00:00:20.535 ++ local APP=api-new-branch
00:00:20.535 ++ [[ ! -n api-new-branch ]]
00:00:20.535 ++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.535 ++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.535 ++ return 0
00:00:20.535 ++ APP=api-new-branch
00:00:20.535 ++ ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:20.535 ++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
00:00:20.535 ++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
00:00:20.535 +++ get_sanitized_config_args config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.535 +++ local 'desc=return sanitized arguments for config plugin'
00:00:20.535 +++ SANITIZED_ARGS=("$@")
00:00:20.535 +++ local SANITIZED_ARGS
00:00:20.535 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
00:00:20.536 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
00:00:20.536 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
00:00:20.536 +++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
00:00:20.536 +++ echo config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.536 ++ local SANITIZED_ARGS
00:00:20.536 ++ set -- config:get api-new-branch DOKKU_APP_RESTORE
00:00:20.536 ++ [[ -z api-new-branch ]]
00:00:20.536 ++ config_create /home/dokku/api-new-branch/ENV
00:00:20.536 ++ declare 'desc=create config env file'
00:00:20.536 ++ local ENV_FILE=/home/dokku/api-new-branch/ENV
00:00:20.536 ++ [[ -f /home/dokku/api-new-branch/ENV ]]
00:00:20.536 ++ [[ ! -s /home/dokku/api-new-branch/ENV ]]
00:00:20.536 ++ local KEY=DOKKU_APP_RESTORE
00:00:20.537 ++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/api-new-branch/ENV
00:00:20.537 ++ grep '^export DOKKU_APP_RESTORE='
00:00:20.537 ++ cut -d= -f2-
00:00:20.538 ++ sed -e 's/^'\''//' -e 's/'\''$//'
00:00:20.538 ++ true
00:00:20.539 + local DOKKU_APP_RESTORE=
00:00:20.539 + [[ true == \t\r\u\e ]]
00:00:20.539 + [[ '' != 0 ]]
00:00:20.539 + dokku_log_info1 'Restarting app api-new-branch'
00:00:20.539 -----> Restarting app api-new-branch
00:00:20.539 + declare 'desc=log info1 formatter'
00:00:20.539 + echo '-----> Restarting app api-new-branch'
00:00:20.539 + dokku ps:restart api-new-branch
00:00:20.541 + case "$(lsb_release -si)" in
00:00:20.541 ++ lsb_release -si
00:00:20.576 + export DOKKU_DISTRO=ubuntu
00:00:20.576 + DOKKU_DISTRO=ubuntu
00:00:20.576 + export DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.576 + DOKKU_IMAGE=gliderlabs/herokuish
00:00:20.577 + export DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.577 + DOKKU_LIB_ROOT=/var/lib/dokku
00:00:20.577 + export PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.577 + PLUGIN_PATH=/var/lib/dokku/plugins
00:00:20.577 + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.577 + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
00:00:20.577 + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.577 + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
00:00:20.577 + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.577 + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
00:00:20.577 + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.577 + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
00:00:20.577 + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.577 + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
00:00:20.577 + export DOKKU_API_VERSION=1
00:00:20.577 + DOKKU_API_VERSION=1
00:00:20.577 + export DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.577 + DOKKU_NOT_IMPLEMENTED_EXIT=10
00:00:20.577 + export DOKKU_VALID_EXIT=0
00:00:20.577 + DOKKU_VALID_EXIT=0
00:00:20.577 + export DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.577 + DOKKU_LOGS_DIR=/var/log/dokku
00:00:20.577 + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.577 + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
00:00:20.577 + export DOKKU_CONTAINER_LABEL=dokku
00:00:20.577 + DOKKU_CONTAINER_LABEL=dokku
00:00:20.578 + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.578 + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
00:00:20.578 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.578 ++ set -eo pipefail
00:00:20.578 ++ [[ -n 1 ]]
00:00:20.578 ++ set -x
00:00:20.580 + parse_args ps:restart api-new-branch
00:00:20.580 + declare 'desc=top-level cli arg parser'
00:00:20.580 + local next_index=1
00:00:20.580 + local skip=false
00:00:20.580 + args=("$@")
00:00:20.580 + local args
00:00:20.580 + for arg in '"$@"'
00:00:20.580 + false
00:00:20.580 + case "$arg" in
00:00:20.580 + local next_index=2
00:00:20.580 + for arg in '"$@"'
00:00:20.580 + false
00:00:20.580 + case "$arg" in
00:00:20.580 + local next_index=3
00:00:20.580 + return 0
00:00:20.580 + args=("$@")
00:00:20.580 + [[ ps:restart =~ ^--.* ]]
00:00:20.581 + has_tty
00:00:20.581 + declare 'desc=return 0 if we have a tty'
00:00:20.581 ++ /usr/bin/tty
00:00:20.581 ++ true
00:00:20.581 + [[ not a tty == \n\o\t\ \a\ \t\t\y ]]
00:00:20.581 + return 1
00:00:20.581 + DOKKU_QUIET_OUTPUT=1
00:00:20.582 ++ id -un
00:00:20.583 + [[ dokku != \d\o\k\k\u ]]
00:00:20.583 ++ id -un
00:00:20.584 + [[ dokku != \r\o\o\t ]]
00:00:20.584 + [[ ps:restart =~ ^plugin:.* ]]
00:00:20.584 + [[ -n '' ]]
00:00:20.584 + dokku_auth ps:restart api-new-branch
00:00:20.584 + declare 'desc=calls user-auth plugin trigger'
00:00:20.584 + export SSH_USER=dokku
00:00:20.584 + SSH_USER=dokku
00:00:20.584 + export SSH_NAME=jenkins
00:00:20.584 + SSH_NAME=jenkins
00:00:20.584 + plugn trigger user-auth dokku jenkins ps:restart api-new-branch
00:00:20.627 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.627 ++ set -eo pipefail
00:00:20.627 ++ [[ -n 1 ]]
00:00:20.627 ++ set -x
00:00:20.630 + [[ ! -n '' ]]
00:00:20.717 + return 0
00:00:20.718 + case "$1" in
00:00:20.718 + execute_dokku_cmd ps:restart api-new-branch
00:00:20.718 + declare 'desc=executes dokku sub-commands'
00:00:20.718 + local PLUGIN_NAME=ps:restart
00:00:20.718 + local PLUGIN_CMD=ps:restart
00:00:20.718 + local implemented=0
00:00:20.718 + local script
00:00:20.718 + argv=("$@")
00:00:20.718 + local argv
00:00:20.718 + case "$PLUGIN_NAME" in
00:00:20.718 ++ readlink -f /var/lib/dokku/plugins/enabled/ps
00:00:20.719 + [[ /var/lib/dokku/core-plugins/available/ps == *core-plugins* ]]
00:00:20.719 + [[ ps:restart == \p\s\:\r\e\s\t\a\r\t ]]
00:00:20.719 + shift 1
00:00:20.719 + [[ ! -z api-new-branch ]]
00:00:20.719 + [[ ps:restart == config* ]]
00:00:20.719 + set -- api-new-branch api-new-branch
00:00:20.719 + set -- ps:restart api-new-branch api-new-branch
00:00:20.719 + [[ -x /var/lib/dokku/plugins/enabled/ps:restart/subcommands/default ]]
00:00:20.720 + [[ -x /var/lib/dokku/plugins/enabled/ps:restart/subcommands/ps:restart ]]
00:00:20.720 + [[ -x /var/lib/dokku/plugins/enabled/ps/subcommands/restart ]]
00:00:20.720 + /var/lib/dokku/plugins/enabled/ps/subcommands/restart ps:restart api-new-branch api-new-branch
00:00:20.721 + source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.721 ++ set -eo pipefail
00:00:20.721 ++ [[ -n 1 ]]
00:00:20.721 ++ set -x
00:00:20.724 + source /var/lib/dokku/plugins/available/ps/functions
00:00:20.724 ++ set -eo pipefail
00:00:20.724 ++ [[ -n 1 ]]
00:00:20.724 ++ set -x
00:00:20.724 ++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.724 +++ set -eo pipefail
00:00:20.724 +++ [[ -n 1 ]]
00:00:20.724 +++ set -x
00:00:20.727 ++ source /var/lib/dokku/plugins/available/config/functions
00:00:20.727 +++ set -eo pipefail
00:00:20.727 +++ [[ -n 1 ]]
00:00:20.727 +++ set -x
00:00:20.727 +++ source /var/lib/dokku/core-plugins/available/common/functions
00:00:20.727 ++++ set -eo pipefail
00:00:20.727 ++++ [[ -n 1 ]]
00:00:20.727 ++++ set -x
00:00:20.731 + ps_restart_cmd ps:restart api-new-branch api-new-branch
00:00:20.731 + declare 'desc=restarts app via command line'
00:00:20.731 + local cmd=ps:restart
00:00:20.731 + [[ -z api-new-branch ]]
00:00:20.731 + ps_restart api-new-branch
00:00:20.731 + declare 'desc=restarts app'
00:00:20.731 + local APP=api-new-branch
00:00:20.732 + verify_app_name api-new-branch
00:00:20.732 + declare 'desc=verify app name format and app existence'
00:00:20.732 + local APP=api-new-branch
00:00:20.732 + [[ ! -n api-new-branch ]]
00:00:20.732 + [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.732 + [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.732 + return 0
00:00:20.732 ++ get_running_image_tag api-new-branch
00:00:20.732 ++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'
00:00:20.732 ++ local APP=api-new-branch
00:00:20.732 ++ [[ ! -n api-new-branch ]]
00:00:20.732 ++ verify_app_name api-new-branch
00:00:20.732 ++ declare 'desc=verify app name format and app existence'
00:00:20.732 ++ local APP=api-new-branch
00:00:20.732 ++ [[ ! -n api-new-branch ]]
00:00:20.732 ++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.733 ++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.733 ++ return 0
00:00:20.733 ++ CIDS=($(get_app_container_ids "$APP"))
00:00:20.733 +++ get_app_container_ids api-new-branch
00:00:20.733 +++ declare 'desc=returns list of docker container ids for given app'
00:00:20.733 +++ local APP=api-new-branch
00:00:20.733 +++ local CONTAINER_TYPE=
00:00:20.733 +++ verify_app_name api-new-branch
00:00:20.733 +++ declare 'desc=verify app name format and app existence'
00:00:20.733 +++ local APP=api-new-branch
00:00:20.733 +++ [[ ! -n api-new-branch ]]
00:00:20.733 +++ [[ ! api-new-branch =~ ^[a-z].* ]]
00:00:20.733 +++ [[ ! -d /home/dokku/api-new-branch ]]
00:00:20.733 +++ return 0
00:00:20.733 +++ [[ -f /home/dokku/api-new-branch/CONTAINER ]]
00:00:20.733 +++ [[ -n '' ]]
00:00:20.733 +++ local 'CONTAINER_PATTERN=/home/dokku/api-new-branch/CONTAINER.*'
00:00:20.733 +++ shopt -s nullglob
00:00:20.733 +++ local DOKKU_CID_FILE
00:00:20.733 +++ shopt -u nullglob
00:00:20.733 +++ echo ''
00:00:20.733 ++ local CIDS
00:00:20.734 +++ docker inspect -f '{{ .Config.Image }}'
00:00:20.734 +++ awk -F: '{ print $2 }'
00:00:20.747 +++ echo ''
00:00:20.747 ++ local RUNNING_IMAGE_TAG=
00:00:20.747 ++ echo ''
00:00:20.747 + local IMAGE_TAG=
00:00:20.747 + is_deployed api-new-branch
00:00:20.747 + declare 'desc=return 0 if given app has a running container'
00:00:20.747 + local APP=api-new-branch
00:00:20.748 + [[ -f /home/dokku/api-new-branch/CONTAINER ]]
00:00:20.748 ++ ls '/home/dokku/api-new-branch/CONTAINER.*'
00:00:20.749 ++ echo 2
00:00:20.749 + [[ 2 -eq 0 ]]
00:00:20.749 + return 1
00:00:20.749 + echo 'App api-new-branch has not been deployed'
00:00:20.749 App api-new-branch has not been deployed
00:00:20.749 + implemented=1
00:00:20.749 + [[ 1 -eq 0 ]]
00:00:20.749 + [[ 1 -eq 0 ]]
00:00:20.750 + implemented=1
00:00:20.750 + [[ 1 -eq 0 ]]
00:00:20.750 + [[ 1 -eq 0 ]]
00:00:20.751 + exit_code=0
00:00:20.751 + set -e
00:00:20.751 + [[ 0 -eq 10 ]]
00:00:20.751 + implemented=1
00:00:20.751 + [[ 0 -ne 0 ]]
00:00:20.751 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.751 + set +e
00:00:20.751 + /var/lib/dokku/plugins/enabled/proxy/commands postgres:link api-new-branch api-new-branch
00:00:20.752 + exit_code=10
00:00:20.752 + set -e
00:00:20.752 + [[ 10 -eq 10 ]]
00:00:20.752 + continue
00:00:20.752 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.753 + set +e
00:00:20.753 + /var/lib/dokku/plugins/enabled/ps/commands postgres:link api-new-branch api-new-branch
00:00:20.754 + exit_code=10
00:00:20.754 + set -e
00:00:20.754 + [[ 10 -eq 10 ]]
00:00:20.754 + continue
00:00:20.754 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.754 + set +e
00:00:20.754 + /var/lib/dokku/plugins/enabled/redis/commands postgres:link api-new-branch api-new-branch
00:00:20.757 + exit_code=10
00:00:20.757 + set -e
00:00:20.757 + [[ 10 -eq 10 ]]
00:00:20.757 + continue
00:00:20.757 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.757 + set +e
00:00:20.757 + /var/lib/dokku/plugins/enabled/shell/commands postgres:link api-new-branch api-new-branch
00:00:20.759 + exit_code=10
00:00:20.759 + set -e
00:00:20.759 + [[ 10 -eq 10 ]]
00:00:20.759 + continue
00:00:20.759 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.759 + set +e
00:00:20.759 + /var/lib/dokku/plugins/enabled/storage/commands postgres:link api-new-branch api-new-branch
00:00:20.760 + exit_code=10
00:00:20.760 + set -e
00:00:20.760 + [[ 10 -eq 10 ]]
00:00:20.760 + continue
00:00:20.760 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.760 + set +e
00:00:20.760 + /var/lib/dokku/plugins/enabled/tags/commands postgres:link api-new-branch api-new-branch
00:00:20.770 + exit_code=10
00:00:20.770 + set -e
00:00:20.770 + [[ 10 -eq 10 ]]
00:00:20.770 + continue
00:00:20.770 + for script in '$PLUGIN_ENABLED_PATH/*/commands'
00:00:20.770 + set +e
00:00:20.770 + /var/lib/dokku/plugins/enabled/tar/commands postgres:link api-new-branch api-new-branch
00:00:20.770 + exit_code=10
00:00:20.770 + set -e
00:00:20.770 + [[ 10 -eq 10 ]]
00:00:20.770 + continue
00:00:20.770 + [[ 1 -eq 0 ]]
00:00:20.770 + set +f
00:00:20.770 + exit 0

Digital Ocean Block Storage & Dokku postgres

Hello,
as you might have seen, Digital Ocean introduced block storage, which is very valuable for people who have huge storage needs.
I was wondering how I could possibly implement block storage in an already running Dokku configuration ?
As block storage acts as a casual attached volume, my question is more : can I transfer a dokku-postgres DB to another volume ? What would be the steps to take in order to achieve this, assuming it's possible ?
I saw Dokku's persistent storage plugin, and was wondering whether this would be the way to go..

Thank you for your help.

Import .sql file

Is there a way to import .sql files?

Right now, it throws this error:

pg_restore: [archiver] input file does not appear to be a valid archive

Raising work_mem in Dokku Postgres ?

Hello everybody,
is editing the postgresql.conf file in /var/lib/dokku/services/postgres/appName/data the proper way of raising work_mem ?
I noticed there was a postgresql.auto.conf file in the same directory. However the latest is auto generated.

Thank you for your help.

S.

Scheduled backups create crontabs with invalid syntax

I have created a schedule using the following command:

dokku postgres:backup-schedule myapp "0 4 * * *" myapp-dokku-postgresql-backup

It has created a file /etc/cron.d/dokku-postgres-myapp with the following contents:

0 dokku /usr/bin/dokku postgres:backup myapp 4

Which has obviously invalid syntax.

postgres service name and database.yml file

The database.yml file of my Ruby on Rails application contains the following record:

production:
  <<: *default
  database: derp_app_production

Should the name of the postgres service linked to my application at Dokku match the database name in database.yml, so that I am expected to create the service with the following command:

dokku postgres:create derp_app_production

Or is it possible to use a different name without raising conflicts?

dokku postgres:create derp

Rails 4 + Dokku - URI::InvalidURIError (DATABASE_URL config incorrect)

Ubuntu 14.04
Rails 4 (4.2.4)
Dokku 0.4.9
Docker 1.9.1
Dokku-postgres latest (master)

When creating and then attempting to link a new database I'm getting the following error:
the scheme postgres does not accept registry part: root:password@: (or bad hostname?) (URI::InvalidURIError)

The resulting app config DATABASE_URL looks malformed:
postgres://root:password@:/db

While the app config DOKKU_POSTGRES_..._URL looks correct:
postgres://postgres:[...]@dokku-postgres-api:5432/api

In fact, changing the DATABASE_URL to use the generated DOKKU_POSTGRES_..._URL seems to work.

Was there a recent change maybe that broke this? What else can I provide that may help iron this out?

Thanks for the awesome plugin!

Cannot dump database through SSH

We are having problems importing the custom format dump using pg_restore on other machines - Segmentation fault (core dumped)

I think the default should be plain sql (this is also what pg_dump does by default) and maybe somehting like dokku postgres:export <app> -Fc could dump in the custom format.

WDYT?

Our current workaround is ssh root@<host> "docker exec dokku.postgres.<app> env PGPASSWORD=<pw> pg_dump --no-acl --no-owner -h localhost -U postgres -w <app>"

Rewritten link command generates invalid host

Hey,

It looks like the revamped link commands that were introduced in 6304729 are not functioning correctly. The host name that is generated for DATABASE_URL does not appear to be able to be resolved. This causes deploys to fail. Rolling back to the prior implementations resolves the issue (as that seems to inject the IP address vs a hostname).

Postgres image postgres:9.5.0 not found

I might be missing something, but I updated dokku and the the plugin (through dokku plugin:update postgres) but can't upgrade the database to 9.5.0 or create a new Postgres service for that matter getting this error:

~# dokku postgres:create db
Postgres image postgres:9.5.0 not found

Is there anything else I need to do to pull in the latest version of PG?

Error creating a new instance, unkown -p command

My Versions:

  • Docker version 1.11.0, build 4dc5990
  • Dokku 0.5.7
  • postgres 1.0.0

Running dokku postgres:create blog will result in docker: Error response from daemon: Container command '-p' not found or does not exist..

Trace Output:

+ local SERVICE=blog
+ local SERVICE_ROOT=/var/lib/dokku/services/postgres/blog
++ get_service_name blog
++ declare 'desc=Retrieves a docker service label'
++ declare SERVICE=blog
++ echo dokku.postgres.blog
+ local SERVICE_NAME=dokku.postgres.blog
++ cat /var/lib/dokku/services/postgres/blog/PASSWORD
+ local PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXX
+ local PREVIOUS_ID
++ docker run --name dokku.postgres.blog -v /var/lib/dokku/services/postgres/blog/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXX --env-file=/var/lib/dokku/services/postgres/blog/ENV -d --restart always --label dokku=service --label dokku.service=postgres postgres:9.5.4
+ ID=XXXXXXXXXXXXXXXXXXXXXXXXX
+ echo XXXXXXXXXXXXXXXXXXXXXXXXX
+ 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.blog:postgres dokkupaas/wait -p 5432
docker: Error response from daemon: Container command '-p' not found or does not exist..

Had a look at the history, seems like 031f5e4 is causing it. Could you try to reproduce this?

Backups leave temporary files

I have found out that scheduled backups tend to leave temporary files which may easily lead to filling up the whole filesystem.

Not sure if this is an issue just with scheduled backups or any backups.

# ls /tmp/tmp.*
drwx------  2 dokku dokku 4096 Jan 23 04:00 tmp.dbP7PzU1px
drwx------  2 dokku dokku 4096 Jan 22 04:00 tmp.URRsVuboWk
drwx------  2 dokku dokku 4096 Jan 21 04:00 tmp.wSufOsiTbZ
drwx------  2 dokku dokku 4096 Jan 20 04:00 tmp.XJ5MWmbuID
# ls /tmp/tmp.XJ5MWmbuID/
export
# file /tmp/tmp.XJ5MWmbuID/export
/tmp/tmp.XJ5MWmbuID/export: PostgreSQL custom database dump - v1.12-0

S3 bucket backup wrong region

Hi,

I cannot setup the backup auth because it's not a us-east-1 bucket

here is the error message : gof3r error: 400: "The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1'"

I think maybe it would be good to add the config region in the plugin
thanks in advance

dokku postgres:export [db_name] > dump.sql (CLI) loop in local

with dokku cli postgres:import command seems to work but its loop over dump file writing, the same issue with direct output too.
ex : @local_machine# dokku postgres:export [db_name] | pg_restore -U postgres -d [local_db_name]

Is there any otherway to synchronize distant postgres DB with local postgres via CLI ?

How to refresh a materialized view in a cron job ?

I looked for a way to achieve this, and found two solutions : either make a script that you run in cron, or simply run a psql command there.
I leaned towards the second solution, because easier to maintain, but couldn't find the proper command to do it.
You can dokku postgres:connect and type in psql commands, but is there a way to directly enter the command as args ?
I am looking for something like this :
dokku postgres:connect myDb -c "refresh materialized view myView"

Thank you for your help.

Edit : From this link It seems that this is not possible to achieve this atm.
Is any workaround even possible ? I would have to launch the docker command myself right ?

Exposing detailed variables

Using this for a dropwizard-application requires to split up the variables into one for username, one for password and one for url. I forked another postgres-plugin to support this: https://github.com/andersem/dokku-pg-plugin, but I thought it would be better to use the official one.

This is how I split the variables in my fork. Is this doable in this plugin?

DATABASE_URL=postgres://root:[email protected]:49187/db
DATABASE_HOST=172.17.42.1
DATABASE_PORT=49187
DATABASE_USER=root
DATABASE_PASSWORD=RDSBYlUrOYMtndKb

Can't create after destroying same <name>

$ sudo dokku postgres:destroy gitlab
 !    WARNING: Potentially Destructive Action
 !    This command will destroy gitlab Postgres service.
 !    To proceed, type "gitlab"

> gitlab
-----> Deleting gitlab
       No container exists for gitlab
       Removing data
=====> Postgres container deleted: gitlab
$ sudo dokku postgres:create gitlab
-----> Starting container
Error response from daemon: Conflict. The name "dokku.postgres.gitlab" is already in use by container 9bcf4fe90412. You have to delete (or rename) that container to be able to reuse that name.

Can't destroy a service

So I was trying to move to Postgres 9.5 as per instruction. What I want to do now is to destroy the old service and rename the new one back to the name the old one had. But even though the service is stopped and unlinked I can't fully destroy it.

root@xxx:~# dokku postgres:destroy app
 !     WARNING: Potentially Destructive Action
 !     This command will destroy app Postgres service.
 !     To proceed, type "app"

> app
-----> Deleting app
-----> Stopping container
Error response from daemon: no such id: dokku.postgres.app
Error: failed to stop containers: [dokku.postgres.app]

This is probably related:

root@chattermill:~# dokku postgres:list
Error: No such image or container: dokku.postgres.app
Error: No such image or container: d53ff2c50a7b2e4663501aa4e29dd052a0384a170af52d6a139180cd4363f210
Error: No such image or container: d53ff2c50a7b2e4663501aa4e29dd052a0384a170af52d6a139180cd4363f210
Error: No such image or container: d53ff2c50a7b2e4663501aa4e29dd052a0384a170af52d6a139180cd4363f210
Error: No such image or container: d53ff2c50a7b2e4663501aa4e29dd052a0384a170af52d6a139180cd4363f210
Error: No such image or container: d53ff2c50a7b2e4663501aa4e29dd052a0384a170af52d6a139180cd4363f210
NAME     VERSION       STATUS   EXPOSED PORTS  LINKS
app      stopped       -        -
app_9_5  postgres:9.5  running  5432->5432     app

Could be related to the previous issue I had in #43

Failing when attempting to backup to s3

I just upgraded dokku / postgres and now when I do dokku postgres:backup app bucket
an error occurs (I'm region eu-west-1):

github.com/rlmcpherson/s3gof3r.(*S3).Region(0xc820014440, 0x0, 0x0)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/s3gof3r.go:39 +0x1ce
github.com/rlmcpherson/s3gof3r.(*Bucket).Sign(0xc82000e840, 0xc8200b0000)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/sign.go:56 +0x164
github.com/rlmcpherson/s3gof3r.(*putter).retryRequest(0xc820000d80, 0x7fca00, 0x4, 0xc8200ae000, 0xb1, 0x0, 0x0, 0xc820017d10, 0x0, 0x0, ...)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/putter.go:382 +0x37e
github.com/rlmcpherson/s3gof3r.newPutter(0x7fe8d8, 0x5, 0x0, 0x0, 0x0, 0xc82000a600, 0x75, 0xc820017d70, 0x2c, 0x0, ...)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/putter.go:88 +0x349
github.com/rlmcpherson/s3gof3r.(*Bucket).PutWriter(0xc82003b9e0, 0x7ffeec8e3e15, 0x2b, 0xc820017d10, 0xc82003ba90, 0x0, 0x0, 0x0, 0x0)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/s3gof3r.go:135 +0x126
main.(*putOpts).Execute(0x9d5a00, 0xc820045b20, 0x0, 0x7, 0x7fdac0b06590, 0xc820017d40)
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/gof3r/put.go:53 +0x65f
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc820010500, 0xc82000a090, 0x7, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/rm/src/github.com/jessevdk/go-flags/parser.go:301 +0xa16
github.com/jessevdk/go-flags.(*Parser).Parse(0xc820010500, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/rm/src/github.com/jessevdk/go-flags/parser.go:175 +0x9b
main.main()
	/Users/rm/src/github.com/rlmcpherson/s3gof3r/gof3r/main.go:61 +0x191
/bin/tar: -: Wrote only 6144 of 10240 bytes
/bin/tar: Child returned status 141
/bin/tar: Error is not recoverable: exiting now

Installed - but not working

hi,

i'm trying to get this set up so I can use postgres, however after following the instructions for install I can't create a container:

[root@server /]# dokku postgres:create blahblah
2017/08/22 11:07:58 open /var/lib/dokku/plugins/available/postgres/plugin.toml: permission denied
 !     `postgres:create blahblah` is not a dokku command.
 !     See `dokku help` for a list of available commands.

looks like a permissions problem, but I don't want to start messing with anything.. should this not work out of the box? (permissions for everything in the postgres folder are root:root)

Any ideas?

update - thought maybe it was because I was installing the plugin as root - so removed everything and tried to install as user dokku:

 sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres

Sorry, user dokku is not allowed to execute '/bin/dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres' as root on server

set database connection pool in URL

Rails allows the DATABASE_URL to look like

postgresql://localhost/blog_development?pool=5

I don't see any query string params able to be appended to the DATABASE_URL when linking.

service_url() {

Is there a way to set the database_pool in the DATABASE_URL at the moment?

Deleted

Sry. Can't find how to delete issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.