Skip to content

Instantly share code, notes, and snippets.

@aboutlo
Created May 6, 2016 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboutlo/34aba2434da07615bec859de35099aa3 to your computer and use it in GitHub Desktop.
Save aboutlo/34aba2434da07615bec859de35099aa3 to your computer and use it in GitHub Desktop.
simple-example dokku deploy
root@dokku:~# dokku tags:deploy simple-example
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args tags:deploy simple-example
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=3
+ return 0
+ args=("$@")
+ [[ tags:deploy =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/4 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ root != \d\o\k\k\u ]]
+ [[ ! tags:deploy =~ plugin:* ]]
++ id -un
+ export SSH_USER=root
+ SSH_USER=root
+ sudo -u dokku -E -H /usr/local/bin/dokku tags:deploy simple-example
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args tags:deploy simple-example
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=3
+ return 0
+ args=("$@")
+ [[ tags:deploy =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/4 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
++ id -un
+ [[ dokku != \r\o\o\t ]]
+ [[ tags:deploy =~ ^plugin:.* ]]
+ [[ -n '' ]]
+ dokku_auth tags:deploy simple-example
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
+ plugn trigger user-auth root default tags:deploy simple-example
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd tags:deploy simple-example
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=tags:deploy
+ local PLUGIN_CMD=tags:deploy
+ local implemented=0
+ local script
+ argv=("$@")
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/tags
+ [[ /var/lib/dokku/core-plugins/available/tags == *core-plugins* ]]
+ [[ tags:deploy == \t\a\g\s\:\d\e\p\l\o\y ]]
+ shift 1
+ [[ ! -z '' ]]
+ set -- tags:deploy simple-example
+ [[ -x /var/lib/dokku/plugins/enabled/tags:deploy/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/tags:deploy/subcommands/tags:deploy ]]
+ [[ -x /var/lib/dokku/plugins/enabled/tags/subcommands/deploy ]]
+ /var/lib/dokku/plugins/enabled/tags/subcommands/deploy tags:deploy simple-example
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/tags/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ tags_deploy_cmd tags:deploy simple-example
+ declare 'desc=deploys an app with a given tagged image via command line'
+ local cmd=tags:deploy
+ [[ -z simple-example ]]
+ local APP=simple-example
+ local IMAGE_TAG=
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ release_and_deploy simple-example ''
+ declare 'desc=main function for releasing and deploying an app'
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ local APP=simple-example
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ verify_image dokku/simple-example:latest
+ declare 'desc=verify image existence'
+ local IMAGE=dokku/simple-example:latest
+ docker inspect dokku/simple-example:latest
+ return 0
+ is_image_herokuish_based dokku/simple-example:latest
+ declare 'desc=returns true if app image is based on herokuish'
+ [[ ! -f /home/ubuntu/.circlerc ]]
+ local DOCKER_ARGS=--rm
+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/simple-example:latest -c 'test -f /exec'
+ local IMAGE_SOURCE_TYPE=dockerfile
++ config_get simple-example DOKKU_SKIP_DEPLOY
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_SKIP_DEPLOY
++ config_parse_args config:get simple-example DOKKU_SKIP_DEPLOY
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_SKIP_DEPLOY == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_SKIP_DEPLOY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_SKIP_DEPLOY
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_SKIP_DEPLOY
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_SKIP_DEPLOY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_SKIP_DEPLOY
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_SKIP_DEPLOY
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_SKIP_DEPLOY
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_SKIP_DEPLOY='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ true
+ local DOKKU_APP_SKIP_DEPLOY=
++ config_get --global DOKKU_SKIP_DEPLOY
++ declare 'desc=get value of given config var'
++ [[ --global == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get --global DOKKU_SKIP_DEPLOY
++ config_parse_args config:get --global DOKKU_SKIP_DEPLOY
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ --global == \-\-\g\l\o\b\a\l ]]
++ ENV_FILE=/home/dokku/ENV
++ DOKKU_CONFIG_TYPE=global
++ DOKKU_CONFIG_RESTART=false
++ [[ --global == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ --global == \-\-\e\x\p\o\r\t ]]
++ [[ --global == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_SKIP_DEPLOY == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_SKIP_DEPLOY == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get --global DOKKU_SKIP_DEPLOY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get '' DOKKU_SKIP_DEPLOY
++ local SANITIZED_ARGS
++ set -- config:get DOKKU_SKIP_DEPLOY
++ DOKKU_CONFIG_TYPE=global
++ DOKKU_CONFIG_RESTART=false
++ [[ global == \a\p\p ]]
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get --global DOKKU_SKIP_DEPLOY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get '' DOKKU_SKIP_DEPLOY
++ local SANITIZED_ARGS
++ set -- config:get DOKKU_SKIP_DEPLOY
++ [[ -z DOKKU_SKIP_DEPLOY ]]
++ config_create /home/dokku/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/ENV
++ [[ -f /home/dokku/ENV ]]
++ [[ ! -s /home/dokku/ENV ]]
++ return 0
+ local DOKKU_GLOBAL_SKIP_DEPLOY=
+ local DOKKU_SKIP_DEPLOY=
+ dokku_log_info1 'Releasing simple-example (dokku/simple-example:latest)...'
+ declare 'desc=log info1 formatter'
+ echo '-----> Releasing simple-example (dokku/simple-example:latest)...'
-----> Releasing simple-example (dokku/simple-example:latest)...
+ dokku release simple-example dockerfile ''
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args release simple-example dockerfile ''
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=3
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=4
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=5
+ return 0
+ args=("$@")
+ [[ release =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/4 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
++ id -un
+ [[ dokku != \r\o\o\t ]]
+ [[ release =~ ^plugin:.* ]]
+ [[ -n '' ]]
+ dokku_auth release simple-example dockerfile ''
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
+ plugn trigger user-auth root default release simple-example dockerfile ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd release simple-example dockerfile ''
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=release
+ local PLUGIN_CMD=release
+ local implemented=0
+ local script
+ argv=("$@")
+ local argv
+ case "$PLUGIN_NAME" in
+ local PLUGIN_NAME=00_dokku-standard
++ readlink -f /var/lib/dokku/plugins/enabled/00_dokku-standard
+ [[ /var/lib/dokku/core-plugins/available/00_dokku-standard == *core-plugins* ]]
+ [[ release == \r\e\l\e\a\s\e ]]
+ shift 1
+ [[ ! -z '' ]]
+ set -- release simple-example dockerfile ''
+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/release ]]
+ /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/release release simple-example dockerfile ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ dokku_release_cmd release simple-example dockerfile ''
+ declare 'desc=release phase'
+ local cmd=release
+ local APP=simple-example
+ local IMAGE_SOURCE_TYPE=dockerfile
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ case "$IMAGE_SOURCE_TYPE" in
+ plugn trigger pre-release-dockerfile simple-example ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ plugn trigger post-release-dockerfile simple-example ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]
+ [[ '' != \t\r\u\e ]]
+ dokku_log_info1 'Deploying simple-example (dokku/simple-example:latest)...'
+ declare 'desc=log info1 formatter'
+ echo '-----> Deploying simple-example (dokku/simple-example:latest)...'
-----> Deploying simple-example (dokku/simple-example:latest)...
+ dokku deploy simple-example ''
+ case "$(lsb_release -si)" in
++ lsb_release -si
+ export DOKKU_DISTRO=ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args deploy simple-example ''
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=2
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=3
+ for arg in '"$@"'
+ false
+ case "$arg" in
+ local next_index=4
+ return 0
+ args=("$@")
+ [[ deploy =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/4 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
++ id -un
+ [[ dokku != \r\o\o\t ]]
+ [[ deploy =~ ^plugin:.* ]]
+ [[ -n '' ]]
+ dokku_auth deploy simple-example ''
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
+ plugn trigger user-auth root default deploy simple-example ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd deploy simple-example ''
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=deploy
+ local PLUGIN_CMD=deploy
+ local implemented=0
+ local script
+ argv=("$@")
+ local argv
+ case "$PLUGIN_NAME" in
+ local PLUGIN_NAME=00_dokku-standard
++ readlink -f /var/lib/dokku/plugins/enabled/00_dokku-standard
+ [[ /var/lib/dokku/core-plugins/available/00_dokku-standard == *core-plugins* ]]
+ [[ deploy == \d\e\p\l\o\y ]]
+ shift 1
+ [[ ! -z '' ]]
+ set -- deploy simple-example ''
+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/deploy ]]
+ /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/deploy deploy simple-example ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/checks/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ source /var/lib/dokku/core-plugins/available/proxy/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ dokku_deploy_cmd deploy simple-example ''
+ declare 'desc=deploy phase'
+ local cmd=deploy
+ [[ -z simple-example ]]
+ local APP=simple-example
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ plugn trigger pre-deploy simple-example ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ exec_app_json_scripts simple-example ''
+ declare 'desc=core app.json scripts execution'
+ local 'trigger=/var/lib/dokku/plugins/enabled/00_dokku-standard/pre-deploy app_json_scripts'
+ local APP=simple-example
+ case "$0" in
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local PHASE_SCRIPT_KEY=predeploy
+ dokku_log_info1 'Attempting to run scripts.dokku.predeploy from app.json (if defined)'
+ declare 'desc=log info1 formatter'
+ echo '-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)'
-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)
+ execute_script simple-example dokku/simple-example:latest predeploy
+ declare 'desc=executes appropriate phase script key from app.json'
+ local APP=simple-example
+ local IMAGE=dokku/simple-example:latest
+ local PHASE_SCRIPT_KEY=predeploy
++ get_phase_script dokku/simple-example:latest predeploy
+ local SCRIPT_CMD=
+ [[ -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/ps/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ ps_pre_deploy simple-example ''
+ declare 'desc=ps pre-deploy plugin trigger'
+ local trigger=ps_pre_deploy
+ local APP=simple-example
+ extract_procfile simple-example
+ declare 'desc=extracts procfile from app image'
+ local APP=simple-example
++ get_running_image_tag simple-example
++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ CIDS=($(get_app_container_ids "$APP"))
+++ get_app_container_ids simple-example
+++ declare 'desc=returns list of docker container ids for given app'
+++ local APP=simple-example
+++ local CONTAINER_TYPE=
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ [[ -f /home/dokku/simple-example/CONTAINER ]]
+++ [[ -n '' ]]
+++ local 'CONTAINER_PATTERN=/home/dokku/simple-example/CONTAINER.*'
+++ shopt -s nullglob
+++ local DOKKU_CID_FILE
+++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'
+++ local 'DOKKU_CIDS+= '
+++ local DOKKU_CIDS+=4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77
+++ local 'DOKKU_CIDS+= '
+++ shopt -u nullglob
+++ echo ' 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77 '
++ local CIDS
+++ awk -F: '{ print $2 }'
+++ docker inspect -f '{{ .Config.Image }}' 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77
++ local RUNNING_IMAGE_TAG=latest
++ echo latest
+ local IMAGE_TAG=latest
++ get_app_image_name simple-example latest
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=latest
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n latest ]]
++ local IMAGE=dokku/simple-example:latest
++ verify_image dokku/simple-example:latest
++ declare 'desc=verify image existence'
++ local IMAGE=dokku/simple-example:latest
++ docker inspect dokku/simple-example:latest
++ return 0
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local DOKKU_PROCFILE=/home/dokku/simple-example/DOKKU_PROCFILE
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ copy_from_image dokku/simple-example:latest Procfile /home/dokku/simple-example/DOKKU_PROCFILE
+ [[ -f /home/dokku/simple-example/DOKKU_PROCFILE ]]
+ dokku_log_info1_quiet 'No Procfile found in app image'
+ declare 'desc=log info1 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '-----> No Procfile found in app image'
-----> No Procfile found in app image
+ generate_scale_file simple-example
+ declare 'desc=generates DOKKU_SCALE file'
+ local APP=simple-example
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local DOKKU_SCALE_FILE=/home/dokku/simple-example/DOKKU_SCALE
+ local DOKKU_PROCFILE=/home/dokku/simple-example/DOKKU_PROCFILE
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ copy_from_image dokku/simple-example:latest /app/DOKKU_SCALE /home/dokku/simple-example
+ [[ ! -f /home/dokku/simple-example/DOKKU_SCALE ]]
+ dokku_log_info1_quiet 'DOKKU_SCALE file found (/home/dokku/simple-example/DOKKU_SCALE)'
+ declare 'desc=log info1 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '-----> DOKKU_SCALE file found (/home/dokku/simple-example/DOKKU_SCALE)'
-----> DOKKU_SCALE file found (/home/dokku/simple-example/DOKKU_SCALE)
+ print_dokku_scale_file simple-example
+ declare 'desc=prints contents of DOKKU_SCALE file'
+ local APP=simple-example
+ local DOKKU_SCALE_FILE=/home/dokku/simple-example/DOKKU_SCALE
+ read -r line
+ dokku_log_info2_quiet web=1
+ declare 'desc=log info2 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '=====> web=1'
=====> web=1
+ read -r line
+ [[ -n '' ]]
+ is_image_herokuish_based dokku/simple-example:latest
+ declare 'desc=returns true if app image is based on herokuish'
+ [[ ! -f /home/ubuntu/.circlerc ]]
+ local DOCKER_ARGS=--rm
+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/simple-example:latest -c 'test -f /exec'
+ local DOKKU_SCALE_FILE=/home/dokku/simple-example/DOKKU_SCALE
++ get_app_container_ids simple-example
++ declare 'desc=returns list of docker container ids for given app'
++ local APP=simple-example
++ local CONTAINER_TYPE=
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ [[ -f /home/dokku/simple-example/CONTAINER ]]
++ [[ -n '' ]]
++ local 'CONTAINER_PATTERN=/home/dokku/simple-example/CONTAINER.*'
++ shopt -s nullglob
++ local DOKKU_CID_FILE
++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'
++ local 'DOKKU_CIDS+= '
++ local DOKKU_CIDS+=4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77
++ local 'DOKKU_CIDS+= '
++ shopt -u nullglob
++ echo ' 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77 '
+ local 'oldids= 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77 '
++ plugn trigger docker-args-deploy simple-example ''
++ :
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ config_docker_args simple-example ''
+ declare 'desc=config docker-args plugin trigger'
+ local 'trigger=/var/lib/dokku/plugins/enabled/config/docker-args-deploy config_docker_args'
++ cat
+ local STDIN=
+ local APP=simple-example
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local DOCKERFILE_ENV_FILE=/home/dokku/simple-example/DOCKERFILE_ENV_FILE
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ is_image_herokuish_based dokku/simple-example:latest
+ declare 'desc=returns true if app image is based on herokuish'
+ [[ ! -f /home/ubuntu/.circlerc ]]
+ local DOCKER_ARGS=--rm
+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/simple-example:latest -c 'test -f /exec'
+ sed -e 's:^export ::g' -e 's:='\'':=:g' -e 's:'\''$::g'
+ config_export global
+ declare 'desc=returns export command for config variable of specified type (app/global)'
+ local CONFIG_TYPE=global
+ local APP=
+ local ENV_FILE=/home/dokku//ENV
+ [[ global == \g\l\o\b\a\l ]]
+ local ENV_FILE=/home/dokku/ENV
+ [[ ! -f /home/dokku/ENV ]]
+ [[ ! -s /home/dokku/ENV ]]
+ return 0
+ sed -e 's:^export ::g' -e 's:='\'':=:g' -e 's:'\''$::g'
+ config_export app simple-example
+ declare 'desc=returns export command for config variable of specified type (app/global)'
+ local CONFIG_TYPE=app
+ local APP=simple-example
+ local ENV_FILE=/home/dokku/simple-example/ENV
+ [[ app == \g\l\o\b\a\l ]]
+ [[ ! -f /home/dokku/simple-example/ENV ]]
+ [[ ! -s /home/dokku/simple-example/ENV ]]
++ cut '-d ' -f2-
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local 'VARS=DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
+ awk '{print "export " $0}'
+ echo 'DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
+ return 0
+ echo -n ' --env-file=/home/dokku/simple-example/DOCKERFILE_ENV_FILE'
+ docker_args simple-example ''
+ declare 'desc=docker args plugin trigger'
+ local trigger=/var/lib/dokku/plugins/enabled/docker-options/docker-args-deploy
++ cat
+ local STDIN=
+ local APP=simple-example
+ local IMAGE_SOURCE_TYPE=
+ case "$0" in
+ local PHASE=DEPLOY
+ local FILE_PREFIX=DOCKER_OPTIONS_
+ local PHASE_FILE_PATH=/home/dokku/simple-example/DOCKER_OPTIONS_DEPLOY
+ local output=
+ [[ -f /home/dokku/simple-example/DOCKER_OPTIONS_DEPLOY ]]
+ echo -n ''
+ local 'DOKKU_DEFAULT_DOCKER_ARGS= --env-file=/home/dokku/simple-example/DOCKERFILE_ENV_FILE'
++ is_app_proxy_enabled simple-example
++ declare 'desc=return true if proxy is enabled; otherwise return false'
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ local APP_PROXY_ENABLED=true
+++ config_get simple-example DOKKU_DISABLE_PROXY
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_DISABLE_PROXY
+++ config_parse_args config:get simple-example DOKKU_DISABLE_PROXY
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_DISABLE_PROXY == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_DISABLE_PROXY == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_DISABLE_PROXY == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_DISABLE_PROXY == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DISABLE_PROXY
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DISABLE_PROXY
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DISABLE_PROXY
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DISABLE_PROXY
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DISABLE_PROXY
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DISABLE_PROXY
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_DISABLE_PROXY
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_DISABLE_PROXY='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOKKU_DISABLE_PROXY=
++ [[ -n '' ]]
++ echo true
+ local DOKKU_IS_APP_PROXY_ENABLED=true
+ local line
+ local PROC_TYPE
+ local PROC_COUNT
+ local CONTAINER_INDEX
+ read -r line
+ [[ web=1 =~ ^#.* ]]
++ strip_inline_comments web=1
++ declare 'desc=removes bash-style comment from input line'
++ local line=web=1
++ local stripped_line=web=1
++ echo web=1
+ line=web=1
+ PROC_TYPE=web
+ PROC_COUNT=1
+ CONTAINER_INDEX=1
+ [[ 1 -le 1 ]]
+ local id=
+ local port=
+ local ipaddr=
+ local DOKKU_CONTAINER_ID_FILE=/home/dokku/simple-example/CONTAINER.web.1
+ local DOKKU_IP_FILE=/home/dokku/simple-example/IP.web.1
+ local DOKKU_PORT_FILE=/home/dokku/simple-example/PORT.web.1
+ local 'DOCKER_ARGS= --env-file=/home/dokku/simple-example/DOCKERFILE_ENV_FILE'
+ local 'DOCKER_ARGS+= -e DYNO='\''web.1'\'' '
+ [[ -n 1 ]]
+ local 'DOCKER_ARGS+= -e TRACE=true '
+ [[ -n '' ]]
+ [[ -z '' ]]
+ DOKKU_DOCKERFILE_PORTS=($(config_get "$APP" DOKKU_DOCKERFILE_PORTS || true))
++ config_get simple-example DOKKU_DOCKERFILE_PORTS
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
++ config_parse_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_DOCKERFILE_PORTS
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_DOCKERFILE_PORTS='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ true
+ local DOKKU_DOCKERFILE_PORTS
++ config_get simple-example DOKKU_DOCKERFILE_START_CMD
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ config_parse_args config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_DOCKERFILE_START_CMD == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_DOCKERFILE_START_CMD == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_DOCKERFILE_START_CMD == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_DOCKERFILE_START_CMD == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_START_CMD
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_START_CMD
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKERFILE_START_CMD
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_DOCKERFILE_START_CMD
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_DOCKERFILE_START_CMD='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ true
+ local DOKKU_DOCKERFILE_START_CMD=
++ get_cmd_from_procfile simple-example web
++ declare 'desc=parse cmd from app Procfile'
++ local APP=simple-example
++ local PROC_TYPE=web
++ local DOKKU_PROCFILE=/home/dokku/simple-example/DOKKU_PROCFILE
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ [[ -f /home/dokku/simple-example/DOKKU_PROCFILE ]]
+ local DOKKU_PROCFILE_START_CMD=
+ local START_CMD=
+ [[ web == \w\e\b ]]
+ [[ -z '' ]]
+ local port=5000
+ local 'DOKKU_DOCKER_PORT_ARGS+=-p 5000'
+ [[ true == \t\r\u\e ]]
++ docker run --label=dokku -d -e PORT=5000 --env-file=/home/dokku/simple-example/DOCKERFILE_ENV_FILE -e 'DYNO='\''web.1'\''' -e TRACE=true dokku/simple-example:latest
+ local id=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
++ docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ local ipaddr=172.17.0.4
+ [[ -z 172.17.0.4 ]]
++ is_app_checks_enabled simple-example
++ declare 'desc=return app zero-downtime checks status'
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example DOKKU_CHECKS_ENABLED
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ config_parse_args config:get simple-example DOKKU_CHECKS_ENABLED
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_CHECKS_ENABLED
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_CHECKS_ENABLED
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_CHECKS_ENABLED
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_CHECKS_ENABLED
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_CHECKS_ENABLED
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_CHECKS_ENABLED='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOKKU_CHECKS_ENABLED=
++ [[ -z '' ]]
++ local status=true
++ echo true
+ [[ true == \f\a\l\s\e ]]
+ trap 'kill_new $id' INT TERM EXIT
+ dokku_log_info1 'Running pre-flight checks'
+ declare 'desc=log info1 formatter'
+ echo '-----> Running pre-flight checks'
-----> Running pre-flight checks
+ plugn trigger check-deploy simple-example fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e web 5000 172.17.0.4
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/checks/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ checks_check_deploy simple-example fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e web 5000 172.17.0.4
+ declare 'desc=checks check-deploy plugin trigger'
+ local trigger=checks_check_deploy
+ local APP=simple-example
+ local DOKKU_APP_CONTAINER_ID=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ local DOKKU_APP_CONTAINER_TYPE=web
+ local DOKKU_APP_LISTEN_PORT=5000
+ local DOKKU_APP_LISTEN_IP=172.17.0.4
+ [[ -z 5000 ]]
+ [[ -z 172.17.0.4 ]]
+ [[ -z fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e ]]
++ config_export global
++ declare 'desc=returns export command for config variable of specified type (app/global)'
++ local CONFIG_TYPE=global
++ local APP=
++ local ENV_FILE=/home/dokku//ENV
++ [[ global == \g\l\o\b\a\l ]]
++ local ENV_FILE=/home/dokku/ENV
++ [[ ! -f /home/dokku/ENV ]]
++ [[ ! -s /home/dokku/ENV ]]
++ return 0
+ eval ''
++ config_export app simple-example
++ declare 'desc=returns export command for config variable of specified type (app/global)'
++ local CONFIG_TYPE=app
++ local APP=simple-example
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ app == \g\l\o\b\a\l ]]
++ [[ ! -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ cut '-d ' -f2-
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local 'VARS=DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
++ awk '{print "export " $0}'
++ echo 'DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
++ return 0
+ eval 'export DOKKU_APP_RESTORE='\''1'\''
export DOKKU_NGINX_PORT='\''80'\'''
++ export DOKKU_APP_RESTORE=1
++ DOKKU_APP_RESTORE=1
++ export DOKKU_NGINX_PORT=80
++ DOKKU_NGINX_PORT=80
++ is_app_checks_enabled simple-example
++ declare 'desc=return app zero-downtime checks status'
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example DOKKU_CHECKS_ENABLED
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ config_parse_args config:get simple-example DOKKU_CHECKS_ENABLED
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_CHECKS_ENABLED == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_CHECKS_ENABLED
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_CHECKS_ENABLED
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_CHECKS_ENABLED
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_CHECKS_ENABLED
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_CHECKS_ENABLED
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_CHECKS_ENABLED
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_CHECKS_ENABLED='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOKKU_CHECKS_ENABLED=
++ [[ -z '' ]]
++ local status=true
++ echo true
+ [[ true == \f\a\l\s\e ]]
+ local WAIT=5
+ local TIMEOUT=30
+ local ATTEMPTS=5
++ mktemp -d /tmp/dokku_CHECKS.XXXXX
+ local CHECK_DEPLOY_TMP_WORK_DIR=/tmp/dokku_CHECKS.4ukVt
+ docker cp fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e:/app/CHECKS /tmp/dokku_CHECKS.4ukVt
+ true
+ local FILENAME=/tmp/dokku_CHECKS.4ukVt/CHECKS
+ trap 'checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID' RETURN INT TERM EXIT
+ [[ ! -s /tmp/dokku_CHECKS.4ukVt/CHECKS ]]
+ [[ web == \w\e\b ]]
+ dokku_log_verbose 'For more efficient zero downtime deployments, create a file CHECKS.'
+ declare 'desc=log verbose formatter'
+ echo ' For more efficient zero downtime deployments, create a file CHECKS.'
For more efficient zero downtime deployments, create a file CHECKS.
+ dokku_log_verbose 'See http://dokku.viewdocs.io/dokku/checks-examples.md for examples'
+ declare 'desc=log verbose formatter'
+ echo ' See http://dokku.viewdocs.io/dokku/checks-examples.md for examples'
See http://dokku.viewdocs.io/dokku/checks-examples.md for examples
+ dokku_log_verbose 'CHECKS file not found in container: Running simple container check...'
+ declare 'desc=log verbose formatter'
+ echo ' CHECKS file not found in container: Running simple container check...'
CHECKS file not found in container: Running simple container check...
+ rm -rf /tmp/dokku_CHECKS.4ukVt
+ local DOKKU_DEFAULT_CHECKS_WAIT=10
+ dokku_log_info1 'Waiting for 10 seconds ...'
+ declare 'desc=log info1 formatter'
+ echo '-----> Waiting for 10 seconds ...'
-----> Waiting for 10 seconds ...
+ sleep 10
+ is_container_running fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ declare 'desc=return 0 if given docker container id is in running state'
+ local CID=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
++ docker inspect -f '{{.State.Running}}' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ local CONTAINER_STATUS=true
+ [[ true == \t\r\u\e ]]
+ return 0
++ docker inspect -f '{{ .RestartCount }}' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ local container_restarts=0
+ [[ 0 -ne 0 ]]
+ trap - EXIT
+ dokku_log_info1 'Default container check successful!'
+ declare 'desc=log info1 formatter'
+ echo '-----> Default container check successful!'
-----> Default container check successful!
+ exit 0
+ trap - INT TERM EXIT
+ [[ -n fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e ]]
+ echo fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ [[ -n 172.17.0.4 ]]
+ echo 172.17.0.4
+ [[ -n 5000 ]]
+ echo 5000
+ rm -f /home/dokku/simple-example/CONTAINER /home/dokku/simple-example/IP /home/dokku/simple-example/PORT
+ local CONTAINER_INDEX=2
+ [[ 2 -le 1 ]]
+ [[ 1 == 0 ]]
+ local CONTAINER_IDX_OFFSET=2
+ local container_state_filetype
+ for container_state_filetype in CONTAINER IP PORT
+ cd /home/dokku/simple-example
+ xargs rm -f
+ tail -n +2
+ sort -t . -k 3 -n
+ find . -maxdepth 1 -name 'CONTAINER.web.*' -printf '%f\n'
+ for container_state_filetype in CONTAINER IP PORT
+ cd /home/dokku/simple-example
+ xargs rm -f
+ tail -n +2
+ sort -t . -k 3 -n
+ find . -maxdepth 1 -name 'IP.web.*' -printf '%f\n'
+ for container_state_filetype in CONTAINER IP PORT
+ cd /home/dokku/simple-example
+ xargs rm -f
+ tail -n +2
+ sort -t . -k 3 -n
+ find . -maxdepth 1 -name 'PORT.web.*' -printf '%f\n'
+ read -r line
+ [[ -n '' ]]
+ dokku_log_info1 'Running post-deploy'
+ declare 'desc=log info1 formatter'
+ echo '-----> Running post-deploy'
-----> Running post-deploy
+ plugn trigger post-deploy simple-example 5000 172.17.0.4 ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ exec_app_json_scripts simple-example 5000 172.17.0.4 ''
+ declare 'desc=core app.json scripts execution'
+ local 'trigger=/var/lib/dokku/plugins/enabled/00_dokku-standard/post-deploy app_json_scripts'
+ local APP=simple-example
+ case "$0" in
+ local IMAGE_TAG=
++ get_app_image_name simple-example ''
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n '' ]]
++ local IMAGE=dokku/simple-example:latest
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local PHASE_SCRIPT_KEY=postdeploy
+ dokku_log_info1 'Attempting to run scripts.dokku.postdeploy from app.json (if defined)'
+ declare 'desc=log info1 formatter'
+ echo '-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)'
-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)
+ execute_script simple-example dokku/simple-example:latest postdeploy
+ declare 'desc=executes appropriate phase script key from app.json'
+ local APP=simple-example
+ local IMAGE=dokku/simple-example:latest
+ local PHASE_SCRIPT_KEY=postdeploy
++ get_phase_script dokku/simple-example:latest postdeploy
+ local SCRIPT_CMD=
+ [[ -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ named_containers_post_deploy simple-example 5000 172.17.0.4 ''
+ declare 'desc=names deployed app container is consistent manner'
+ local trigger=named_containers_post_deploy
+ local APP=simple-example
+ local APP_ROOT=/home/dokku/simple-example
++ stat -t /home/dokku/simple-example/CONTAINER.web.1
+ [[ -z /home/dokku/simple-example/CONTAINER.web.1 65 8 81a4 1000 1000 fc00 1439013 1 0 0 1462541616 1462541691 1462541691 0 4096 ]]
+ local container
+ for container in '"$APP_ROOT"/CONTAINER.*'
++ sed -r 's/.*CONTAINER\.(.*)/\1/'
++ echo /home/dokku/simple-example/CONTAINER.web.1
+ local DYNO=web.1
+ local NAME=simple-example.web.1
+ local CURRENT_CONTAINER_ID=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
++ xargs
++ docker ps -a -q -f 'name=^.?simple-example.web.1$'
+ local PREVIOUS_CIDS=4e35258980f0
+ [[ -n 4e35258980f0 ]]
+ dokku_log_info1_quiet 'Found previous container(s) (4e35258980f0) named simple-example.web.1'
+ declare 'desc=log info1 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '-----> Found previous container(s) (4e35258980f0) named simple-example.web.1'
-----> Found previous container(s) (4e35258980f0) named simple-example.web.1
+ local cid
+ for cid in '$PREVIOUS_CIDS'
++ docker inspect -f '{{.State.Status}}' 4e35258980f0
+ local PREVIOUS_CONTAINER_STATUS=running
+ [[ running != \d\e\a\d ]]
++ date +%s
+ local CONTAINER_DATE_NAME=simple-example.web.1.1462541691
+ dokku_log_info2_quiet 'renaming container (4e35258980f0) simple-example.web.1 to simple-example.web.1.1462541691'
+ declare 'desc=log info2 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '=====> renaming container (4e35258980f0) simple-example.web.1 to simple-example.web.1.1462541691'
=====> renaming container (4e35258980f0) simple-example.web.1 to simple-example.web.1.1462541691
+ docker rename simple-example.web.1 simple-example.web.1.1462541691
++ cat /home/dokku/simple-example/CONTAINER.web.1
+ local ID=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
++ tr -d /
++ docker inspect -f '{{.Name}}' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+ local CURRENT_NAME=thirsty_panini
+ dokku_log_info2_quiet 'renaming container (fda7f44fae75) thirsty_panini to simple-example.web.1'
+ declare 'desc=log info2 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '=====> renaming container (fda7f44fae75) thirsty_panini to simple-example.web.1'
=====> renaming container (fda7f44fae75) thirsty_panini to simple-example.web.1
+ docker rename thirsty_panini simple-example.web.1
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/domains/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ source /var/lib/dokku/plugins/available/nginx-vhosts/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/certs/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/domains/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/ps/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+++ source /var/lib/dokku/plugins/available/config/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+ source /var/lib/dokku/plugins/available/proxy/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ get_app_proxy_type simple-example
++ declare 'desc=return app proxy type'
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ local APP_PROXY_TYPE=nginx
++ echo nginx
+ [[ nginx == \n\g\i\n\x ]]
+ nginx_post_deploy simple-example 5000 172.17.0.4 ''
+ declare 'desc=nginx-vhosts post-deploy plugin trigger'
+ local trigger=nginx_post_deploy
+ local APP=simple-example
+ [[ -f /home/dokku/simple-example/IP.web.1 ]]
+ [[ -f /home/dokku/simple-example/PORT.web.1 ]]
++ is_app_vhost_enabled simple-example
++ declare 'desc=returns true or false if vhost support is enabled for a given application'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example NO_VHOST
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example NO_VHOST
+++ config_parse_args config:get simple-example NO_VHOST
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ NO_VHOST == \-\-\g\l\o\b\a\l ]]
+++ [[ NO_VHOST == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ NO_VHOST == \-\-\e\x\p\o\r\t ]]
+++ [[ NO_VHOST == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=NO_VHOST
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export NO_VHOST='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local NO_VHOST=
++ local APP_VHOST_ENABLED=true
++ [[ '' == \1 ]]
++ echo true
+ [[ true == \f\a\l\s\e ]]
+ [[ ! -f /home/dokku/simple-example/VHOST ]]
+ nginx_build_config simple-example
+ declare 'desc=build nginx config to proxy app containers using sigil'
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ local DOKKU_APP_LISTEN_PORT=
+ local DOKKU_APP_LISTEN_IP=
+ local VHOST_PATH=/home/dokku/simple-example/VHOST
+ local URLS_PATH=/home/dokku/simple-example/URLS
+ local NGINX_TEMPLATE_NAME=nginx.conf.sigil
+ local DEFAULT_NGINX_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ local NGINX_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ local SCHEME=http
+ local NGINX_TEMPLATE_SOURCE=built-in
+ local APP_SSL_PATH=/home/dokku/simple-example/tls
++ get_app_raw_tcp_ports simple-example
++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ config_parse_args config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_DOCKERFILE_PORTS
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_DOCKERFILE_PORTS='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOCKERFILE_PORTS=
+++ xargs
+++ echo ''
++ local raw_tcp_ports=
++ echo ''
+ local RAW_TCP_PORTS=
++ config_get simple-example DOKKU_DISABLE_PROXY
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_DISABLE_PROXY
++ config_parse_args config:get simple-example DOKKU_DISABLE_PROXY
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_DISABLE_PROXY == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_DISABLE_PROXY == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_DISABLE_PROXY == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_DISABLE_PROXY == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DISABLE_PROXY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DISABLE_PROXY
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DISABLE_PROXY
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DISABLE_PROXY
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DISABLE_PROXY
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DISABLE_PROXY
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_DISABLE_PROXY
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_DISABLE_PROXY='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local DOKKU_DISABLE_PROXY=
++ is_app_vhost_enabled simple-example
++ declare 'desc=returns true or false if vhost support is enabled for a given application'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example NO_VHOST
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example NO_VHOST
+++ config_parse_args config:get simple-example NO_VHOST
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ NO_VHOST == \-\-\g\l\o\b\a\l ]]
+++ [[ NO_VHOST == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ NO_VHOST == \-\-\e\x\p\o\r\t ]]
+++ [[ NO_VHOST == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=NO_VHOST
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export NO_VHOST='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local NO_VHOST=
++ local APP_VHOST_ENABLED=true
++ [[ '' == \1 ]]
++ echo true
+ local IS_APP_VHOST_ENABLED=true
+ [[ -z '' ]]
+ [[ -z '' ]]
+ [[ -z '' ]]
+ shopt -s nullglob
+ local DOKKU_APP_IP_FILE
+ for DOKKU_APP_IP_FILE in '$DOKKU_ROOT/$APP/IP.web.*'
+ local DOKKU_APP_PORT_FILE=/home/dokku/simple-example/PORT.web.1
+ local DOKKU_APP_LISTENER_IP=172.17.0.4
+ local DOKKU_APP_LISTENER_PORT=5000
+ [[ -z '' ]]
+ local 'DOKKU_APP_LISTENERS+= 172.17.0.4:5000 '
++ xargs
++ echo ' 172.17.0.4:5000 '
+ local DOKKU_APP_LISTENERS=172.17.0.4:5000
+ shopt -u nullglob
++ mktemp -d /tmp/dokku_nginx_template.XXXXX
+ local NGINX_BUILD_CONFIG_TMP_WORK_DIR=/tmp/dokku_nginx_template.TqP5U
++ mktemp --tmpdir=/tmp/dokku_nginx_template.TqP5U nginx.conf.XXXXXX
+ local NGINX_CONF=/tmp/dokku_nginx_template.TqP5U/nginx.conf.7FRx5c
+ local CUSTOM_NGINX_TEMPLATE=/tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil
+ trap 'rm -rf $NGINX_CONF $NGINX_BUILD_CONFIG_TMP_WORK_DIR > /dev/null' RETURN INT TERM EXIT
+ get_custom_nginx_template simple-example /tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil
+ declare 'desc=attempts to copy custom nginx template from app image'
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ local DESTINATION=/tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil
++ get_running_image_tag simple-example
++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ CIDS=($(get_app_container_ids "$APP"))
+++ get_app_container_ids simple-example
+++ declare 'desc=returns list of docker container ids for given app'
+++ local APP=simple-example
+++ local CONTAINER_TYPE=
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ [[ -f /home/dokku/simple-example/CONTAINER ]]
+++ [[ -n '' ]]
+++ local 'CONTAINER_PATTERN=/home/dokku/simple-example/CONTAINER.*'
+++ shopt -s nullglob
+++ local DOKKU_CID_FILE
+++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'
+++ local 'DOKKU_CIDS+= '
+++ local DOKKU_CIDS+=fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
+++ local 'DOKKU_CIDS+= '
+++ shopt -u nullglob
+++ echo ' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e '
++ local CIDS
+++ awk -F: '{ print $2 }'
+++ docker inspect -f '{{ .Config.Image }}' fda7f44fae75be6ec614598569f95d383331aeee463d7528f3c9b4c6fb40594e
++ local RUNNING_IMAGE_TAG=latest
++ echo latest
+ local IMAGE_TAG=latest
++ get_app_image_name simple-example latest
++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'
++ local APP=simple-example
++ local IMAGE_TAG=latest
+++ get_app_image_repo simple-example
+++ declare 'desc=central definition of image repo pattern'
+++ local APP=simple-example
+++ local IMAGE_REPO=dokku/simple-example
+++ [[ -z simple-example ]]
+++ echo dokku/simple-example
++ local IMAGE_REPO=dokku/simple-example
++ [[ -z simple-example ]]
++ [[ -n latest ]]
++ local IMAGE=dokku/simple-example:latest
++ verify_image dokku/simple-example:latest
++ declare 'desc=verify image existence'
++ local IMAGE=dokku/simple-example:latest
++ docker inspect dokku/simple-example:latest
++ return 0
++ echo dokku/simple-example:latest
+ local IMAGE=dokku/simple-example:latest
+ local NGINX_TEMPLATE_NAME=nginx.conf.sigil
+ copy_from_image dokku/simple-example:latest nginx.conf.sigil /tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil
+ [[ -f /tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil ]]
+ dokku_log_info1 'Overriding default nginx.conf with detected nginx.conf.sigil'
+ declare 'desc=log info1 formatter'
+ echo '-----> Overriding default nginx.conf with detected nginx.conf.sigil'
-----> Overriding default nginx.conf with detected nginx.conf.sigil
+ local NGINX_TEMPLATE=/tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil
+ local NGINX_TEMPLATE_SOURCE=app-supplied
+ configure_nginx_ports simple-example
+ declare 'desc=configure nginx listening ports'
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
++ get_app_raw_tcp_ports simple-example
++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ config_parse_args config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_DOCKERFILE_PORTS
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_DOCKERFILE_PORTS='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOCKERFILE_PORTS=
+++ xargs
+++ echo ''
++ local raw_tcp_ports=
++ echo ''
+ local RAW_TCP_PORTS=
++ config_get simple-example DOKKU_NGINX_PORT
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ config_parse_args config:get simple-example DOKKU_NGINX_PORT
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_NGINX_PORT == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_NGINX_PORT == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_NGINX_PORT == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_NGINX_PORT == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_NGINX_PORT
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_NGINX_PORT='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local DOKKU_NGINX_PORT=80
++ config_get simple-example DOKKU_NGINX_SSL_PORT
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ config_parse_args config:get simple-example DOKKU_NGINX_SSL_PORT
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_SSL_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_SSL_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_SSL_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_SSL_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_NGINX_SSL_PORT
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_NGINX_SSL_PORT='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local DOKKU_NGINX_SSL_PORT=
++ is_app_vhost_enabled simple-example
++ declare 'desc=returns true or false if vhost support is enabled for a given application'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example NO_VHOST
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example NO_VHOST
+++ config_parse_args config:get simple-example NO_VHOST
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ NO_VHOST == \-\-\g\l\o\b\a\l ]]
+++ [[ NO_VHOST == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ NO_VHOST == \-\-\e\x\p\o\r\t ]]
+++ [[ NO_VHOST == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example NO_VHOST
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example NO_VHOST
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example NO_VHOST
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=NO_VHOST
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export NO_VHOST='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local NO_VHOST=
++ local APP_VHOST_ENABLED=true
++ [[ '' == \1 ]]
++ echo true
+ local IS_APP_VHOST_ENABLED=true
+ [[ -z 80 ]]
+ is_ssl_enabled simple-example
+ declare 'desc=returns 0 if ssl is enabled for given app'
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ local APP_SSL_PATH=/home/dokku/simple-example/tls
+ [[ -e /home/dokku/simple-example/tls/server.crt ]]
+ return 1
++ config_get simple-example DOKKU_NGINX_PORT
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ config_parse_args config:get simple-example DOKKU_NGINX_PORT
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_NGINX_PORT == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_NGINX_PORT == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_NGINX_PORT == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_NGINX_PORT == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_PORT
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_NGINX_PORT
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_NGINX_PORT='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local NGINX_PORT=80
++ config_get simple-example DOKKU_NGINX_SSL_PORT
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ config_parse_args config:get simple-example DOKKU_NGINX_SSL_PORT
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_NGINX_SSL_PORT == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_SSL_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_SSL_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_NGINX_SSL_PORT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_NGINX_SSL_PORT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_NGINX_SSL_PORT
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_NGINX_SSL_PORT
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_NGINX_SSL_PORT='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+ local NGINX_SSL_PORT=
++ get_app_domains simple-example
++ declare 'desc=return app domains'
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ local APP=simple-example
++ local APP_VHOST_FILE=/home/dokku/simple-example/VHOST
++ local GLOBAL_VHOST_PATH=/home/dokku/VHOST
++ local GLOBAL_HOSTNAME_PATH=/home/dokku/HOSTNAME
+++ is_app_vhost_enabled simple-example
+++ declare 'desc=returns true or false if vhost support is enabled for a given application'
+++ source /var/lib/dokku/plugins/available/config/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++ local APP=simple-example
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
++++ config_get simple-example NO_VHOST
++++ declare 'desc=get value of given config var'
++++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++++ set -- config:get simple-example NO_VHOST
++++ config_parse_args config:get simple-example NO_VHOST
++++ declare 'desc=parse config plugin args'
++++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++++ for var in '"$@"'
++++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++++ [[ config:get == \-\-\s\h\e\l\l ]]
++++ for var in '"$@"'
++++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++++ [[ simple-example == \-\-\s\h\e\l\l ]]
++++ for var in '"$@"'
++++ [[ NO_VHOST == \-\-\g\l\o\b\a\l ]]
++++ [[ NO_VHOST == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++++ [[ NO_VHOST == \-\-\e\x\p\o\r\t ]]
++++ [[ NO_VHOST == \-\-\s\h\e\l\l ]]
++++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++++ get_sanitized_config_args config:get simple-example NO_VHOST
+++++ local 'desc=return sanitized arguments for config plugin'
+++++ SANITIZED_ARGS=("$@")
+++++ local SANITIZED_ARGS
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++++ echo config:get simple-example NO_VHOST
++++ local SANITIZED_ARGS
++++ set -- config:get simple-example NO_VHOST
++++ DOKKU_CONFIG_TYPE=app
++++ DOKKU_CONFIG_RESTART=true
++++ [[ app == \a\p\p ]]
++++ [[ -z simple-example ]]
++++ verify_app_name simple-example
++++ declare 'desc=verify app name format and app existence'
++++ local APP=simple-example
++++ [[ ! -n simple-example ]]
++++ [[ ! simple-example =~ ^[a-z].* ]]
++++ [[ ! -d /home/dokku/simple-example ]]
++++ return 0
++++ APP=simple-example
++++ ENV_FILE=/home/dokku/simple-example/ENV
++++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++++ get_sanitized_config_args config:get simple-example NO_VHOST
+++++ local 'desc=return sanitized arguments for config plugin'
+++++ SANITIZED_ARGS=("$@")
+++++ local SANITIZED_ARGS
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++++ echo config:get simple-example NO_VHOST
++++ local SANITIZED_ARGS
++++ set -- config:get simple-example NO_VHOST
++++ [[ -z simple-example ]]
++++ config_create /home/dokku/simple-example/ENV
++++ declare 'desc=create config env file'
++++ local ENV_FILE=/home/dokku/simple-example/ENV
++++ [[ -f /home/dokku/simple-example/ENV ]]
++++ [[ ! -s /home/dokku/simple-example/ENV ]]
++++ local KEY=NO_VHOST
++++ sed -e 's/^'\''//' -e 's/'\''$//'
++++ cut -d= -f2-
++++ grep '^export NO_VHOST='
++++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
+++ local NO_VHOST=
+++ local APP_VHOST_ENABLED=true
+++ [[ '' == \1 ]]
+++ echo true
++ [[ true == \t\r\u\e ]]
++ [[ -f /home/dokku/simple-example/VHOST ]]
++ cat /home/dokku/simple-example/VHOST
+ local NONSSL_VHOSTS=static.dokku.me
++ xargs
++ echo static.dokku.me
+ local NOSSL_SERVER_NAME=static.dokku.me
+ is_ssl_enabled simple-example
+ declare 'desc=returns 0 if ssl is enabled for given app'
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ local APP_SSL_PATH=/home/dokku/simple-example/tls
+ [[ -e /home/dokku/simple-example/tls/server.crt ]]
+ return 1
++ config_export app simple-example
++ declare 'desc=returns export command for config variable of specified type (app/global)'
++ local CONFIG_TYPE=app
++ local APP=simple-example
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ app == \g\l\o\b\a\l ]]
++ [[ ! -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ cut '-d ' -f2-
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local 'VARS=DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
++ awk '{print "export " $0}'
++ echo 'DOKKU_APP_RESTORE='\''1'\''
DOKKU_NGINX_PORT='\''80'\'''
++ return 0
+ eval 'export DOKKU_APP_RESTORE='\''1'\''
export DOKKU_NGINX_PORT='\''80'\'''
++ export DOKKU_APP_RESTORE=1
++ DOKKU_APP_RESTORE=1
++ export DOKKU_NGINX_PORT=80
++ DOKKU_NGINX_PORT=80
+ SIGIL_PARAMS=(-f $NGINX_TEMPLATE APP="$APP" DOKKU_ROOT="$DOKKU_ROOT" NOSSL_SERVER_NAME="$NOSSL_SERVER_NAME" DOKKU_APP_LISTENERS="$DOKKU_APP_LISTENERS" PASSED_LISTEN_IP_PORT="$PASSED_LISTEN_IP_PORT" DOKKU_APP_LISTEN_PORT="$DOKKU_APP_LISTEN_PORT" DOKKU_APP_LISTEN_IP="$DOKKU_APP_LISTEN_IP" APP_SSL_PATH="$APP_SSL_PATH" SSL_INUSE="$SSL_INUSE" SSL_SERVER_NAME="$SSL_SERVER_NAME" NGINX_PORT="$NGINX_PORT" NGINX_SSL_PORT="$NGINX_SSL_PORT" RAW_TCP_PORTS="$RAW_TCP_PORTS")
+ local SIGIL_PARAMS
+ xargs -i echo '-----> Configuring {}...(using app-supplied template)'
++ echo '' static.dokku.me
++ tr ' ' '\n'
++ sort -u
-----> Configuring static.dokku.me...(using app-supplied template)
+ sigil -f /tmp/dokku_nginx_template.TqP5U/nginx.conf.sigil APP=simple-example DOKKU_ROOT=/home/dokku NOSSL_SERVER_NAME=static.dokku.me DOKKU_APP_LISTENERS=172.17.0.4:5000 PASSED_LISTEN_IP_PORT= DOKKU_APP_LISTEN_PORT= DOKKU_APP_LISTEN_IP= APP_SSL_PATH=/home/dokku/simple-example/tls SSL_INUSE= SSL_SERVER_NAME= NGINX_PORT=80 NGINX_SSL_PORT= RAW_TCP_PORTS=
+ is_deployed simple-example
+ declare 'desc=return 0 if given app has a running container'
+ local APP=simple-example
+ [[ -f /home/dokku/simple-example/CONTAINER ]]
++ ls /home/dokku/simple-example/CONTAINER.web.1
++ echo 0
+ [[ 0 -eq 0 ]]
+ return 0
+ dokku_log_info1 'Creating http nginx.conf'
+ declare 'desc=log info1 formatter'
+ echo '-----> Creating http nginx.conf'
-----> Creating http nginx.conf
+ mv /tmp/dokku_nginx_template.TqP5U/nginx.conf.7FRx5c /home/dokku/simple-example/nginx.conf
+ is_deployed simple-example
+ declare 'desc=return 0 if given app has a running container'
+ local APP=simple-example
+ [[ -f /home/dokku/simple-example/CONTAINER ]]
++ ls /home/dokku/simple-example/CONTAINER.web.1
++ echo 0
+ [[ 0 -eq 0 ]]
+ return 0
+ dokku_log_info1 'Running nginx-pre-reload'
+ declare 'desc=log info1 formatter'
+ echo '-----> Running nginx-pre-reload'
-----> Running nginx-pre-reload
+ plugn trigger nginx-pre-reload simple-example '' ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ dokku_log_verbose 'Reloading nginx'
+ declare 'desc=log verbose formatter'
+ echo ' Reloading nginx'
Reloading nginx
+ validate_nginx
+ declare 'desc=validate entire nginx config'
+ set +e
+ sudo /usr/sbin/nginx -t
+ local exit_code=0
+ set -e
+ [[ 0 -ne 0 ]]
+ restart_nginx
+ declare 'desc=restart nginx for given distros'
+ case "$DOKKU_DISTRO" in
+ sudo /etc/init.d/nginx reload
+ [[ -n static.dokku.me ]]
+ [[ true == \t\r\u\e ]]
+ echo '# THIS FILE IS GENERATED BY DOKKU - DO NOT EDIT, YOUR CHANGES WILL BE OVERWRITTEN'
+ xargs -i echo 'http://{}'
++ sort -u
++ tr ' ' '\n'
++ echo '' static.dokku.me
++ rm -rf /tmp/dokku_nginx_template.TqP5U/nginx.conf.7FRx5c /tmp/dokku_nginx_template.TqP5U
++ rm -rf
+ rm -rf
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ source /var/lib/dokku/plugins/available/ps/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ ps_post_deploy simple-example 5000 172.17.0.4 ''
+ declare 'desc=ps post-deploy plugin trigger'
+ local trigger=ps_post_deploy
+ local APP=simple-example
+ remove_procfile simple-example
+ declare 'desc=removes DOKKU_PROCFILE'
+ local APP=simple-example
+ local DOKKU_PROCFILE=/home/dokku/simple-example/DOKKU_PROCFILE
+ [[ -f /home/dokku/simple-example/DOKKU_PROCFILE ]]
+ config_set --no-restart simple-example DOKKU_APP_RESTORE=1
+ declare 'desc=set value of given config var'
+ [[ --no-restart == \c\o\n\f\i\g\:\s\e\t ]]
+ set -- config:set --no-restart simple-example DOKKU_APP_RESTORE=1
+ config_parse_args config:set --no-restart simple-example DOKKU_APP_RESTORE=1
+ declare 'desc=parse config plugin args'
+ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+ for var in '"$@"'
+ [[ config:set == \-\-\g\l\o\b\a\l ]]
+ [[ config:set == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ [[ config:set == \-\-\e\x\p\o\r\t ]]
+ [[ config:set == \-\-\s\h\e\l\l ]]
+ for var in '"$@"'
+ [[ --no-restart == \-\-\g\l\o\b\a\l ]]
+ [[ --no-restart == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ DOKKU_CONFIG_RESTART=false
+ [[ --no-restart == \-\-\e\x\p\o\r\t ]]
+ [[ --no-restart == \-\-\s\h\e\l\l ]]
+ for var in '"$@"'
+ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+ [[ simple-example == \-\-\s\h\e\l\l ]]
+ for var in '"$@"'
+ [[ DOKKU_APP_RESTORE=1 == \-\-\g\l\o\b\a\l ]]
+ [[ DOKKU_APP_RESTORE=1 == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ [[ DOKKU_APP_RESTORE=1 == \-\-\e\x\p\o\r\t ]]
+ [[ DOKKU_APP_RESTORE=1 == \-\-\s\h\e\l\l ]]
+ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++ get_sanitized_config_args config:set --no-restart simple-example DOKKU_APP_RESTORE=1
++ local 'desc=return sanitized arguments for config plugin'
++ SANITIZED_ARGS=("$@")
++ local SANITIZED_ARGS
++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++ echo config:set '' simple-example DOKKU_APP_RESTORE=1
+ local SANITIZED_ARGS
+ set -- config:set simple-example DOKKU_APP_RESTORE=1
+ DOKKU_CONFIG_TYPE=app
+ DOKKU_CONFIG_RESTART=false
+ [[ app == \a\p\p ]]
+ [[ -z simple-example ]]
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
+ APP=simple-example
+ ENV_FILE=/home/dokku/simple-example/ENV
+ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+ [[ -z simple-example DOKKU_APP_RESTORE=1 ]]
+ config_create /home/dokku/simple-example/ENV
+ declare 'desc=create config env file'
+ local ENV_FILE=/home/dokku/simple-example/ENV
+ [[ -f /home/dokku/simple-example/ENV ]]
+ local ENV_ADD=
++ cat /home/dokku/simple-example/ENV
+ local 'ENV_TEMP=export DOKKU_APP_RESTORE='\''1'\''
export DOKKU_NGINX_PORT='\''80'\'''
+ local RESTART_APP=false
+ shift 2
+ for var in '"$@"'
+ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ [[ -n simple-example ]]
+ [[ simple-example == \s\i\m\p\l\e\-\e\x\a\m\p\l\e ]]
+ shift 1
+ for var in '"$@"'
+ [[ DOKKU_APP_RESTORE=1 == \-\-\g\l\o\b\a\l ]]
+ [[ DOKKU_APP_RESTORE=1 == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+ [[ -n simple-example ]]
+ [[ DOKKU_APP_RESTORE=1 == \s\i\m\p\l\e\-\e\x\a\m\p\l\e ]]
+ [[ DOKKU_APP_RESTORE=1 != *\=* ]]
+ for var in '"$@"'
++ cut -d= -f1
++ echo DOKKU_APP_RESTORE=1
+ local KEY=DOKKU_APP_RESTORE
++ cut -d= -f2-
++ echo DOKKU_APP_RESTORE=1
+ local VALUE=1
+ [[ DOKKU_APP_RESTORE =~ [a-zA-Z_][a-zA-Z0-9_]* ]]
+ local RESTART_APP=true
++ sed '/^export DOKKU_APP_RESTORE=/ d'
++ echo 'export DOKKU_APP_RESTORE='\''1'\''
export DOKKU_NGINX_PORT='\''80'\'''
+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\''80'\'''
+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\''80'\''
export DOKKU_APP_RESTORE='\''1'\'''
++ sed '/^DOKKU_APP_RESTORE=/ d'
++ echo -e ''
+ local ENV_ADD=
+ local 'ENV_ADD=$
DOKKU_APP_RESTORE=1'
++ tail -n +2
++ echo '$
DOKKU_APP_RESTORE=1'
+ local ENV_ADD=DOKKU_APP_RESTORE=1
+ [[ -n true ]]
+ dokku_log_info1 'Setting config vars'
+ declare 'desc=log info1 formatter'
+ echo '-----> Setting config vars'
-----> Setting config vars
+ config_styled_hash DOKKU_APP_RESTORE=1 ' '
+ declare 'desc=internal config hash'
+ local vars=DOKKU_APP_RESTORE=1
+ local 'prefix= '
+ local longest=
+ read -r word
++ cut -d= -f1
++ echo DOKKU_APP_RESTORE=1
+ local KEY=DOKKU_APP_RESTORE
+ [[ 17 -gt 0 ]]
+ local longest=DOKKU_APP_RESTORE
+ read -r word
+ read -r word
++ cut -d= -f1
++ echo DOKKU_APP_RESTORE=1
+ local KEY=DOKKU_APP_RESTORE
++ sed -e 's/^'\''//' -e 's/'\''$//' -e 's/$$//g'
++ cut -d= -f2-
++ echo DOKKU_APP_RESTORE=1
+ local VALUE=1
+ local num_zeros=0
+ local 'zeros= '
+ [[ 0 -gt 0 ]]
+ echo ' DOKKU_APP_RESTORE: 1'
DOKKU_APP_RESTORE: 1
+ read -r word
+ config_write 'export DOKKU_NGINX_PORT='\''80'\''
export DOKKU_APP_RESTORE='\''1'\'''
+ declare 'desc=writes config vars out to appropriate file path'
+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\''80'\''
export DOKKU_APP_RESTORE='\''1'\'''
+ local ENV_FILE_TEMP=/home/dokku/simple-example/ENV.tmp
+ sort
+ sed '/^$/d'
+ echo 'export DOKKU_NGINX_PORT='\''80'\''
export DOKKU_APP_RESTORE='\''1'\'''
+ cmp -s /home/dokku/simple-example/ENV /home/dokku/simple-example/ENV.tmp
+ rm -f /home/dokku/simple-example/ENV.tmp
+ plugn trigger post-config-update simple-example set DOKKU_APP_RESTORE=1
+ [[ -n simple-example ]]
++ config_get simple-example DOKKU_APP_RESTORE
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_APP_RESTORE
++ config_parse_args config:get simple-example DOKKU_APP_RESTORE
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_APP_RESTORE == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_APP_RESTORE == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_APP_RESTORE == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_APP_RESTORE == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_APP_RESTORE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_APP_RESTORE
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_APP_RESTORE
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_APP_RESTORE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_APP_RESTORE
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_APP_RESTORE
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_APP_RESTORE
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ grep '^export DOKKU_APP_RESTORE='
+ local DOKKU_APP_RESTORE=1
+ [[ false == \t\r\u\e ]]
+ [[ -n 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77 ]]
+ [[ -z '' ]]
++ config_get simple-example DOKKU_WAIT_TO_RETIRE
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_WAIT_TO_RETIRE
++ config_parse_args config:get simple-example DOKKU_WAIT_TO_RETIRE
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_WAIT_TO_RETIRE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_WAIT_TO_RETIRE
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_WAIT_TO_RETIRE
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_WAIT_TO_RETIRE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_WAIT_TO_RETIRE
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_WAIT_TO_RETIRE
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_WAIT_TO_RETIRE
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_WAIT_TO_RETIRE='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ true
+ local DOKKU_APP_DOKKU_WAIT_TO_RETIRE=
++ config_get --global DOKKU_WAIT_TO_RETIRE
++ declare 'desc=get value of given config var'
++ [[ --global == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get --global DOKKU_WAIT_TO_RETIRE
++ config_parse_args config:get --global DOKKU_WAIT_TO_RETIRE
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ --global == \-\-\g\l\o\b\a\l ]]
++ ENV_FILE=/home/dokku/ENV
++ DOKKU_CONFIG_TYPE=global
++ DOKKU_CONFIG_RESTART=false
++ [[ --global == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ --global == \-\-\e\x\p\o\r\t ]]
++ [[ --global == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_WAIT_TO_RETIRE == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get --global DOKKU_WAIT_TO_RETIRE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get '' DOKKU_WAIT_TO_RETIRE
++ local SANITIZED_ARGS
++ set -- config:get DOKKU_WAIT_TO_RETIRE
++ DOKKU_CONFIG_TYPE=global
++ DOKKU_CONFIG_RESTART=false
++ [[ global == \a\p\p ]]
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get --global DOKKU_WAIT_TO_RETIRE
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get '' DOKKU_WAIT_TO_RETIRE
++ local SANITIZED_ARGS
++ set -- config:get DOKKU_WAIT_TO_RETIRE
++ [[ -z DOKKU_WAIT_TO_RETIRE ]]
++ config_create /home/dokku/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/ENV
++ [[ -f /home/dokku/ENV ]]
++ [[ ! -s /home/dokku/ENV ]]
++ return 0
+ local DOKKU_GLOBAL_DOKKU_WAIT_TO_RETIRE=
+ local DOKKU_WAIT_TO_RETIRE=
+ local WAIT=60
+ dokku_log_info1 'Shutting down old containers in 60 seconds'
+ declare 'desc=log info1 formatter'
+ echo '-----> Shutting down old containers in 60 seconds'
-----> Shutting down old containers in 60 seconds
+ local oldid
+ for oldid in '$oldids'
+ dokku_log_info2 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77
+ declare 'desc=log info2 formatter'
+ echo '=====> 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77'
=====> 4e35258980f072065a8b099eb7beed76d5917ffe7406087986e9fe48c7d60f77
++ config_get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ declare 'desc=get value of given config var'
++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
++ set -- config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ config_parse_args config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ declare 'desc=parse config plugin args'
++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ for var in '"$@"'
++ [[ config:get == \-\-\g\l\o\b\a\l ]]
++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ config:get == \-\-\e\x\p\o\r\t ]]
++ [[ config:get == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
++ [[ simple-example == \-\-\s\h\e\l\l ]]
++ for var in '"$@"'
++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \-\-\g\l\o\b\a\l ]]
++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \-\-\n\o\-\r\e\s\t\a\r\t ]]
++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \-\-\e\x\p\o\r\t ]]
++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \-\-\s\h\e\l\l ]]
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ DOKKU_CONFIG_TYPE=app
++ DOKKU_CONFIG_RESTART=true
++ [[ app == \a\p\p ]]
++ [[ -z simple-example ]]
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
++ APP=simple-example
++ ENV_FILE=/home/dokku/simple-example/ENV
++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
+++ get_sanitized_config_args config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
+++ local 'desc=return sanitized arguments for config plugin'
+++ SANITIZED_ARGS=("$@")
+++ local SANITIZED_ARGS
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
+++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
+++ echo config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ local SANITIZED_ARGS
++ set -- config:get simple-example DOKKU_DOCKER_STOP_TIMEOUT
++ [[ -z simple-example ]]
++ config_create /home/dokku/simple-example/ENV
++ declare 'desc=create config env file'
++ local ENV_FILE=/home/dokku/simple-example/ENV
++ [[ -f /home/dokku/simple-example/ENV ]]
++ [[ ! -s /home/dokku/simple-example/ENV ]]
++ local KEY=DOKKU_DOCKER_STOP_TIMEOUT
++ sed -e 's/^'\''//' -e 's/'\''$//'
++ cut -d= -f2-
++ grep '^export DOKKU_DOCKER_STOP_TIMEOUT='
++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ true
+ local DOKKU_DOCKER_STOP_TIMEOUT=
+ [[ -n '' ]]
+ disown -a
+ sleep 0.1
+ exec
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]
+ dokku_log_info2 'Application deployed:'
+ declare 'desc=log info2 formatter'
+ echo '=====> Application deployed:'
=====> Application deployed:
+ sed 's/^/ /'
+ get_app_urls urls simple-example
+ declare 'desc=print an app'\''s available urls'
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ source /var/lib/dokku/plugins/available/proxy/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ local APP=simple-example
+ verify_app_name simple-example
+ declare 'desc=verify app name format and app existence'
+ local APP=simple-example
+ [[ ! -n simple-example ]]
+ [[ ! simple-example =~ ^[a-z].* ]]
+ [[ ! -d /home/dokku/simple-example ]]
+ return 0
++ get_app_raw_tcp_ports simple-example
++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=simple-example
++ verify_app_name simple-example
++ declare 'desc=verify app name format and app existence'
++ local APP=simple-example
++ [[ ! -n simple-example ]]
++ [[ ! simple-example =~ ^[a-z].* ]]
++ [[ ! -d /home/dokku/simple-example ]]
++ return 0
+++ config_get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=get value of given config var'
+++ [[ simple-example == \c\o\n\f\i\g\:\g\e\t ]]
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ config_parse_args config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=parse config plugin args'
+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ for var in '"$@"'
+++ [[ config:get == \-\-\g\l\o\b\a\l ]]
+++ [[ config:get == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ config:get == \-\-\e\x\p\o\r\t ]]
+++ [[ config:get == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ simple-example == \-\-\g\l\o\b\a\l ]]
+++ [[ simple-example == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ simple-example == \-\-\e\x\p\o\r\t ]]
+++ [[ simple-example == \-\-\s\h\e\l\l ]]
+++ for var in '"$@"'
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\g\l\o\b\a\l ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\n\o\-\r\e\s\t\a\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\e\x\p\o\r\t ]]
+++ [[ DOKKU_DOCKERFILE_PORTS == \-\-\s\h\e\l\l ]]
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ DOKKU_CONFIG_TYPE=app
+++ DOKKU_CONFIG_RESTART=true
+++ [[ app == \a\p\p ]]
+++ [[ -z simple-example ]]
+++ verify_app_name simple-example
+++ declare 'desc=verify app name format and app existence'
+++ local APP=simple-example
+++ [[ ! -n simple-example ]]
+++ [[ ! simple-example =~ ^[a-z].* ]]
+++ [[ ! -d /home/dokku/simple-example ]]
+++ return 0
+++ APP=simple-example
+++ ENV_FILE=/home/dokku/simple-example/ENV
+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT
+++ SANITIZED_ARGS=($(get_sanitized_config_args "$@"))
++++ get_sanitized_config_args config:get simple-example DOKKU_DOCKERFILE_PORTS
++++ local 'desc=return sanitized arguments for config plugin'
++++ SANITIZED_ARGS=("$@")
++++ local SANITIZED_ARGS
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--global/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--no-restart/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--export/}")
++++ SANITIZED_ARGS=("${SANITIZED_ARGS[@]//--shell/}")
++++ echo config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ local SANITIZED_ARGS
+++ set -- config:get simple-example DOKKU_DOCKERFILE_PORTS
+++ [[ -z simple-example ]]
+++ config_create /home/dokku/simple-example/ENV
+++ declare 'desc=create config env file'
+++ local ENV_FILE=/home/dokku/simple-example/ENV
+++ [[ -f /home/dokku/simple-example/ENV ]]
+++ [[ ! -s /home/dokku/simple-example/ENV ]]
+++ local KEY=DOKKU_DOCKERFILE_PORTS
+++ sed -e 's/^'\''//' -e 's/'\''$//'
+++ cut -d= -f2-
+++ grep '^export DOKKU_DOCKERFILE_PORTS='
+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/simple-example/ENV
++ local DOCKERFILE_PORTS=
+++ xargs
+++ echo ''
++ local raw_tcp_ports=
++ echo ''
+ local RAW_TCP_PORTS=
+ local URLS_FILE=/home/dokku/simple-example/URLS
+ [[ -s /home/dokku/simple-example/URLS ]]
++ egrep -v '^#' /home/dokku/simple-example/URLS
+ local app_urls=http://static.dokku.me
+ [[ -n '' ]]
+ local URLS=http://static.dokku.me
+ case "$1" in
+ tr ' ' '\n'
+ echo http://static.dokku.me
http://static.dokku.me
+ echo
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]
+ exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment