dokku / dokku-postgres

a postgres plugin for dokku
MIT License
484 stars 97 forks source link

Entry missing in /etc/hosts #75

Closed GabKlein closed 8 years ago

GabKlein commented 8 years ago

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
GabKlein commented 8 years ago

It seems to be related to this commit: https://github.com/dokku/dokku/commit/4204d210c1e78bae2280e1b76858cdbccba64df1 When I use an older version of the client or directly ssh dokku@<dokku host name> <command> it works.

josegonzalez commented 8 years ago

@GabKlein We've since fixed this issue in https://github.com/dokku/dokku-postgres/commit/6090fa6aa6b2e7e097987dd7f3b4f73895451c6f and https://github.com/dokku/dokku-postgres/commit/1ee3f67349355e05876cdad3bfceee34bb369616, can you try latest master and see if it works with the latest client, assuming you're on a recent version of dokku?

dulacp commented 7 years ago

Still having this issue with the v0.8.0 release. Even though, the address is resolving when I do ssh dokku@<dokku host name> <command>, as @GabKlein pointed out

josegonzalez commented 7 years ago

@dulaccc you need to update your dokku plugin as well. I've verified that this works fine on my end.

dulacp commented 7 years ago

I think I do have the latest version of the plugin, installed with :

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

I will investigate on my side too

josegonzalez commented 7 years ago

Please open a new issue with the same information as @GabKlein reported.