{"action":"created","issue":{"url":"https://api.github.com/repos/dokku/dokku/issues/2153","repository_url":"https://api.github.com/repos/dokku/dokku","labels_url":"https://api.github.com/repos/dokku/dokku/issues/2153/labels{/name}","comments_url":"https://api.github.com/repos/dokku/dokku/issues/2153/comments","events_url":"https://api.github.com/repos/dokku/dokku/issues/2153/events","html_url":"https://github.com/dokku/dokku/issues/2153","id":152058178,"number":2153,"title":"502 bad gateway because dokku doesn't use the ports exposed by the Dockerfile. ","user":{"login":"aboutlo","id":1236268,"avatar_url":"https://avatars.githubusercontent.com/u/1236268?v=3","gravatar_id":"","url":"https://api.github.com/users/aboutlo","html_url":"https://github.com/aboutlo","followers_url":"https://api.github.com/users/aboutlo/followers","following_url":"https://api.github.com/users/aboutlo/following{/other_user}","gists_url":"https://api.github.com/users/aboutlo/gists{/gist_id}","starred_url":"https://api.github.com/users/aboutlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboutlo/subscriptions","organizations_url":"https://api.github.com/users/aboutlo/orgs","repos_url":"https://api.github.com/users/aboutlo/repos","events_url":"https://api.github.com/users/aboutlo/events{/privacy}","received_events_url":"https://api.github.com/users/aboutlo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dokku/dokku/labels/type:%20question","name":"type: question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-04-30T23:12:04Z","updated_at":"2016-05-06T15:44:13Z","closed_at":null,"body":"Description of problem:\r\nI can't connect to the port exposed by a docker container created using a custom Dockerfile. Dokku seems ignoring the exposed ports and fallback to the default port 5000. (http://dokku.viewdocs.io/dokku/deployment/dockerfiles/)\r\n\r\n\r\nOutput of the following commands\r\n\r\n- `uname -a`: Linux dokku 4.2.0-35-generic #40~14.04.1-Ubuntu SMP Fri Mar 18 16:37:35 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\r\n- `free -m`:\r\n```\r\n             total       used       free     shared    buffers     cached\r\nMem:           993        476        516          0         54        308\r\n-/+ buffers/cache:        112        880\r\nSwap:          511          0        511\r\n```\r\n- `docker version`:\r\n```\r\nClient:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   5604cbe\r\n Built:        Tue Apr 26 23:30:23 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.11.1\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   5604cbe\r\n Built:        Tue Apr 26 23:30:23 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n- `docker -D info`:\r\n```\r\nContainers: 5\r\n Running: 1\r\n Paused: 0\r\n Stopped: 4\r\nImages: 4\r\nServer Version: 1.11.1\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 25\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins: \r\n Volume: local\r\n Network: bridge null host\r\nKernel Version: 4.2.0-35-generic\r\nOperating System: Ubuntu 14.04.4 LTS\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 1\r\nTotal Memory: 993 MiB\r\nName: dokku\r\nID: 2E2P:YKWJ:FAD2:XRIX:KOWX:3X22:3UOT:KEAJ:QE6I:3GS3:NXWF:XFXE\r\nDocker Root Dir: /var/lib/docker\r\nDebug mode (client): true\r\nDebug mode (server): false\r\nRegistry: https://index.docker.io/v1/\r\nWARNING: No swap limit support\r\n```\r\n- `sigil -v`: 0.4.0\r\n- `docker run -ti gliderlabs/herokuish:latest herokuish version`:\r\n```\r\nherokuish: 0.3.12\r\nbuildpacks:\r\n  emberjs.tgz                latest\r\n  buildpack-nginx            v5\r\n  heroku-buildpack-clojure   v75\r\n  heroku-buildpack-erlang    fa17af9\r\n  heroku-buildpack-go        v34\r\n  heroku-buildpack-gradle    v17\r\n  heroku-buildpack-grails    v20\r\n  heroku-buildpack-java      v44\r\n  heroku-buildpack-multi     v1.0.0\r\n  heroku-buildpack-nodejs    v90\r\n  heroku-buildpack-php       v101\r\n  heroku-buildpack-play      v26\r\n  heroku-buildpack-python    v80\r\n  heroku-buildpack-ruby      v146\r\n  heroku-buildpack-scala     v70\r\n```\r\n- `dokku version`: v0.5.5-46-ge9447a2\r\n- `dokku plugin`:\r\n```\r\n 00_dokku-standard    0.5.6 enabled    dokku core standard plugin\r\n  20_events            0.5.6 enabled    dokku core events logging plugin\r\n  apps                 0.5.6 enabled    dokku core apps plugin\r\n  build-env            0.5.6 enabled    dokku core build-env plugin\r\n  certs                0.5.6 enabled    dokku core certificate management plugin\r\n  checks               0.5.6 enabled    dokku core checks plugin\r\n  common               0.5.6 enabled    dokku core common plugin\r\n  config               0.5.6 enabled    dokku core config plugin\r\n  docker-options       0.5.6 enabled    dokku core docker-options plugin\r\n  domains              0.5.6 enabled    dokku core domains plugin\r\n  enter                0.5.6 enabled    dokku core enter plugin\r\n  git                  0.5.6 enabled    dokku core git plugin\r\n  logs                 0.5.6 enabled    dokku core logs plugin\r\n  named-containers     0.5.6 enabled    dokku core named containers plugin\r\n  nginx-vhosts         0.5.6 enabled    dokku core nginx-vhosts plugin\r\n  plugin               0.5.6 enabled    dokku core plugin plugin\r\n  proxy                0.5.6 enabled    dokku core proxy plugin\r\n  ps                   0.5.6 enabled    dokku core ps plugin\r\n  shell                0.5.6 enabled    dokku core shell plugin\r\n  storage              0.5.6 enabled    dokku core storage plugin\r\n  tags                 0.5.6 enabled    dokku core tags plugin\r\n  tar                  0.5.6 enabled    dokku core tar plugin\r\n```\r\n- `cat /home/dokku/<app>/nginx.conf` (if applicable):\r\n```\r\nserver {\r\n  listen      [::]:80;\r\n  listen      80;\r\n  server_name mysite.dokku.me; \r\n  access_log  /var/log/nginx/mysite-access.log;\r\n  error_log   /var/log/nginx/mysite-error.log;\r\n\r\n\r\n  location    / {\r\n\r\n    gzip on;\r\n    gzip_min_length  1100;\r\n    gzip_buffers  4 32k;\r\n    gzip_types    text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml  application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;\r\n    gzip_vary on;\r\n    gzip_comp_level  6;\r\n\r\n    proxy_pass  http://mysite;\r\n    proxy_http_version 1.1;\r\n    proxy_set_header Upgrade $http_upgrade;\r\n    proxy_set_header Connection \"upgrade\";\r\n    proxy_set_header Host $http_host;\r\n    proxy_set_header X-Forwarded-Proto $scheme;\r\n    proxy_set_header X-Forwarded-For $remote_addr;\r\n    proxy_set_header X-Forwarded-Port $server_port;\r\n    proxy_set_header X-Request-Start $msec;\r\n  }\r\n  include /home/dokku/mysite/nginx.conf.d/*.conf;\r\n\r\n\r\n}\r\n\r\n\r\nupstream mysite {\r\n  server 172.17.0.2:5000;\r\n}\r\n```\r\nEnvironment details (AWS, VirtualBox, physical, etc.):\r\nvirtualbox\r\n\r\nHow was dokku installed?:\r\nvagrant\r\n\r\nHow reproducible:\r\nuse this docker file\r\n\r\n```\r\nFROM nginx\r\n\r\nCOPY public /usr/share/nginx/html\r\n\r\nEXPOSE 3000\r\n```\r\n\r\ndokku trace on (deploy)\r\n```\r\nroot@dokku:/etc/nginx# dokku tags:deploy mysite v3\r\n+ case \"$(lsb_release -si)\" in\r\n++ lsb_release -si\r\n+ export DOKKU_DISTRO=ubuntu\r\n+ DOKKU_DISTRO=ubuntu\r\n+ export DOKKU_IMAGE=gliderlabs/herokuish\r\n+ DOKKU_IMAGE=gliderlabs/herokuish\r\n+ export DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ export PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ export DOKKU_API_VERSION=1\r\n+ DOKKU_API_VERSION=1\r\n+ export DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ export DOKKU_VALID_EXIT=0\r\n+ DOKKU_VALID_EXIT=0\r\n+ export DOKKU_LOGS_DIR=/var/log/dokku\r\n+ DOKKU_LOGS_DIR=/var/log/dokku\r\n+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ export DOKKU_CONTAINER_LABEL=dokku\r\n+ DOKKU_CONTAINER_LABEL=dokku\r\n+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ parse_args tags:deploy mysite v3\r\n+ declare 'desc=top-level cli arg parser'\r\n+ local next_index=1\r\n+ local skip=false\r\n+ args=(\"$@\")\r\n+ local args\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=2\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=3\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=4\r\n+ return 0\r\n+ args=(\"$@\")\r\n+ [[ tags:deploy =~ ^--.* ]]\r\n+ has_tty\r\n+ declare 'desc=return 0 if we have a tty'\r\n++ /usr/bin/tty\r\n+ [[ /dev/pts/0 == \\n\\o\\t\\ \\a\\ \\t\\t\\y ]]\r\n+ return 0\r\n++ id -un\r\n+ [[ root != \\d\\o\\k\\k\\u ]]\r\n+ [[ ! tags:deploy =~ plugin:* ]]\r\n++ id -un\r\n+ export SSH_USER=root\r\n+ SSH_USER=root\r\n+ sudo -u dokku -E -H /usr/local/bin/dokku tags:deploy mysite v3\r\n+ case \"$(lsb_release -si)\" in\r\n++ lsb_release -si\r\n+ export DOKKU_DISTRO=ubuntu\r\n+ DOKKU_DISTRO=ubuntu\r\n+ export DOKKU_IMAGE=gliderlabs/herokuish\r\n+ DOKKU_IMAGE=gliderlabs/herokuish\r\n+ export DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ export PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ export DOKKU_API_VERSION=1\r\n+ DOKKU_API_VERSION=1\r\n+ export DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ export DOKKU_VALID_EXIT=0\r\n+ DOKKU_VALID_EXIT=0\r\n+ export DOKKU_LOGS_DIR=/var/log/dokku\r\n+ DOKKU_LOGS_DIR=/var/log/dokku\r\n+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ export DOKKU_CONTAINER_LABEL=dokku\r\n+ DOKKU_CONTAINER_LABEL=dokku\r\n+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ parse_args tags:deploy mysite v3\r\n+ declare 'desc=top-level cli arg parser'\r\n+ local next_index=1\r\n+ local skip=false\r\n+ args=(\"$@\")\r\n+ local args\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=2\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=3\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=4\r\n+ return 0\r\n+ args=(\"$@\")\r\n+ [[ tags:deploy =~ ^--.* ]]\r\n+ has_tty\r\n+ declare 'desc=return 0 if we have a tty'\r\n++ /usr/bin/tty\r\n+ [[ /dev/pts/0 == \\n\\o\\t\\ \\a\\ \\t\\t\\y ]]\r\n+ return 0\r\n++ id -un\r\n+ [[ dokku != \\d\\o\\k\\k\\u ]]\r\n++ id -un\r\n+ [[ dokku != \\r\\o\\o\\t ]]\r\n+ [[ tags:deploy =~ ^plugin:.* ]]\r\n+ [[ -n '' ]]\r\n+ dokku_auth tags:deploy mysite v3\r\n+ declare 'desc=calls user-auth plugin trigger'\r\n+ export SSH_USER=root\r\n+ SSH_USER=root\r\n+ export SSH_NAME=default\r\n+ SSH_NAME=default\r\n+ plugn trigger user-auth root default tags:deploy mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ return 0\r\n+ case \"$1\" in\r\n+ execute_dokku_cmd tags:deploy mysite v3\r\n+ declare 'desc=executes dokku sub-commands'\r\n+ local PLUGIN_NAME=tags:deploy\r\n+ local PLUGIN_CMD=tags:deploy\r\n+ local implemented=0\r\n+ local script\r\n+ argv=(\"$@\")\r\n+ local argv\r\n+ case \"$PLUGIN_NAME\" in\r\n++ readlink -f /var/lib/dokku/plugins/enabled/tags\r\n+ [[ /var/lib/dokku/core-plugins/available/tags == *core-plugins* ]]\r\n+ [[ tags:deploy == \\t\\a\\g\\s\\:\\d\\e\\p\\l\\o\\y ]]\r\n+ shift 1\r\n+ [[ ! -z '' ]]\r\n+ set -- tags:deploy mysite v3\r\n+ [[ -x /var/lib/dokku/plugins/enabled/tags:deploy/subcommands/default ]]\r\n+ [[ -x /var/lib/dokku/plugins/enabled/tags:deploy/subcommands/tags:deploy ]]\r\n+ [[ -x /var/lib/dokku/plugins/enabled/tags/subcommands/deploy ]]\r\n+ /var/lib/dokku/plugins/enabled/tags/subcommands/deploy tags:deploy mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/tags/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ tags_deploy_cmd tags:deploy mysite v3\r\n+ declare 'desc=deploys an app with a given tagged image via command line'\r\n+ local cmd=tags:deploy\r\n+ [[ -z mysite ]]\r\n+ local APP=mysite\r\n+ local IMAGE_TAG=v3\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ release_and_deploy mysite v3\r\n+ declare 'desc=main function for releasing and deploying an app'\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ local APP=mysite\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ verify_image dokku/mysite:v3\r\n+ declare 'desc=verify image existence'\r\n+ local IMAGE=dokku/mysite:v3\r\n+ docker inspect dokku/mysite:v3\r\n+ return 0\r\n+ is_image_herokuish_based dokku/mysite:v3\r\n+ declare 'desc=returns true if app image is based on herokuish'\r\n+ [[ ! -f /home/ubuntu/.circlerc ]]\r\n+ local DOCKER_ARGS=--rm\r\n+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/mysite:v3 -c 'test -f /exec'\r\n+ local IMAGE_SOURCE_TYPE=dockerfile\r\n++ config_get mysite DOKKU_SKIP_DEPLOY\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_SKIP_DEPLOY\r\n++ config_parse_args config:get mysite DOKKU_SKIP_DEPLOY\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_SKIP_DEPLOY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_SKIP_DEPLOY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_SKIP_DEPLOY\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_SKIP_DEPLOY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_SKIP_DEPLOY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_SKIP_DEPLOY\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_SKIP_DEPLOY\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_SKIP_DEPLOY='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ true\r\n+ local DOKKU_APP_SKIP_DEPLOY=\r\n++ config_get --global DOKKU_SKIP_DEPLOY\r\n++ declare 'desc=get value of given config var'\r\n++ [[ --global == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get --global DOKKU_SKIP_DEPLOY\r\n++ config_parse_args config:get --global DOKKU_SKIP_DEPLOY\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ --global == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ ENV_FILE=/home/dokku/ENV\r\n++ DOKKU_CONFIG_TYPE=global\r\n++ DOKKU_CONFIG_RESTART=false\r\n++ [[ --global == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ --global == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ --global == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_SKIP_DEPLOY == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get --global DOKKU_SKIP_DEPLOY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get '' DOKKU_SKIP_DEPLOY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get DOKKU_SKIP_DEPLOY\r\n++ DOKKU_CONFIG_TYPE=global\r\n++ DOKKU_CONFIG_RESTART=false\r\n++ [[ global == \\a\\p\\p ]]\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get --global DOKKU_SKIP_DEPLOY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get '' DOKKU_SKIP_DEPLOY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get DOKKU_SKIP_DEPLOY\r\n++ [[ -z DOKKU_SKIP_DEPLOY ]]\r\n++ config_create /home/dokku/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/ENV\r\n++ [[ -f /home/dokku/ENV ]]\r\n++ [[ ! -s /home/dokku/ENV ]]\r\n++ return 0\r\n+ local DOKKU_GLOBAL_SKIP_DEPLOY=\r\n+ local DOKKU_SKIP_DEPLOY=\r\n+ dokku_log_info1 'Releasing mysite (dokku/mysite:v3)...'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Releasing mysite (dokku/mysite:v3)...'\r\n-----> Releasing mysite (dokku/mysite:v3)...\r\n+ dokku release mysite dockerfile v3\r\n+ case \"$(lsb_release -si)\" in\r\n++ lsb_release -si\r\n+ export DOKKU_DISTRO=ubuntu\r\n+ DOKKU_DISTRO=ubuntu\r\n+ export DOKKU_IMAGE=gliderlabs/herokuish\r\n+ DOKKU_IMAGE=gliderlabs/herokuish\r\n+ export DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ export PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ export DOKKU_API_VERSION=1\r\n+ DOKKU_API_VERSION=1\r\n+ export DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ export DOKKU_VALID_EXIT=0\r\n+ DOKKU_VALID_EXIT=0\r\n+ export DOKKU_LOGS_DIR=/var/log/dokku\r\n+ DOKKU_LOGS_DIR=/var/log/dokku\r\n+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ export DOKKU_CONTAINER_LABEL=dokku\r\n+ DOKKU_CONTAINER_LABEL=dokku\r\n+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ parse_args release mysite dockerfile v3\r\n+ declare 'desc=top-level cli arg parser'\r\n+ local next_index=1\r\n+ local skip=false\r\n+ args=(\"$@\")\r\n+ local args\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=2\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=3\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=4\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=5\r\n+ return 0\r\n+ args=(\"$@\")\r\n+ [[ release =~ ^--.* ]]\r\n+ has_tty\r\n+ declare 'desc=return 0 if we have a tty'\r\n++ /usr/bin/tty\r\n+ [[ /dev/pts/0 == \\n\\o\\t\\ \\a\\ \\t\\t\\y ]]\r\n+ return 0\r\n++ id -un\r\n+ [[ dokku != \\d\\o\\k\\k\\u ]]\r\n++ id -un\r\n+ [[ dokku != \\r\\o\\o\\t ]]\r\n+ [[ release =~ ^plugin:.* ]]\r\n+ [[ -n '' ]]\r\n+ dokku_auth release mysite dockerfile v3\r\n+ declare 'desc=calls user-auth plugin trigger'\r\n+ export SSH_USER=root\r\n+ SSH_USER=root\r\n+ export SSH_NAME=default\r\n+ SSH_NAME=default\r\n+ plugn trigger user-auth root default release mysite dockerfile v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ return 0\r\n+ case \"$1\" in\r\n+ execute_dokku_cmd release mysite dockerfile v3\r\n+ declare 'desc=executes dokku sub-commands'\r\n+ local PLUGIN_NAME=release\r\n+ local PLUGIN_CMD=release\r\n+ local implemented=0\r\n+ local script\r\n+ argv=(\"$@\")\r\n+ local argv\r\n+ case \"$PLUGIN_NAME\" in\r\n+ local PLUGIN_NAME=00_dokku-standard\r\n++ readlink -f /var/lib/dokku/plugins/enabled/00_dokku-standard\r\n+ [[ /var/lib/dokku/core-plugins/available/00_dokku-standard == *core-plugins* ]]\r\n+ [[ release == \\r\\e\\l\\e\\a\\s\\e ]]\r\n+ shift 1\r\n+ [[ ! -z '' ]]\r\n+ set -- release mysite dockerfile v3\r\n+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/default ]]\r\n+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/release ]]\r\n+ /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/release release mysite dockerfile v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ dokku_release_cmd release mysite dockerfile v3\r\n+ declare 'desc=release phase'\r\n+ local cmd=release\r\n+ local APP=mysite\r\n+ local IMAGE_SOURCE_TYPE=dockerfile\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ case \"$IMAGE_SOURCE_TYPE\" in\r\n+ plugn trigger pre-release-dockerfile mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ plugn trigger post-release-dockerfile mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ implemented=1\r\n+ [[ 1 -eq 0 ]]\r\n+ [[ 1 -eq 0 ]]\r\n+ [[ '' != \\t\\r\\u\\e ]]\r\n+ dokku_log_info1 'Deploying mysite (dokku/mysite:v3)...'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Deploying mysite (dokku/mysite:v3)...'\r\n-----> Deploying mysite (dokku/mysite:v3)...\r\n+ dokku deploy mysite v3\r\n+ case \"$(lsb_release -si)\" in\r\n++ lsb_release -si\r\n+ export DOKKU_DISTRO=ubuntu\r\n+ DOKKU_DISTRO=ubuntu\r\n+ export DOKKU_IMAGE=gliderlabs/herokuish\r\n+ DOKKU_IMAGE=gliderlabs/herokuish\r\n+ export DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ DOKKU_LIB_ROOT=/var/lib/dokku\r\n+ export PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ PLUGIN_PATH=/var/lib/dokku/plugins\r\n+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available\r\n+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled\r\n+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins\r\n+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available\r\n+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled\r\n+ export DOKKU_API_VERSION=1\r\n+ DOKKU_API_VERSION=1\r\n+ export DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ DOKKU_NOT_IMPLEMENTED_EXIT=10\r\n+ export DOKKU_VALID_EXIT=0\r\n+ DOKKU_VALID_EXIT=0\r\n+ export DOKKU_LOGS_DIR=/var/log/dokku\r\n+ DOKKU_LOGS_DIR=/var/log/dokku\r\n+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log\r\n+ export DOKKU_CONTAINER_LABEL=dokku\r\n+ DOKKU_CONTAINER_LABEL=dokku\r\n+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ parse_args deploy mysite v3\r\n+ declare 'desc=top-level cli arg parser'\r\n+ local next_index=1\r\n+ local skip=false\r\n+ args=(\"$@\")\r\n+ local args\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=2\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=3\r\n+ for arg in '\"$@\"'\r\n+ false\r\n+ case \"$arg\" in\r\n+ local next_index=4\r\n+ return 0\r\n+ args=(\"$@\")\r\n+ [[ deploy =~ ^--.* ]]\r\n+ has_tty\r\n+ declare 'desc=return 0 if we have a tty'\r\n++ /usr/bin/tty\r\n+ [[ /dev/pts/0 == \\n\\o\\t\\ \\a\\ \\t\\t\\y ]]\r\n+ return 0\r\n++ id -un\r\n+ [[ dokku != \\d\\o\\k\\k\\u ]]\r\n++ id -un\r\n+ [[ dokku != \\r\\o\\o\\t ]]\r\n+ [[ deploy =~ ^plugin:.* ]]\r\n+ [[ -n '' ]]\r\n+ dokku_auth deploy mysite v3\r\n+ declare 'desc=calls user-auth plugin trigger'\r\n+ export SSH_USER=root\r\n+ SSH_USER=root\r\n+ export SSH_NAME=default\r\n+ SSH_NAME=default\r\n+ plugn trigger user-auth root default deploy mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ return 0\r\n+ case \"$1\" in\r\n+ execute_dokku_cmd deploy mysite v3\r\n+ declare 'desc=executes dokku sub-commands'\r\n+ local PLUGIN_NAME=deploy\r\n+ local PLUGIN_CMD=deploy\r\n+ local implemented=0\r\n+ local script\r\n+ argv=(\"$@\")\r\n+ local argv\r\n+ case \"$PLUGIN_NAME\" in\r\n+ local PLUGIN_NAME=00_dokku-standard\r\n++ readlink -f /var/lib/dokku/plugins/enabled/00_dokku-standard\r\n+ [[ /var/lib/dokku/core-plugins/available/00_dokku-standard == *core-plugins* ]]\r\n+ [[ deploy == \\d\\e\\p\\l\\o\\y ]]\r\n+ shift 1\r\n+ [[ ! -z '' ]]\r\n+ set -- deploy mysite v3\r\n+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/default ]]\r\n+ [[ -x /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/deploy ]]\r\n+ /var/lib/dokku/plugins/enabled/00_dokku-standard/subcommands/deploy deploy mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/checks/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ source /var/lib/dokku/core-plugins/available/proxy/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ dokku_deploy_cmd deploy mysite v3\r\n+ declare 'desc=deploy phase'\r\n+ local cmd=deploy\r\n+ [[ -z mysite ]]\r\n+ local APP=mysite\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ plugn trigger pre-deploy mysite v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ exec_app_json_scripts mysite v3\r\n+ declare 'desc=core app.json scripts execution'\r\n+ local 'trigger=/var/lib/dokku/plugins/enabled/00_dokku-standard/pre-deploy app_json_scripts'\r\n+ local APP=mysite\r\n+ case \"$0\" in\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local PHASE_SCRIPT_KEY=predeploy\r\n+ dokku_log_info1 'Attempting to run scripts.dokku.predeploy from app.json (if defined)'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)'\r\n-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)\r\n+ execute_script mysite dokku/mysite:v3 predeploy\r\n+ declare 'desc=executes appropriate phase script key from app.json'\r\n+ local APP=mysite\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local PHASE_SCRIPT_KEY=predeploy\r\n++ get_phase_script dokku/mysite:v3 predeploy\r\n+ local SCRIPT_CMD=\r\n+ [[ -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/ps/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ ps_pre_deploy mysite v3\r\n+ declare 'desc=ps pre-deploy plugin trigger'\r\n+ local trigger=ps_pre_deploy\r\n+ local APP=mysite\r\n+ extract_procfile mysite\r\n+ declare 'desc=extracts procfile from app image'\r\n+ local APP=mysite\r\n++ get_running_image_tag mysite\r\n++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ CIDS=($(get_app_container_ids \"$APP\"))\r\n+++ get_app_container_ids mysite\r\n+++ declare 'desc=returns list of docker container ids for given app'\r\n+++ local APP=mysite\r\n+++ local CONTAINER_TYPE=\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ [[ -f /home/dokku/mysite/CONTAINER ]]\r\n+++ [[ -n '' ]]\r\n+++ local 'CONTAINER_PATTERN=/home/dokku/mysite/CONTAINER.*'\r\n+++ shopt -s nullglob\r\n+++ local DOKKU_CID_FILE\r\n+++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'\r\n+++ local 'DOKKU_CIDS+= '\r\n+++ local DOKKU_CIDS+=d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356\r\n+++ local 'DOKKU_CIDS+= '\r\n+++ shopt -u nullglob\r\n+++ echo ' d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356 '\r\n++ local CIDS\r\n+++ awk -F: '{ print $2 }'\r\n+++ docker inspect -f '{{ .Config.Image }}' d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356\r\n++ local RUNNING_IMAGE_TAG=v3\r\n++ echo v3\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local DOKKU_PROCFILE=/home/dokku/mysite/DOKKU_PROCFILE\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ copy_from_image dokku/mysite:v3 Procfile /home/dokku/mysite/DOKKU_PROCFILE\r\n+ [[ -f /home/dokku/mysite/DOKKU_PROCFILE ]]\r\n+ dokku_log_info1_quiet 'No Procfile found in app image'\r\n+ declare 'desc=log info1 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '-----> No Procfile found in app image'\r\n-----> No Procfile found in app image\r\n+ generate_scale_file mysite\r\n+ declare 'desc=generates DOKKU_SCALE file'\r\n+ local APP=mysite\r\n+ local IMAGE_TAG=\r\n++ get_app_image_name mysite ''\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n '' ]]\r\n++ local IMAGE=dokku/mysite:latest\r\n++ echo dokku/mysite:latest\r\n+ local IMAGE=dokku/mysite:latest\r\n+ local DOKKU_SCALE_FILE=/home/dokku/mysite/DOKKU_SCALE\r\n+ local DOKKU_PROCFILE=/home/dokku/mysite/DOKKU_PROCFILE\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ copy_from_image dokku/mysite:latest /app/DOKKU_SCALE /home/dokku/mysite\r\n+ true\r\n+ [[ ! -f /home/dokku/mysite/DOKKU_SCALE ]]\r\n+ dokku_log_info1_quiet 'DOKKU_SCALE file found (/home/dokku/mysite/DOKKU_SCALE)'\r\n+ declare 'desc=log info1 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '-----> DOKKU_SCALE file found (/home/dokku/mysite/DOKKU_SCALE)'\r\n-----> DOKKU_SCALE file found (/home/dokku/mysite/DOKKU_SCALE)\r\n+ print_dokku_scale_file mysite\r\n+ declare 'desc=prints contents of DOKKU_SCALE file'\r\n+ local APP=mysite\r\n+ local DOKKU_SCALE_FILE=/home/dokku/mysite/DOKKU_SCALE\r\n+ read -r line\r\n+ dokku_log_info2_quiet web=1\r\n+ declare 'desc=log info2 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '=====> web=1'\r\n=====> web=1\r\n+ read -r line\r\n+ [[ -n '' ]]\r\n+ is_image_herokuish_based dokku/mysite:v3\r\n+ declare 'desc=returns true if app image is based on herokuish'\r\n+ [[ ! -f /home/ubuntu/.circlerc ]]\r\n+ local DOCKER_ARGS=--rm\r\n+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/mysite:v3 -c 'test -f /exec'\r\n+ local DOKKU_SCALE_FILE=/home/dokku/mysite/DOKKU_SCALE\r\n++ get_app_container_ids mysite\r\n++ declare 'desc=returns list of docker container ids for given app'\r\n++ local APP=mysite\r\n++ local CONTAINER_TYPE=\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ [[ -f /home/dokku/mysite/CONTAINER ]]\r\n++ [[ -n '' ]]\r\n++ local 'CONTAINER_PATTERN=/home/dokku/mysite/CONTAINER.*'\r\n++ shopt -s nullglob\r\n++ local DOKKU_CID_FILE\r\n++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'\r\n++ local 'DOKKU_CIDS+= '\r\n++ local DOKKU_CIDS+=d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356\r\n++ local 'DOKKU_CIDS+= '\r\n++ shopt -u nullglob\r\n++ echo ' d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356 '\r\n+ local 'oldids= d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356 '\r\n++ plugn trigger docker-args-deploy mysite v3\r\n++ :\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ config_docker_args mysite v3\r\n+ declare 'desc=config docker-args plugin trigger'\r\n+ local 'trigger=/var/lib/dokku/plugins/enabled/config/docker-args-deploy config_docker_args'\r\n++ cat\r\n+ local STDIN=\r\n+ local APP=mysite\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local DOCKERFILE_ENV_FILE=/home/dokku/mysite/DOCKERFILE_ENV_FILE\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ is_image_herokuish_based dokku/mysite:v3\r\n+ declare 'desc=returns true if app image is based on herokuish'\r\n+ [[ ! -f /home/ubuntu/.circlerc ]]\r\n+ local DOCKER_ARGS=--rm\r\n+ docker run --label=dokku --entrypoint=/bin/sh --rm dokku/mysite:v3 -c 'test -f /exec'\r\n+ sed -e 's:^export ::g' -e 's:='\\'':=:g' -e 's:'\\''$::g'\r\n+ config_export global\r\n+ declare 'desc=returns export command for config variable of specified type (app/global)'\r\n+ local CONFIG_TYPE=global\r\n+ local APP=\r\n+ local ENV_FILE=/home/dokku//ENV\r\n+ [[ global == \\g\\l\\o\\b\\a\\l ]]\r\n+ local ENV_FILE=/home/dokku/ENV\r\n+ [[ ! -f /home/dokku/ENV ]]\r\n+ [[ ! -s /home/dokku/ENV ]]\r\n+ return 0\r\n+ sed -e 's:^export ::g' -e 's:='\\'':=:g' -e 's:'\\''$::g'\r\n+ config_export app mysite\r\n+ declare 'desc=returns export command for config variable of specified type (app/global)'\r\n+ local CONFIG_TYPE=app\r\n+ local APP=mysite\r\n+ local ENV_FILE=/home/dokku/mysite/ENV\r\n+ [[ app == \\g\\l\\o\\b\\a\\l ]]\r\n+ [[ ! -f /home/dokku/mysite/ENV ]]\r\n+ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ cut '-d ' -f2-\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local 'VARS=DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n+ awk '{print \"export \" $0}'\r\n+ echo 'DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n+ return 0\r\n+ echo -n ' --env-file=/home/dokku/mysite/DOCKERFILE_ENV_FILE'\r\n+ docker_args mysite v3\r\n+ declare 'desc=docker args plugin trigger'\r\n+ local trigger=/var/lib/dokku/plugins/enabled/docker-options/docker-args-deploy\r\n++ cat\r\n+ local STDIN=\r\n+ local APP=mysite\r\n+ local IMAGE_SOURCE_TYPE=v3\r\n+ case \"$0\" in\r\n+ local PHASE=DEPLOY\r\n+ local FILE_PREFIX=DOCKER_OPTIONS_\r\n+ local PHASE_FILE_PATH=/home/dokku/mysite/DOCKER_OPTIONS_DEPLOY\r\n+ local output=\r\n+ [[ -f /home/dokku/mysite/DOCKER_OPTIONS_DEPLOY ]]\r\n+ echo -n ''\r\n+ local 'DOKKU_DEFAULT_DOCKER_ARGS= --env-file=/home/dokku/mysite/DOCKERFILE_ENV_FILE'\r\n++ is_app_proxy_enabled mysite\r\n++ declare 'desc=return true if proxy is enabled; otherwise return false'\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ local APP_PROXY_ENABLED=true\r\n+++ config_get mysite DOKKU_DISABLE_PROXY\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n+++ config_parse_args config:get mysite DOKKU_DISABLE_PROXY\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DISABLE_PROXY\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DISABLE_PROXY\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DISABLE_PROXY\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DISABLE_PROXY\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_DISABLE_PROXY\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_DISABLE_PROXY='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOKKU_DISABLE_PROXY=\r\n++ [[ -n '' ]]\r\n++ echo true\r\n+ local DOKKU_IS_APP_PROXY_ENABLED=true\r\n+ local line\r\n+ local PROC_TYPE\r\n+ local PROC_COUNT\r\n+ local CONTAINER_INDEX\r\n+ read -r line\r\n+ [[ web=1 =~ ^#.* ]]\r\n++ strip_inline_comments web=1\r\n++ declare 'desc=removes bash-style comment from input line'\r\n++ local line=web=1\r\n++ local stripped_line=web=1\r\n++ echo web=1\r\n+ line=web=1\r\n+ PROC_TYPE=web\r\n+ PROC_COUNT=1\r\n+ CONTAINER_INDEX=1\r\n+ [[ 1 -le 1 ]]\r\n+ local id=\r\n+ local port=\r\n+ local ipaddr=\r\n+ local DOKKU_CONTAINER_ID_FILE=/home/dokku/mysite/CONTAINER.web.1\r\n+ local DOKKU_IP_FILE=/home/dokku/mysite/IP.web.1\r\n+ local DOKKU_PORT_FILE=/home/dokku/mysite/PORT.web.1\r\n+ local 'DOCKER_ARGS= --env-file=/home/dokku/mysite/DOCKERFILE_ENV_FILE'\r\n+ local 'DOCKER_ARGS+= -e DYNO='\\''web.1'\\'' '\r\n+ [[ -n 1 ]]\r\n+ local 'DOCKER_ARGS+= -e TRACE=true '\r\n+ [[ -n '' ]]\r\n+ [[ -z '' ]]\r\n+ DOKKU_DOCKERFILE_PORTS=($(config_get \"$APP\" DOKKU_DOCKERFILE_PORTS || true))\r\n++ config_get mysite DOKKU_DOCKERFILE_PORTS\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ config_parse_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_DOCKERFILE_PORTS\r\n++ cut -d= -f2-\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ grep '^export DOKKU_DOCKERFILE_PORTS='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ true\r\n+ local DOKKU_DOCKERFILE_PORTS\r\n++ config_get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ config_parse_args config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_DOCKERFILE_START_CMD == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_DOCKERFILE_START_CMD == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_DOCKERFILE_START_CMD == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_DOCKERFILE_START_CMD == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKERFILE_START_CMD\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_DOCKERFILE_START_CMD\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_DOCKERFILE_START_CMD='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ true\r\n+ local DOKKU_DOCKERFILE_START_CMD=\r\n++ get_cmd_from_procfile mysite web\r\n++ declare 'desc=parse cmd from app Procfile'\r\n++ local APP=mysite\r\n++ local PROC_TYPE=web\r\n++ local DOKKU_PROCFILE=/home/dokku/mysite/DOKKU_PROCFILE\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ [[ -f /home/dokku/mysite/DOKKU_PROCFILE ]]\r\n+ local DOKKU_PROCFILE_START_CMD=\r\n+ local START_CMD=\r\n+ [[ web == \\w\\e\\b ]]\r\n+ [[ -z '' ]]\r\n+ local port=5000\r\n+ local 'DOKKU_DOCKER_PORT_ARGS+=-p 5000'\r\n+ [[ true == \\t\\r\\u\\e ]]\r\n++ docker run --label=dokku -d -e PORT=5000 --env-file=/home/dokku/mysite/DOCKERFILE_ENV_FILE -e 'DYNO='\\''web.1'\\''' -e TRACE=true dokku/mysite:v3\r\n+ local id=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n++ docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ local ipaddr=172.17.0.3\r\n+ [[ -z 172.17.0.3 ]]\r\n++ is_app_checks_enabled mysite\r\n++ declare 'desc=return app zero-downtime checks status'\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite DOKKU_CHECKS_ENABLED\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ config_parse_args config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_CHECKS_ENABLED\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_CHECKS_ENABLED\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_CHECKS_ENABLED\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_CHECKS_ENABLED='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOKKU_CHECKS_ENABLED=\r\n++ [[ -z '' ]]\r\n++ local status=true\r\n++ echo true\r\n+ [[ true == \\f\\a\\l\\s\\e ]]\r\n+ trap 'kill_new $id' INT TERM EXIT\r\n+ dokku_log_info1 'Running pre-flight checks'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Running pre-flight checks'\r\n-----> Running pre-flight checks\r\n+ plugn trigger check-deploy mysite c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119 web 5000 172.17.0.3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/checks/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ checks_check_deploy mysite c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119 web 5000 172.17.0.3\r\n+ declare 'desc=checks check-deploy plugin trigger'\r\n+ local trigger=checks_check_deploy\r\n+ local APP=mysite\r\n+ local DOKKU_APP_CONTAINER_ID=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ local DOKKU_APP_CONTAINER_TYPE=web\r\n+ local DOKKU_APP_LISTEN_PORT=5000\r\n+ local DOKKU_APP_LISTEN_IP=172.17.0.3\r\n+ [[ -z 5000 ]]\r\n+ [[ -z 172.17.0.3 ]]\r\n+ [[ -z c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119 ]]\r\n++ config_export global\r\n++ declare 'desc=returns export command for config variable of specified type (app/global)'\r\n++ local CONFIG_TYPE=global\r\n++ local APP=\r\n++ local ENV_FILE=/home/dokku//ENV\r\n++ [[ global == \\g\\l\\o\\b\\a\\l ]]\r\n++ local ENV_FILE=/home/dokku/ENV\r\n++ [[ ! -f /home/dokku/ENV ]]\r\n++ [[ ! -s /home/dokku/ENV ]]\r\n++ return 0\r\n+ eval ''\r\n++ config_export app mysite\r\n++ declare 'desc=returns export command for config variable of specified type (app/global)'\r\n++ local CONFIG_TYPE=app\r\n++ local APP=mysite\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ app == \\g\\l\\o\\b\\a\\l ]]\r\n++ [[ ! -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ cut '-d ' -f2-\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local 'VARS=DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n++ awk '{print \"export \" $0}'\r\n++ echo 'DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n++ return 0\r\n+ eval 'export DOKKU_APP_RESTORE='\\''1'\\''\r\nexport DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\'''\r\n++ export DOKKU_APP_RESTORE=1\r\n++ DOKKU_APP_RESTORE=1\r\n++ export DOKKU_NGINX_PORT=80\r\n++ DOKKU_NGINX_PORT=80\r\n++ export NO_VHOST=0\r\n++ NO_VHOST=0\r\n++ is_app_checks_enabled mysite\r\n++ declare 'desc=return app zero-downtime checks status'\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite DOKKU_CHECKS_ENABLED\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ config_parse_args config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_CHECKS_ENABLED == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_CHECKS_ENABLED\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_CHECKS_ENABLED\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_CHECKS_ENABLED\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_CHECKS_ENABLED\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_CHECKS_ENABLED='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOKKU_CHECKS_ENABLED=\r\n++ [[ -z '' ]]\r\n++ local status=true\r\n++ echo true\r\n+ [[ true == \\f\\a\\l\\s\\e ]]\r\n+ local WAIT=5\r\n+ local TIMEOUT=30\r\n+ local ATTEMPTS=5\r\n++ mktemp -d /tmp/dokku_CHECKS.XXXXX\r\n+ local CHECK_DEPLOY_TMP_WORK_DIR=/tmp/dokku_CHECKS.EaQgT\r\n+ docker cp c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119:/app/CHECKS /tmp/dokku_CHECKS.EaQgT\r\n+ true\r\n+ local FILENAME=/tmp/dokku_CHECKS.EaQgT/CHECKS\r\n+ trap 'checks_check_deploy_cleanup $DOKKU_APP_CONTAINER_ID' RETURN INT TERM EXIT\r\n+ [[ ! -s /tmp/dokku_CHECKS.EaQgT/CHECKS ]]\r\n+ [[ web == \\w\\e\\b ]]\r\n+ dokku_log_verbose 'For more efficient zero downtime deployments, create a file CHECKS.'\r\n+ declare 'desc=log verbose formatter'\r\n+ echo '       For more efficient zero downtime deployments, create a file CHECKS.'\r\n       For more efficient zero downtime deployments, create a file CHECKS.\r\n+ dokku_log_verbose 'See http://dokku.viewdocs.io/dokku/checks-examples.md for examples'\r\n+ declare 'desc=log verbose formatter'\r\n+ echo '       See http://dokku.viewdocs.io/dokku/checks-examples.md for examples'\r\n       See http://dokku.viewdocs.io/dokku/checks-examples.md for examples\r\n+ dokku_log_verbose 'CHECKS file not found in container: Running simple container check...'\r\n+ declare 'desc=log verbose formatter'\r\n+ echo '       CHECKS file not found in container: Running simple container check...'\r\n       CHECKS file not found in container: Running simple container check...\r\n+ rm -rf /tmp/dokku_CHECKS.EaQgT\r\n+ local DOKKU_DEFAULT_CHECKS_WAIT=10\r\n+ dokku_log_info1 'Waiting for 10 seconds ...'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Waiting for 10 seconds ...'\r\n-----> Waiting for 10 seconds ...\r\n+ sleep 10\r\n+ is_container_running c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ declare 'desc=return 0 if given docker container id is in running state'\r\n+ local CID=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n++ docker inspect -f '{{.State.Running}}' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ local CONTAINER_STATUS=true\r\n+ [[ true == \\t\\r\\u\\e ]]\r\n+ return 0\r\n++ docker inspect -f '{{ .RestartCount }}' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ local container_restarts=0\r\n+ [[ 0 -ne 0 ]]\r\n+ trap - EXIT\r\n+ dokku_log_info1 'Default container check successful!'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Default container check successful!'\r\n-----> Default container check successful!\r\n+ exit 0\r\n+ trap - INT TERM EXIT\r\n+ [[ -n c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119 ]]\r\n+ echo c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ [[ -n 172.17.0.3 ]]\r\n+ echo 172.17.0.3\r\n+ [[ -n 5000 ]]\r\n+ echo 5000\r\n+ rm -f /home/dokku/mysite/CONTAINER /home/dokku/mysite/IP /home/dokku/mysite/PORT\r\n+ local CONTAINER_INDEX=2\r\n+ [[ 2 -le 1 ]]\r\n+ [[ 1 == 0 ]]\r\n+ local CONTAINER_IDX_OFFSET=2\r\n+ local container_state_filetype\r\n+ for container_state_filetype in CONTAINER IP PORT\r\n+ cd /home/dokku/mysite\r\n+ xargs rm -f\r\n+ tail -n +2\r\n+ sort -t . -k 3 -n\r\n+ find . -maxdepth 1 -name 'CONTAINER.web.*' -printf '%f\\n'\r\n+ for container_state_filetype in CONTAINER IP PORT\r\n+ cd /home/dokku/mysite\r\n+ xargs rm -f\r\n+ tail -n +2\r\n+ sort -t . -k 3 -n\r\n+ find . -maxdepth 1 -name 'IP.web.*' -printf '%f\\n'\r\n+ for container_state_filetype in CONTAINER IP PORT\r\n+ cd /home/dokku/mysite\r\n+ xargs rm -f\r\n+ tail -n +2\r\n+ sort -t . -k 3 -n\r\n+ find . -maxdepth 1 -name 'PORT.web.*' -printf '%f\\n'\r\n+ read -r line\r\n+ [[ -n '' ]]\r\n+ dokku_log_info1 'Running post-deploy'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Running post-deploy'\r\n-----> Running post-deploy\r\n+ plugn trigger post-deploy mysite 5000 172.17.0.3 v3\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ exec_app_json_scripts mysite 5000 172.17.0.3 v3\r\n+ declare 'desc=core app.json scripts execution'\r\n+ local 'trigger=/var/lib/dokku/plugins/enabled/00_dokku-standard/post-deploy app_json_scripts'\r\n+ local APP=mysite\r\n+ case \"$0\" in\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local PHASE_SCRIPT_KEY=postdeploy\r\n+ dokku_log_info1 'Attempting to run scripts.dokku.postdeploy from app.json (if defined)'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)'\r\n-----> Attempting to run scripts.dokku.postdeploy from app.json (if defined)\r\n+ execute_script mysite dokku/mysite:v3 postdeploy\r\n+ declare 'desc=executes appropriate phase script key from app.json'\r\n+ local APP=mysite\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local PHASE_SCRIPT_KEY=postdeploy\r\n++ get_phase_script dokku/mysite:v3 postdeploy\r\n+ local SCRIPT_CMD=\r\n+ [[ -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ named_containers_post_deploy mysite 5000 172.17.0.3 v3\r\n+ declare 'desc=names deployed app container is consistent manner'\r\n+ local trigger=named_containers_post_deploy\r\n+ local APP=mysite\r\n+ local APP_ROOT=/home/dokku/mysite\r\n++ stat -t /home/dokku/mysite/CONTAINER.web.1\r\n+ [[ -z /home/dokku/mysite/CONTAINER.web.1 65 8 81a4 1000 1000 fc00 1439007 1 0 0 1462056624 1462058575 1462058575 0 4096 ]]\r\n+ local container\r\n+ for container in '\"$APP_ROOT\"/CONTAINER.*'\r\n++ sed -r 's/.*CONTAINER\\.(.*)/\\1/'\r\n++ echo /home/dokku/mysite/CONTAINER.web.1\r\n+ local DYNO=web.1\r\n+ local NAME=mysite.web.1\r\n+ local CURRENT_CONTAINER_ID=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n++ xargs\r\n++ docker ps -a -q -f 'name=^.?mysite.web.1$'\r\n+ local PREVIOUS_CIDS=d71c31e90d7d\r\n+ [[ -n d71c31e90d7d ]]\r\n+ dokku_log_info1_quiet 'Found previous container(s) (d71c31e90d7d) named mysite.web.1'\r\n+ declare 'desc=log info1 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '-----> Found previous container(s) (d71c31e90d7d) named mysite.web.1'\r\n-----> Found previous container(s) (d71c31e90d7d) named mysite.web.1\r\n+ local cid\r\n+ for cid in '$PREVIOUS_CIDS'\r\n++ docker inspect -f '{{.State.Status}}' d71c31e90d7d\r\n+ local PREVIOUS_CONTAINER_STATUS=running\r\n+ [[ running != \\d\\e\\a\\d ]]\r\n++ date +%s\r\n+ local CONTAINER_DATE_NAME=mysite.web.1.1462058575\r\n+ dokku_log_info2_quiet 'renaming container (d71c31e90d7d) mysite.web.1 to mysite.web.1.1462058575'\r\n+ declare 'desc=log info2 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '=====> renaming container (d71c31e90d7d) mysite.web.1 to mysite.web.1.1462058575'\r\n=====> renaming container (d71c31e90d7d) mysite.web.1 to mysite.web.1.1462058575\r\n+ docker rename mysite.web.1 mysite.web.1.1462058575\r\n++ cat /home/dokku/mysite/CONTAINER.web.1\r\n+ local ID=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n++ tr -d /\r\n++ docker inspect -f '{{.Name}}' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+ local CURRENT_NAME=admiring_stonebraker\r\n+ dokku_log_info2_quiet 'renaming container (c757825c00b8) admiring_stonebraker to mysite.web.1'\r\n+ declare 'desc=log info2 formatter (with quiet option)'\r\n+ [[ -z '' ]]\r\n+ echo '=====> renaming container (c757825c00b8) admiring_stonebraker to mysite.web.1'\r\n=====> renaming container (c757825c00b8) admiring_stonebraker to mysite.web.1\r\n+ docker rename admiring_stonebraker mysite.web.1\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/domains/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ source /var/lib/dokku/plugins/available/nginx-vhosts/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/certs/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ source /var/lib/dokku/plugins/available/domains/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ source /var/lib/dokku/plugins/available/ps/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+++ source /var/lib/dokku/plugins/available/config/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++++ set -eo pipefail\r\n+++++ [[ -n 1 ]]\r\n+++++ set -x\r\n+ source /var/lib/dokku/plugins/available/proxy/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ get_app_proxy_type mysite\r\n++ declare 'desc=return app proxy type'\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ local APP_PROXY_TYPE=nginx\r\n++ echo nginx\r\n+ [[ nginx == \\n\\g\\i\\n\\x ]]\r\n+ nginx_post_deploy mysite 5000 172.17.0.3 v3\r\n+ declare 'desc=nginx-vhosts post-deploy plugin trigger'\r\n+ local trigger=nginx_post_deploy\r\n+ local APP=mysite\r\n+ [[ -f /home/dokku/mysite/IP.web.1 ]]\r\n+ [[ -f /home/dokku/mysite/PORT.web.1 ]]\r\n++ is_app_vhost_enabled mysite\r\n++ declare 'desc=returns true or false if vhost support is enabled for a given application'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite NO_VHOST\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ config_parse_args config:get mysite NO_VHOST\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ NO_VHOST == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ NO_VHOST == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=NO_VHOST\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export NO_VHOST='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local NO_VHOST=0\r\n++ local APP_VHOST_ENABLED=true\r\n++ [[ 0 == \\1 ]]\r\n++ echo true\r\n+ [[ true == \\f\\a\\l\\s\\e ]]\r\n+ [[ ! -f /home/dokku/mysite/VHOST ]]\r\n+ nginx_build_config mysite\r\n+ declare 'desc=build nginx config to proxy app containers using sigil'\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ local DOKKU_APP_LISTEN_PORT=\r\n+ local DOKKU_APP_LISTEN_IP=\r\n+ local VHOST_PATH=/home/dokku/mysite/VHOST\r\n+ local URLS_PATH=/home/dokku/mysite/URLS\r\n+ local NGINX_TEMPLATE_NAME=nginx.conf.sigil\r\n+ local DEFAULT_NGINX_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil\r\n+ local NGINX_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil\r\n+ local SCHEME=http\r\n+ local NGINX_TEMPLATE_SOURCE=built-in\r\n+ local APP_SSL_PATH=/home/dokku/mysite/tls\r\n++ get_app_raw_tcp_ports mysite\r\n++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ config_parse_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_DOCKERFILE_PORTS\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_DOCKERFILE_PORTS='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOCKERFILE_PORTS=\r\n+++ xargs\r\n+++ echo ''\r\n++ local raw_tcp_ports=\r\n++ echo ''\r\n+ local RAW_TCP_PORTS=\r\n++ config_get mysite DOKKU_DISABLE_PROXY\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n++ config_parse_args config:get mysite DOKKU_DISABLE_PROXY\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_DISABLE_PROXY == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DISABLE_PROXY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DISABLE_PROXY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DISABLE_PROXY\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DISABLE_PROXY\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DISABLE_PROXY\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_DISABLE_PROXY\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_DISABLE_PROXY='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local DOKKU_DISABLE_PROXY=\r\n++ is_app_vhost_enabled mysite\r\n++ declare 'desc=returns true or false if vhost support is enabled for a given application'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite NO_VHOST\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ config_parse_args config:get mysite NO_VHOST\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ NO_VHOST == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ NO_VHOST == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=NO_VHOST\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export NO_VHOST='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local NO_VHOST=0\r\n++ local APP_VHOST_ENABLED=true\r\n++ [[ 0 == \\1 ]]\r\n++ echo true\r\n+ local IS_APP_VHOST_ENABLED=true\r\n+ [[ -z '' ]]\r\n+ [[ -z '' ]]\r\n+ [[ -z '' ]]\r\n+ shopt -s nullglob\r\n+ local DOKKU_APP_IP_FILE\r\n+ for DOKKU_APP_IP_FILE in '$DOKKU_ROOT/$APP/IP.web.*'\r\n+ local DOKKU_APP_PORT_FILE=/home/dokku/mysite/PORT.web.1\r\n+ local DOKKU_APP_LISTENER_IP=172.17.0.3\r\n+ local DOKKU_APP_LISTENER_PORT=5000\r\n+ [[ -z '' ]]\r\n+ local 'DOKKU_APP_LISTENERS+= 172.17.0.3:5000 '\r\n++ xargs\r\n++ echo ' 172.17.0.3:5000 '\r\n+ local DOKKU_APP_LISTENERS=172.17.0.3:5000\r\n+ shopt -u nullglob\r\n++ mktemp -d /tmp/dokku_nginx_template.XXXXX\r\n+ local NGINX_BUILD_CONFIG_TMP_WORK_DIR=/tmp/dokku_nginx_template.aZgT2\r\n++ mktemp --tmpdir=/tmp/dokku_nginx_template.aZgT2 nginx.conf.XXXXXX\r\n+ local NGINX_CONF=/tmp/dokku_nginx_template.aZgT2/nginx.conf.8wBvS5\r\n+ local CUSTOM_NGINX_TEMPLATE=/tmp/dokku_nginx_template.aZgT2/nginx.conf.sigil\r\n+ trap 'rm -rf $NGINX_CONF $NGINX_BUILD_CONFIG_TMP_WORK_DIR > /dev/null' RETURN INT TERM EXIT\r\n+ get_custom_nginx_template mysite /tmp/dokku_nginx_template.aZgT2/nginx.conf.sigil\r\n+ declare 'desc=attempts to copy custom nginx template from app image'\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ local DESTINATION=/tmp/dokku_nginx_template.aZgT2/nginx.conf.sigil\r\n++ get_running_image_tag mysite\r\n++ declare 'desc=retrieve current image tag for a given app. returns empty string if no deployed containers are found'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ CIDS=($(get_app_container_ids \"$APP\"))\r\n+++ get_app_container_ids mysite\r\n+++ declare 'desc=returns list of docker container ids for given app'\r\n+++ local APP=mysite\r\n+++ local CONTAINER_TYPE=\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ [[ -f /home/dokku/mysite/CONTAINER ]]\r\n+++ [[ -n '' ]]\r\n+++ local 'CONTAINER_PATTERN=/home/dokku/mysite/CONTAINER.*'\r\n+++ shopt -s nullglob\r\n+++ local DOKKU_CID_FILE\r\n+++ for DOKKU_CID_FILE in '$CONTAINER_PATTERN'\r\n+++ local 'DOKKU_CIDS+= '\r\n+++ local DOKKU_CIDS+=c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n+++ local 'DOKKU_CIDS+= '\r\n+++ shopt -u nullglob\r\n+++ echo ' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119 '\r\n++ local CIDS\r\n+++ awk -F: '{ print $2 }'\r\n+++ docker inspect -f '{{ .Config.Image }}' c757825c00b8270e07bd10a8b22b8f37f1a8a0780a1c1975d854f27ac0622119\r\n++ local RUNNING_IMAGE_TAG=v3\r\n++ echo v3\r\n+ local IMAGE_TAG=v3\r\n++ get_app_image_name mysite v3\r\n++ declare 'desc=return image identifier for a given app, tag tuple. validate if tag is presented'\r\n++ local APP=mysite\r\n++ local IMAGE_TAG=v3\r\n+++ get_app_image_repo mysite\r\n+++ declare 'desc=central definition of image repo pattern'\r\n+++ local APP=mysite\r\n+++ local IMAGE_REPO=dokku/mysite\r\n+++ [[ -z mysite ]]\r\n+++ echo dokku/mysite\r\n++ local IMAGE_REPO=dokku/mysite\r\n++ [[ -z mysite ]]\r\n++ [[ -n v3 ]]\r\n++ local IMAGE=dokku/mysite:v3\r\n++ verify_image dokku/mysite:v3\r\n++ declare 'desc=verify image existence'\r\n++ local IMAGE=dokku/mysite:v3\r\n++ docker inspect dokku/mysite:v3\r\n++ return 0\r\n++ echo dokku/mysite:v3\r\n+ local IMAGE=dokku/mysite:v3\r\n+ local NGINX_TEMPLATE_NAME=nginx.conf.sigil\r\n+ copy_from_image dokku/mysite:v3 nginx.conf.sigil /tmp/dokku_nginx_template.aZgT2/nginx.conf.sigil\r\n+ [[ -f /tmp/dokku_nginx_template.aZgT2/nginx.conf.sigil ]]\r\n+ configure_nginx_ports mysite\r\n+ declare 'desc=configure nginx listening ports'\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n++ get_app_raw_tcp_ports mysite\r\n++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ config_parse_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_DOCKERFILE_PORTS\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_DOCKERFILE_PORTS='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOCKERFILE_PORTS=\r\n+++ xargs\r\n+++ echo ''\r\n++ local raw_tcp_ports=\r\n++ echo ''\r\n+ local RAW_TCP_PORTS=\r\n++ config_get mysite DOKKU_NGINX_PORT\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ config_parse_args config:get mysite DOKKU_NGINX_PORT\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_NGINX_PORT\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_NGINX_PORT='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local DOKKU_NGINX_PORT=80\r\n++ config_get mysite DOKKU_NGINX_SSL_PORT\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ config_parse_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_NGINX_SSL_PORT\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_NGINX_SSL_PORT='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local DOKKU_NGINX_SSL_PORT=\r\n++ is_app_vhost_enabled mysite\r\n++ declare 'desc=returns true or false if vhost support is enabled for a given application'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite NO_VHOST\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ config_parse_args config:get mysite NO_VHOST\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ NO_VHOST == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ NO_VHOST == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ NO_VHOST == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite NO_VHOST\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite NO_VHOST\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=NO_VHOST\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export NO_VHOST='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local NO_VHOST=0\r\n++ local APP_VHOST_ENABLED=true\r\n++ [[ 0 == \\1 ]]\r\n++ echo true\r\n+ local IS_APP_VHOST_ENABLED=true\r\n+ [[ -z 80 ]]\r\n+ is_ssl_enabled mysite\r\n+ declare 'desc=returns 0 if ssl is enabled for given app'\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ local APP_SSL_PATH=/home/dokku/mysite/tls\r\n+ [[ -e /home/dokku/mysite/tls/server.crt ]]\r\n+ return 1\r\n++ config_get mysite DOKKU_NGINX_PORT\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ config_parse_args config:get mysite DOKKU_NGINX_PORT\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_NGINX_PORT == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_PORT\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_NGINX_PORT\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_NGINX_PORT='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local NGINX_PORT=80\r\n++ config_get mysite DOKKU_NGINX_SSL_PORT\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ config_parse_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_NGINX_SSL_PORT == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_NGINX_SSL_PORT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_NGINX_SSL_PORT\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_NGINX_SSL_PORT\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_NGINX_SSL_PORT='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local NGINX_SSL_PORT=\r\n++ get_app_domains mysite\r\n++ declare 'desc=return app domains'\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ local APP=mysite\r\n++ local APP_VHOST_FILE=/home/dokku/mysite/VHOST\r\n++ local GLOBAL_VHOST_PATH=/home/dokku/VHOST\r\n++ local GLOBAL_HOSTNAME_PATH=/home/dokku/HOSTNAME\r\n+++ is_app_vhost_enabled mysite\r\n+++ declare 'desc=returns true or false if vhost support is enabled for a given application'\r\n+++ source /var/lib/dokku/plugins/available/config/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++++ set -eo pipefail\r\n+++++ [[ -n 1 ]]\r\n+++++ set -x\r\n+++ local APP=mysite\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n++++ config_get mysite NO_VHOST\r\n++++ declare 'desc=get value of given config var'\r\n++++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++++ set -- config:get mysite NO_VHOST\r\n++++ config_parse_args config:get mysite NO_VHOST\r\n++++ declare 'desc=parse config plugin args'\r\n++++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++++ for var in '\"$@\"'\r\n++++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++++ for var in '\"$@\"'\r\n++++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++++ for var in '\"$@\"'\r\n++++ [[ NO_VHOST == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++++ [[ NO_VHOST == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++++ [[ NO_VHOST == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++++ [[ NO_VHOST == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n+++++ local 'desc=return sanitized arguments for config plugin'\r\n+++++ SANITIZED_ARGS=(\"$@\")\r\n+++++ local SANITIZED_ARGS\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++++ echo config:get mysite NO_VHOST\r\n++++ local SANITIZED_ARGS\r\n++++ set -- config:get mysite NO_VHOST\r\n++++ DOKKU_CONFIG_TYPE=app\r\n++++ DOKKU_CONFIG_RESTART=true\r\n++++ [[ app == \\a\\p\\p ]]\r\n++++ [[ -z mysite ]]\r\n++++ verify_app_name mysite\r\n++++ declare 'desc=verify app name format and app existence'\r\n++++ local APP=mysite\r\n++++ [[ ! -n mysite ]]\r\n++++ [[ ! mysite =~ ^[a-z].* ]]\r\n++++ [[ ! -d /home/dokku/mysite ]]\r\n++++ return 0\r\n++++ APP=mysite\r\n++++ ENV_FILE=/home/dokku/mysite/ENV\r\n++++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++++ get_sanitized_config_args config:get mysite NO_VHOST\r\n+++++ local 'desc=return sanitized arguments for config plugin'\r\n+++++ SANITIZED_ARGS=(\"$@\")\r\n+++++ local SANITIZED_ARGS\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++++ echo config:get mysite NO_VHOST\r\n++++ local SANITIZED_ARGS\r\n++++ set -- config:get mysite NO_VHOST\r\n++++ [[ -z mysite ]]\r\n++++ config_create /home/dokku/mysite/ENV\r\n++++ declare 'desc=create config env file'\r\n++++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++++ [[ -f /home/dokku/mysite/ENV ]]\r\n++++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++++ local KEY=NO_VHOST\r\n++++ cut -d= -f2-\r\n++++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++++ grep '^export NO_VHOST='\r\n++++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+++ local NO_VHOST=0\r\n+++ local APP_VHOST_ENABLED=true\r\n+++ [[ 0 == \\1 ]]\r\n+++ echo true\r\n++ [[ true == \\t\\r\\u\\e ]]\r\n++ [[ -f /home/dokku/mysite/VHOST ]]\r\n++ cat /home/dokku/mysite/VHOST\r\n+ local NONSSL_VHOSTS=mysite.dokku.me\r\n++ xargs\r\n++ echo mysite.dokku.me\r\n+ local NOSSL_SERVER_NAME=mysite.dokku.me\r\n+ is_ssl_enabled mysite\r\n+ declare 'desc=returns 0 if ssl is enabled for given app'\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ local APP_SSL_PATH=/home/dokku/mysite/tls\r\n+ [[ -e /home/dokku/mysite/tls/server.crt ]]\r\n+ return 1\r\n++ config_export app mysite\r\n++ declare 'desc=returns export command for config variable of specified type (app/global)'\r\n++ local CONFIG_TYPE=app\r\n++ local APP=mysite\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ app == \\g\\l\\o\\b\\a\\l ]]\r\n++ [[ ! -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ cut '-d ' -f2-\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local 'VARS=DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n++ awk '{print \"export \" $0}'\r\n++ echo 'DOKKU_APP_RESTORE='\\''1'\\''\r\nDOKKU_NGINX_PORT='\\''80'\\''\r\nNO_VHOST='\\''0'\\'''\r\n++ return 0\r\n+ eval 'export DOKKU_APP_RESTORE='\\''1'\\''\r\nexport DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\'''\r\n++ export DOKKU_APP_RESTORE=1\r\n++ DOKKU_APP_RESTORE=1\r\n++ export DOKKU_NGINX_PORT=80\r\n++ DOKKU_NGINX_PORT=80\r\n++ export NO_VHOST=0\r\n++ NO_VHOST=0\r\n+ 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\")\r\n+ local SIGIL_PARAMS\r\n+ xargs -i echo '-----> Configuring {}...(using built-in template)'\r\n++ sort -u\r\n++ tr ' ' '\\n'\r\n++ echo '' mysite.dokku.me\r\n-----> Configuring mysite.dokku.me...(using built-in template)\r\n+ sigil -f /var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil APP=mysite DOKKU_ROOT=/home/dokku NOSSL_SERVER_NAME=mysite.dokku.me DOKKU_APP_LISTENERS=172.17.0.3:5000 PASSED_LISTEN_IP_PORT= DOKKU_APP_LISTEN_PORT= DOKKU_APP_LISTEN_IP= APP_SSL_PATH=/home/dokku/mysite/tls SSL_INUSE= SSL_SERVER_NAME= NGINX_PORT=80 NGINX_SSL_PORT= RAW_TCP_PORTS=\r\n+ is_deployed mysite\r\n+ declare 'desc=return 0 if given app has a running container'\r\n+ local APP=mysite\r\n+ [[ -f /home/dokku/mysite/CONTAINER ]]\r\n++ ls /home/dokku/mysite/CONTAINER.web.1\r\n++ echo 0\r\n+ [[ 0 -eq 0 ]]\r\n+ return 0\r\n+ dokku_log_info1 'Creating http nginx.conf'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Creating http nginx.conf'\r\n-----> Creating http nginx.conf\r\n+ mv /tmp/dokku_nginx_template.aZgT2/nginx.conf.8wBvS5 /home/dokku/mysite/nginx.conf\r\n+ is_deployed mysite\r\n+ declare 'desc=return 0 if given app has a running container'\r\n+ local APP=mysite\r\n+ [[ -f /home/dokku/mysite/CONTAINER ]]\r\n++ ls /home/dokku/mysite/CONTAINER.web.1\r\n++ echo 0\r\n+ [[ 0 -eq 0 ]]\r\n+ return 0\r\n+ dokku_log_info1 'Running nginx-pre-reload'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Running nginx-pre-reload'\r\n-----> Running nginx-pre-reload\r\n+ plugn trigger nginx-pre-reload mysite '' ''\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ [[ ! -n '' ]]\r\n+ dokku_log_verbose 'Reloading nginx'\r\n+ declare 'desc=log verbose formatter'\r\n+ echo '       Reloading nginx'\r\n       Reloading nginx\r\n+ validate_nginx\r\n+ declare 'desc=validate entire nginx config'\r\n+ set +e\r\n+ sudo /usr/sbin/nginx -t\r\n+ local exit_code=0\r\n+ set -e\r\n+ [[ 0 -ne 0 ]]\r\n+ restart_nginx\r\n+ declare 'desc=restart nginx for given distros'\r\n+ case \"$DOKKU_DISTRO\" in\r\n+ sudo /etc/init.d/nginx reload\r\n+ [[ -n mysite.dokku.me ]]\r\n+ [[ true == \\t\\r\\u\\e ]]\r\n+ echo '# THIS FILE IS GENERATED BY DOKKU - DO NOT EDIT, YOUR CHANGES WILL BE OVERWRITTEN'\r\n+ xargs -i echo 'http://{}'\r\n++ sort -u\r\n++ tr ' ' '\\n'\r\n++ echo '' mysite.dokku.me\r\n++ rm -rf /tmp/dokku_nginx_template.aZgT2/nginx.conf.8wBvS5 /tmp/dokku_nginx_template.aZgT2\r\n++ rm -rf\r\n+ rm -rf\r\n+ source /var/lib/dokku/core-plugins/available/common/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ source /var/lib/dokku/plugins/available/ps/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ ps_post_deploy mysite 5000 172.17.0.3 v3\r\n+ declare 'desc=ps post-deploy plugin trigger'\r\n+ local trigger=ps_post_deploy\r\n+ local APP=mysite\r\n+ remove_procfile mysite\r\n+ declare 'desc=removes DOKKU_PROCFILE'\r\n+ local APP=mysite\r\n+ local DOKKU_PROCFILE=/home/dokku/mysite/DOKKU_PROCFILE\r\n+ [[ -f /home/dokku/mysite/DOKKU_PROCFILE ]]\r\n+ config_set --no-restart mysite DOKKU_APP_RESTORE=1\r\n+ declare 'desc=set value of given config var'\r\n+ [[ --no-restart == \\c\\o\\n\\f\\i\\g\\:\\s\\e\\t ]]\r\n+ set -- config:set --no-restart mysite DOKKU_APP_RESTORE=1\r\n+ config_parse_args config:set --no-restart mysite DOKKU_APP_RESTORE=1\r\n+ declare 'desc=parse config plugin args'\r\n+ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+ for var in '\"$@\"'\r\n+ [[ config:set == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ config:set == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ [[ config:set == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+ [[ config:set == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+ for var in '\"$@\"'\r\n+ [[ --no-restart == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ --no-restart == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ DOKKU_CONFIG_RESTART=false\r\n+ [[ --no-restart == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+ [[ --no-restart == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+ for var in '\"$@\"'\r\n+ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+ for var in '\"$@\"'\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++ get_sanitized_config_args config:set --no-restart mysite DOKKU_APP_RESTORE=1\r\n++ local 'desc=return sanitized arguments for config plugin'\r\n++ SANITIZED_ARGS=(\"$@\")\r\n++ local SANITIZED_ARGS\r\n++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++ echo config:set '' mysite DOKKU_APP_RESTORE=1\r\n+ local SANITIZED_ARGS\r\n+ set -- config:set mysite DOKKU_APP_RESTORE=1\r\n+ DOKKU_CONFIG_TYPE=app\r\n+ DOKKU_CONFIG_RESTART=false\r\n+ [[ app == \\a\\p\\p ]]\r\n+ [[ -z mysite ]]\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n+ APP=mysite\r\n+ ENV_FILE=/home/dokku/mysite/ENV\r\n+ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+ [[ -z mysite DOKKU_APP_RESTORE=1 ]]\r\n+ config_create /home/dokku/mysite/ENV\r\n+ declare 'desc=create config env file'\r\n+ local ENV_FILE=/home/dokku/mysite/ENV\r\n+ [[ -f /home/dokku/mysite/ENV ]]\r\n+ local ENV_ADD=\r\n++ cat /home/dokku/mysite/ENV\r\n+ local 'ENV_TEMP=export DOKKU_APP_RESTORE='\\''1'\\''\r\nexport DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\'''\r\n+ local RESTART_APP=false\r\n+ shift 2\r\n+ for var in '\"$@\"'\r\n+ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ [[ -n mysite ]]\r\n+ [[ mysite == \\t\\h\\e\\o\\a\\k\\.\\c\\o ]]\r\n+ shift 1\r\n+ for var in '\"$@\"'\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+ [[ DOKKU_APP_RESTORE=1 == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+ [[ -n mysite ]]\r\n+ [[ DOKKU_APP_RESTORE=1 == \\t\\h\\e\\o\\a\\k\\.\\c\\o ]]\r\n+ [[ DOKKU_APP_RESTORE=1 != *\\=* ]]\r\n+ for var in '\"$@\"'\r\n++ cut -d= -f1\r\n++ echo DOKKU_APP_RESTORE=1\r\n+ local KEY=DOKKU_APP_RESTORE\r\n++ cut -d= -f2-\r\n++ echo DOKKU_APP_RESTORE=1\r\n+ local VALUE=1\r\n+ [[ DOKKU_APP_RESTORE =~ [a-zA-Z_][a-zA-Z0-9_]* ]]\r\n+ local RESTART_APP=true\r\n++ sed '/^export DOKKU_APP_RESTORE=/ d'\r\n++ echo 'export DOKKU_APP_RESTORE='\\''1'\\''\r\nexport DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\'''\r\n+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\'''\r\n+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\''\r\nexport DOKKU_APP_RESTORE='\\''1'\\'''\r\n++ sed '/^DOKKU_APP_RESTORE=/ d'\r\n++ echo -e ''\r\n+ local ENV_ADD=\r\n+ local 'ENV_ADD=$\r\nDOKKU_APP_RESTORE=1'\r\n++ tail -n +2\r\n++ echo '$\r\nDOKKU_APP_RESTORE=1'\r\n+ local ENV_ADD=DOKKU_APP_RESTORE=1\r\n+ [[ -n true ]]\r\n+ dokku_log_info1 'Setting config vars'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Setting config vars'\r\n-----> Setting config vars\r\n+ config_styled_hash DOKKU_APP_RESTORE=1 '       '\r\n+ declare 'desc=internal config hash'\r\n+ local vars=DOKKU_APP_RESTORE=1\r\n+ local 'prefix=       '\r\n+ local longest=\r\n+ read -r word\r\n++ cut -d= -f1\r\n++ echo DOKKU_APP_RESTORE=1\r\n+ local KEY=DOKKU_APP_RESTORE\r\n+ [[ 17 -gt 0 ]]\r\n+ local longest=DOKKU_APP_RESTORE\r\n+ read -r word\r\n+ read -r word\r\n++ cut -d= -f1\r\n++ echo DOKKU_APP_RESTORE=1\r\n+ local KEY=DOKKU_APP_RESTORE\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//' -e 's/$$//g'\r\n++ cut -d= -f2-\r\n++ echo DOKKU_APP_RESTORE=1\r\n+ local VALUE=1\r\n+ local num_zeros=0\r\n+ local 'zeros= '\r\n+ [[ 0 -gt 0 ]]\r\n+ echo '       DOKKU_APP_RESTORE: 1'\r\n       DOKKU_APP_RESTORE: 1\r\n+ read -r word\r\n+ config_write 'export DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\''\r\nexport DOKKU_APP_RESTORE='\\''1'\\'''\r\n+ declare 'desc=writes config vars out to appropriate file path'\r\n+ local 'ENV_TEMP=export DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\''\r\nexport DOKKU_APP_RESTORE='\\''1'\\'''\r\n+ local ENV_FILE_TEMP=/home/dokku/mysite/ENV.tmp\r\n+ sort\r\n+ sed '/^$/d'\r\n+ echo 'export DOKKU_NGINX_PORT='\\''80'\\''\r\nexport NO_VHOST='\\''0'\\''\r\nexport DOKKU_APP_RESTORE='\\''1'\\'''\r\n+ cmp -s /home/dokku/mysite/ENV /home/dokku/mysite/ENV.tmp\r\n+ rm -f /home/dokku/mysite/ENV.tmp\r\n+ plugn trigger post-config-update mysite set DOKKU_APP_RESTORE=1\r\n+ [[ -n mysite ]]\r\n++ config_get mysite DOKKU_APP_RESTORE\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_APP_RESTORE\r\n++ config_parse_args config:get mysite DOKKU_APP_RESTORE\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_APP_RESTORE == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_APP_RESTORE == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_APP_RESTORE == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_APP_RESTORE == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_APP_RESTORE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_APP_RESTORE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_APP_RESTORE\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_APP_RESTORE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_APP_RESTORE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_APP_RESTORE\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_APP_RESTORE\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_APP_RESTORE='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n+ local DOKKU_APP_RESTORE=1\r\n+ [[ false == \\t\\r\\u\\e ]]\r\n+ [[ -n  d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356  ]]\r\n+ [[ -z '' ]]\r\n++ config_get mysite DOKKU_WAIT_TO_RETIRE\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ config_parse_args config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_WAIT_TO_RETIRE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_WAIT_TO_RETIRE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_WAIT_TO_RETIRE\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_WAIT_TO_RETIRE\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_WAIT_TO_RETIRE='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ true\r\n+ local DOKKU_APP_DOKKU_WAIT_TO_RETIRE=\r\n++ config_get --global DOKKU_WAIT_TO_RETIRE\r\n++ declare 'desc=get value of given config var'\r\n++ [[ --global == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get --global DOKKU_WAIT_TO_RETIRE\r\n++ config_parse_args config:get --global DOKKU_WAIT_TO_RETIRE\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ --global == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ ENV_FILE=/home/dokku/ENV\r\n++ DOKKU_CONFIG_TYPE=global\r\n++ DOKKU_CONFIG_RESTART=false\r\n++ [[ --global == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ --global == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ --global == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_WAIT_TO_RETIRE == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get --global DOKKU_WAIT_TO_RETIRE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get '' DOKKU_WAIT_TO_RETIRE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get DOKKU_WAIT_TO_RETIRE\r\n++ DOKKU_CONFIG_TYPE=global\r\n++ DOKKU_CONFIG_RESTART=false\r\n++ [[ global == \\a\\p\\p ]]\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get --global DOKKU_WAIT_TO_RETIRE\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get '' DOKKU_WAIT_TO_RETIRE\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get DOKKU_WAIT_TO_RETIRE\r\n++ [[ -z DOKKU_WAIT_TO_RETIRE ]]\r\n++ config_create /home/dokku/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/ENV\r\n++ [[ -f /home/dokku/ENV ]]\r\n++ [[ ! -s /home/dokku/ENV ]]\r\n++ return 0\r\n+ local DOKKU_GLOBAL_DOKKU_WAIT_TO_RETIRE=\r\n+ local DOKKU_WAIT_TO_RETIRE=\r\n+ local WAIT=60\r\n+ dokku_log_info1 'Shutting down old containers in 60 seconds'\r\n+ declare 'desc=log info1 formatter'\r\n+ echo '-----> Shutting down old containers in 60 seconds'\r\n-----> Shutting down old containers in 60 seconds\r\n+ local oldid\r\n+ for oldid in '$oldids'\r\n+ dokku_log_info2 d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356\r\n+ declare 'desc=log info2 formatter'\r\n+ echo '=====> d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356'\r\n=====> d71c31e90d7d720f8b395d735766e068584b486f6d4f623a2b37b9f9d408d356\r\n++ config_get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ declare 'desc=get value of given config var'\r\n++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n++ set -- config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ config_parse_args config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ declare 'desc=parse config plugin args'\r\n++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ for var in '\"$@\"'\r\n++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ for var in '\"$@\"'\r\n++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n++ [[ DOKKU_DOCKER_STOP_TIMEOUT == \\-\\-\\s\\h\\e\\l\\l ]]\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ DOKKU_CONFIG_TYPE=app\r\n++ DOKKU_CONFIG_RESTART=true\r\n++ [[ app == \\a\\p\\p ]]\r\n++ [[ -z mysite ]]\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n++ APP=mysite\r\n++ ENV_FILE=/home/dokku/mysite/ENV\r\n++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n+++ get_sanitized_config_args config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n+++ local 'desc=return sanitized arguments for config plugin'\r\n+++ SANITIZED_ARGS=(\"$@\")\r\n+++ local SANITIZED_ARGS\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n+++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n+++ echo config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ local SANITIZED_ARGS\r\n++ set -- config:get mysite DOKKU_DOCKER_STOP_TIMEOUT\r\n++ [[ -z mysite ]]\r\n++ config_create /home/dokku/mysite/ENV\r\n++ declare 'desc=create config env file'\r\n++ local ENV_FILE=/home/dokku/mysite/ENV\r\n++ [[ -f /home/dokku/mysite/ENV ]]\r\n++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n++ local KEY=DOKKU_DOCKER_STOP_TIMEOUT\r\n++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n++ cut -d= -f2-\r\n++ grep '^export DOKKU_DOCKER_STOP_TIMEOUT='\r\n++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ true\r\n+ local DOKKU_DOCKER_STOP_TIMEOUT=\r\n+ [[ -n '' ]]\r\n+ disown -a\r\n+ sleep 0.1\r\n+ exec\r\n+ implemented=1\r\n+ [[ 1 -eq 0 ]]\r\n+ [[ 1 -eq 0 ]]\r\n+ dokku_log_info2 'Application deployed:'\r\n+ declare 'desc=log info2 formatter'\r\n+ echo '=====> Application deployed:'\r\n=====> Application deployed:\r\n+ sed 's/^/       /'\r\n+ get_app_urls urls mysite\r\n+ declare 'desc=print an app'\\''s available urls'\r\n+ source /var/lib/dokku/plugins/available/config/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+ source /var/lib/dokku/plugins/available/proxy/functions\r\n++ set -eo pipefail\r\n++ [[ -n 1 ]]\r\n++ set -x\r\n++ source /var/lib/dokku/core-plugins/available/common/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n+ local APP=mysite\r\n+ verify_app_name mysite\r\n+ declare 'desc=verify app name format and app existence'\r\n+ local APP=mysite\r\n+ [[ ! -n mysite ]]\r\n+ [[ ! mysite =~ ^[a-z].* ]]\r\n+ [[ ! -d /home/dokku/mysite ]]\r\n+ return 0\r\n++ get_app_raw_tcp_ports mysite\r\n++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'\r\n++ source /var/lib/dokku/plugins/available/config/functions\r\n+++ set -eo pipefail\r\n+++ [[ -n 1 ]]\r\n+++ set -x\r\n+++ source /var/lib/dokku/core-plugins/available/common/functions\r\n++++ set -eo pipefail\r\n++++ [[ -n 1 ]]\r\n++++ set -x\r\n++ local APP=mysite\r\n++ verify_app_name mysite\r\n++ declare 'desc=verify app name format and app existence'\r\n++ local APP=mysite\r\n++ [[ ! -n mysite ]]\r\n++ [[ ! mysite =~ ^[a-z].* ]]\r\n++ [[ ! -d /home/dokku/mysite ]]\r\n++ return 0\r\n+++ config_get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=get value of given config var'\r\n+++ [[ mysite == \\c\\o\\n\\f\\i\\g\\:\\g\\e\\t ]]\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ config_parse_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ declare 'desc=parse config plugin args'\r\n+++ unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ for var in '\"$@\"'\r\n+++ [[ config:get == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ config:get == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ config:get == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ mysite == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ mysite == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ mysite == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ for var in '\"$@\"'\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\g\\l\\o\\b\\a\\l ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\n\\o\\-\\r\\e\\s\\t\\a\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\e\\x\\p\\o\\r\\t ]]\r\n+++ [[ DOKKU_DOCKERFILE_PORTS == \\-\\-\\s\\h\\e\\l\\l ]]\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ DOKKU_CONFIG_TYPE=app\r\n+++ DOKKU_CONFIG_RESTART=true\r\n+++ [[ app == \\a\\p\\p ]]\r\n+++ [[ -z mysite ]]\r\n+++ verify_app_name mysite\r\n+++ declare 'desc=verify app name format and app existence'\r\n+++ local APP=mysite\r\n+++ [[ ! -n mysite ]]\r\n+++ [[ ! mysite =~ ^[a-z].* ]]\r\n+++ [[ ! -d /home/dokku/mysite ]]\r\n+++ return 0\r\n+++ APP=mysite\r\n+++ ENV_FILE=/home/dokku/mysite/ENV\r\n+++ export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART DOKKU_CONFIG_EXPORT\r\n+++ SANITIZED_ARGS=($(get_sanitized_config_args \"$@\"))\r\n++++ get_sanitized_config_args config:get mysite DOKKU_DOCKERFILE_PORTS\r\n++++ local 'desc=return sanitized arguments for config plugin'\r\n++++ SANITIZED_ARGS=(\"$@\")\r\n++++ local SANITIZED_ARGS\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--global/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--no-restart/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--export/}\")\r\n++++ SANITIZED_ARGS=(\"${SANITIZED_ARGS[@]//--shell/}\")\r\n++++ echo config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ local SANITIZED_ARGS\r\n+++ set -- config:get mysite DOKKU_DOCKERFILE_PORTS\r\n+++ [[ -z mysite ]]\r\n+++ config_create /home/dokku/mysite/ENV\r\n+++ declare 'desc=create config env file'\r\n+++ local ENV_FILE=/home/dokku/mysite/ENV\r\n+++ [[ -f /home/dokku/mysite/ENV ]]\r\n+++ [[ ! -s /home/dokku/mysite/ENV ]]\r\n+++ local KEY=DOKKU_DOCKERFILE_PORTS\r\n+++ sed -e 's/^'\\''//' -e 's/'\\''$//'\r\n+++ cut -d= -f2-\r\n+++ grep '^export DOKKU_DOCKERFILE_PORTS='\r\n+++ grep -Eo 'export ([a-zA-Z_][a-zA-Z0-9_]*=.*)' /home/dokku/mysite/ENV\r\n++ local DOCKERFILE_PORTS=\r\n+++ xargs\r\n+++ echo ''\r\n++ local raw_tcp_ports=\r\n++ echo ''\r\n+ local RAW_TCP_PORTS=\r\n+ local URLS_FILE=/home/dokku/mysite/URLS\r\n+ [[ -s /home/dokku/mysite/URLS ]]\r\n++ egrep -v '^#' /home/dokku/mysite/URLS\r\n+ local app_urls=http://mysite.dokku.me\r\n+ [[ -n '' ]]\r\n+ local URLS=http://mysite.dokku.me\r\n+ case \"$1\" in\r\n+ tr ' ' '\\n'\r\n+ echo http://mysite.dokku.me\r\n       http://mysite.dokku.me\r\n+ echo\r\n\r\n+ implemented=1\r\n+ [[ 1 -eq 0 ]]\r\n+ [[ 1 -eq 0 ]]\r\n+ exit 0\r\n\r\n```\r\n\r\nSteps to Reproduce:\r\n1. http://dokku.viewdocs.io/dokku/deployment/images/#deploying-an-image-from-ci\r\n2. run `dokku tags:deploy mysite v3`\r\n\r\nActual Results:\r\nI can't connect to mysite.dokky.me. I got 502 bad gateway from the error log:\r\n```\r\n2016/04/30 22:50:34 [error] 4961#0: *49 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.1, server: mysite.dokku.me, request: \"GET /favicon.ico HTTP/1.1\", upstream: \"http://172.17.0.2:5000/favicon.ico\", host: \"mysite.dokku.me\", referrer: \"http://misite.dokku.me/\"\r\n```\r\n\r\nExpected Results:\r\nGet the ports exposed by the container in order to access my static files :)\r\n"},"comment":{"url":"https://api.github.com/repos/dokku/dokku/issues/comments/217479634","html_url":"https://github.com/dokku/dokku/issues/2153#issuecomment-217479634","issue_url":"https://api.github.com/repos/dokku/dokku/issues/2153","id":217479634,"user":{"login":"michaelshobbs","id":4491438,"avatar_url":"https://avatars.githubusercontent.com/u/4491438?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelshobbs","html_url":"https://github.com/michaelshobbs","followers_url":"https://api.github.com/users/michaelshobbs/followers","following_url":"https://api.github.com/users/michaelshobbs/following{/other_user}","gists_url":"https://api.github.com/users/michaelshobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelshobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelshobbs/subscriptions","organizations_url":"https://api.github.com/users/michaelshobbs/orgs","repos_url":"https://api.github.com/users/michaelshobbs/repos","events_url":"https://api.github.com/users/michaelshobbs/events{/privacy}","received_events_url":"https://api.github.com/users/michaelshobbs/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T15:44:12Z","updated_at":"2016-05-06T15:44:12Z","body":"Ok after chatting with @josegonzalez I think we can make this happen in a relatively uncomplex way by modifying [`release_and_deploy()`](https://github.com/dokku/dokku/blob/v0.5.6/plugins/common/functions#L379-L412) like this:\r\n\r\n```\r\nrelease_and_deploy() {\r\n  declare desc=\"main function for releasing and deploying an app\"\r\n  source \"$PLUGIN_AVAILABLE_PATH/config/functions\"\r\n\r\n  local APP=\"$1\"; local IMAGE_TAG=\"$2\"; local IMAGE=$(get_app_image_name \"$APP\" \"$IMAGE_TAG\")\r\n  verify_app_name \"$APP\"\r\n\r\n  if verify_image \"$IMAGE\"; then\r\n    if is_image_herokuish_based \"$IMAGE\"; then\r\n      local IMAGE_SOURCE_TYPE=\"herokuish\"\r\n    else\r\n      local IMAGE_SOURCE_TYPE=\"dockerfile\"\r\n      local DOKKU_DOCKERFILE_PORTS=($(config_get \"$APP\" DOKKU_DOCKERFILE_PORTS || true))\r\n      if [[ -z \"$DOKKU_DOCKERFILE_PORTS\" ]]; then\r\n          # attempt to set DOKKU_DOCKERFILE_PORTS by way of `docker inspect`\r\n      fi\r\n    fi\r\n\r\n...snip....\r\n}\r\n```\r\n\r\nAdditionally we'll better document how we *normally* extract dockerfile exposed ports in the build process and document this new flow of deploying an arbitrary docker image."}}