From ed744d05e1ecc25f6b28faa5be0c2fb6eb3c8367 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 25 Jun 2018 12:15:24 -0400 Subject: [PATCH 01/85] docs: better callout for why env vars do not get applied to dockerfile builds [ci skip] --- docs/configuration/environment-variables.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md index 1eac93ad0..435372e09 100644 --- a/docs/configuration/environment-variables.md +++ b/docs/configuration/environment-variables.md @@ -13,8 +13,9 @@ config:export (|--global) [--envfile] config:keys (|--global) [--merged] Show keys set in environment config:bundle (|--global) [--merged] Bundle environment into tarfile ``` +> For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860). -The variables are available both at run time and during the application build/compilation step for buildpack-based deploys. For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860). +Environment variables are available both at run time and during the application build/compilation step for buildpack-based deploys. For buildpack deploys, Dokku will create a `/app/.env` file that can be used for legacy buildpacks. Note that this is *not* updated when `config:set` or `config:unset` is called, and is only written during a `deploy` or `ps:rebuild`. Developers are encouraged to instead read from the application environment directly, as the proper values will be available then. From 06f8237196e9b060e959211b3d5fb6ec71f5ecf9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 4 Jul 2018 15:31:03 -0400 Subject: [PATCH 02/85] fix: get the global scheduler if no app is specified --- plugins/ps/subcommands/restore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/ps/subcommands/restore b/plugins/ps/subcommands/restore index b9c209fd1..7103f59d8 100755 --- a/plugins/ps/subcommands/restore +++ b/plugins/ps/subcommands/restore @@ -8,8 +8,13 @@ ps_restore_cmd() { declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line" local cmd="ps:restore" local APP="$2" + local DOKKU_SCHEDULER + + DOKKU_SCHEDULER=$(config_get --global DOKKU_SCHEDULER || echo "docker-local") + if [[ -n "$APP" ]]; then + DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") + fi - local DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") plugn trigger pre-restore "$DOKKU_SCHEDULER" if [[ -n "$APP" ]]; then From f6fc32a07481366fd206c403a2855df5f5bccc5f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 5 Jul 2018 19:42:04 -0400 Subject: [PATCH 03/85] feat: allow silencing headers on storage:list output (#3224) --- plugins/storage/internal-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/storage/internal-functions b/plugins/storage/internal-functions index edbfdfcab..9a4175cf5 100755 --- a/plugins/storage/internal-functions +++ b/plugins/storage/internal-functions @@ -106,6 +106,6 @@ storage_list_cmd() { local passed_phases="deploy" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" && local APP="$2" - echo "$APP volume bind-mounts:" + dokku_log_quiet "$APP volume bind-mounts:" get_bind_mounts "$(get_phase_file_path "$passed_phases")" } From c9de100dd9c29debec9793c8b87557576db2f182 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 9 Jul 2018 11:27:24 -0400 Subject: [PATCH 04/85] feat: add container id to retire-container-failed arguments (#3227) Refs dokku/dokku#3225 --- plugins/scheduler-docker-local/scheduler-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scheduler-docker-local/scheduler-deploy b/plugins/scheduler-docker-local/scheduler-deploy index 7abc8a059..e4dd5bb78 100755 --- a/plugins/scheduler-docker-local/scheduler-deploy +++ b/plugins/scheduler-docker-local/scheduler-deploy @@ -164,7 +164,7 @@ scheduler-docker-local-scheduler-deploy() { # shellcheck disable=SC2086 docker stop $DOCKER_STOP_TIME_ARG "$oldid" \ || docker kill "$oldid" \ - || plugn trigger retire-container-failed "$APP" # plugin trigger for event logging + || plugn trigger retire-container-failed "$APP" "$oldid" # plugin trigger for event logging done ) & disown -a # Use trap since disown/nohup don't seem to keep child alive From 6fb4adf87fb11be96deabdf845475c662cc9ed4e Mon Sep 17 00:00:00 2001 From: Tahzib Mashrik Date: Thu, 26 Jul 2018 03:06:01 +0600 Subject: [PATCH 05/85] unset GIT_QUARANTINE_PATH when updating repo submodule --- plugins/git/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/functions b/plugins/git/functions index 19a9f1724..eb23bc38e 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -65,7 +65,7 @@ git_build_app_repo() { GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true fi - suppress_output git submodule update --init --recursive + suppress_output env -u GIT_QUARANTINE_PATH git submodule update --init --recursive find . -name .git -prune -exec rm -rf {} \; > /dev/null if use_git_worktree; then From 2679bf370928c69a71dd3a2da6e438cd287370ff Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Jul 2018 22:44:47 -0400 Subject: [PATCH 06/85] docs: switch from ps:rebuild to ps:restart A rebuild from source is not generally required here. --- docs/advanced-usage/persistent-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-usage/persistent-storage.md b/docs/advanced-usage/persistent-storage.md index d01d77881..0627e89aa 100644 --- a/docs/advanced-usage/persistent-storage.md +++ b/docs/advanced-usage/persistent-storage.md @@ -43,7 +43,7 @@ Once you have mounted persistent storage, you will also need to restart the appl [process scaling documentation](/docs/deployment/process-management.md) for more information. ```shell -dokku ps:rebuild app-name +dokku ps:restart app-name ``` A more complete workflow may require making a custom directory for your application and mounting it within your `/app/storage` directory instead. The mount point is *not* relative to your application's working directory, and is instead relative to the root of the container. From b75547cff86b8adc748fa671f736ecd89af211db Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 25 Jul 2018 23:51:55 -0400 Subject: [PATCH 07/85] feat: support --quiet header when showing all environment variables Closes #3229 --- plugins/config/subcommands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/config/subcommands.go b/plugins/config/subcommands.go index 6f4880ca8..eaae77b8f 100644 --- a/plugins/config/subcommands.go +++ b/plugins/config/subcommands.go @@ -25,7 +25,7 @@ func CommandShow(args []string, global bool, shell bool, export bool, merged boo if appName != "" { contextName = appName } - common.LogInfo2(contextName + " env vars") + common.LogInfo2Quiet(contextName + " env vars") fmt.Println(env.Export(ExportFormatPretty)) } } From df834f41f313df49ff41abc6f22b01b2eab5ee3a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 28 Jul 2018 00:19:13 -0400 Subject: [PATCH 08/85] feat: add a test to prove that tls breaks app renames --- tests/unit/10_apps.bats | 15 ++++++++++++++- tests/unit/30_core_1.bats | 6 ------ tests/unit/40_core_2.bats | 6 ------ tests/unit/test_helper.bash | 6 ++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tests/unit/10_apps.bats b/tests/unit/10_apps.bats index e58ec2e03..1fce0c5be 100644 --- a/tests/unit/10_apps.bats +++ b/tests/unit/10_apps.bats @@ -113,6 +113,19 @@ teardown () { assert_success } +@test "(apps) apps:rename with tls" { + setup_test_tls + deploy_app + run bash -c "dokku apps:rename $TEST_APP great-test-name" + echo "output: "$output + echo "status: "$status + assert_success + run bash -c "dokku --force apps:destroy great-test-name" + echo "output: "$output + echo "status: "$status + assert_success +} + @test "(apps) apps:clone" { deploy_app run bash -c "dokku apps:clone $TEST_APP great-test-name" @@ -213,4 +226,4 @@ teardown () { assert_output "false" destroy_app -} \ No newline at end of file +} diff --git a/tests/unit/30_core_1.bats b/tests/unit/30_core_1.bats index 310a2854c..e9c9c235d 100644 --- a/tests/unit/30_core_1.bats +++ b/tests/unit/30_core_1.bats @@ -24,12 +24,6 @@ assert_urls() { assert_output < <(tr ' ' '\n' <<< "${urls}") } -build_nginx_config() { - # simulate nginx post-deploy - dokku domains:setup $TEST_APP - dokku nginx:build-config $TEST_APP -} - @test "(core) remove exited containers" { deploy_app diff --git a/tests/unit/40_core_2.bats b/tests/unit/40_core_2.bats index a26d2c8b6..9a82423a5 100644 --- a/tests/unit/40_core_2.bats +++ b/tests/unit/40_core_2.bats @@ -31,12 +31,6 @@ assert_url() { assert_output "${url}" } -build_nginx_config() { - # simulate nginx post-deploy - dokku domains:setup $TEST_APP - dokku nginx:build-config $TEST_APP -} - @test "(core) run (with --options)" { deploy_app run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version" diff --git a/tests/unit/test_helper.bash b/tests/unit/test_helper.bash index ee94c70dc..ab4dbb5b5 100644 --- a/tests/unit/test_helper.bash +++ b/tests/unit/test_helper.bash @@ -372,3 +372,9 @@ cat< "$APP_REPO_DIR/nginx.conf.sigil" some lame nginx config EOF } + +build_nginx_config() { + # simulate nginx post-deploy + dokku domains:setup "$TEST_APP" + dokku nginx:build-config "$TEST_APP" +} From 66b2fb602f9fa4a82e8e4a63172cae4f4633b559 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 26 Jul 2018 09:53:56 -0400 Subject: [PATCH 09/85] feat: implement proxy-clear-config This will allow us to kill stale proxy configuration within apps, which is critical during application renames. - redirect rmdir output to dev-null - trigger a proxy-clear-config (new trigger) when renaming an application - The configuration will be rebuilt during the later `ps_rebuild` Closes #3231 --- docs/development/plugin-triggers.md | 30 +++++++++++++++++++++++++ plugins/20_events/network-clear-config | 1 + plugins/20_events/proxy-clear-config | 1 + plugins/apps/subcommands/rename | 3 ++- plugins/nginx-vhosts/internal-functions | 6 +++++ plugins/nginx-vhosts/proxy-clear-config | 19 ++++++++++++++++ 6 files changed, 59 insertions(+), 1 deletion(-) create mode 120000 plugins/20_events/network-clear-config create mode 120000 plugins/20_events/proxy-clear-config create mode 100755 plugins/nginx-vhosts/proxy-clear-config diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index c655ca3c3..a14bea974 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -373,6 +373,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `network-clear-config` + +- Description: Clears network configuration +- Invoked by: `internally triggered by proxy-clear-config within proxy implementations` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `network-compute-ports` - Description: Computes the ports for a given app container @@ -1040,6 +1055,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `proxy-clear-config` + +- Description: Clears the proxy implementation configuration for a given app +- Invoked by: `internally triggered by apps:rename` +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `proxy-enable` - Description: Enables the configured proxy implementation for an app diff --git a/plugins/20_events/network-clear-config b/plugins/20_events/network-clear-config new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/network-clear-config @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/20_events/proxy-clear-config b/plugins/20_events/proxy-clear-config new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/proxy-clear-config @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/apps/subcommands/rename b/plugins/apps/subcommands/rename index d18604445..2a95d1b26 100755 --- a/plugins/apps/subcommands/rename +++ b/plugins/apps/subcommands/rename @@ -14,12 +14,13 @@ apps_rename_cmd() { local OLD_CACHE_DIR="$DOKKU_ROOT/$OLD_APP/cache" local OLD_CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$OLD_APP/cache" - if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR"; then + if [[ -d "$OLD_CACHE_DIR" ]] && ! rmdir "$OLD_CACHE_DIR" > /dev/null 2>&1; then docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$OLD_CACHE_HOST_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache fi rm -rf "$OLD_CACHE_DIR" apps_create "$NEW_APP" cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP" + plugn trigger proxy-clear-config "$NEW_APP" DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP" [[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS" [[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST" diff --git a/plugins/nginx-vhosts/internal-functions b/plugins/nginx-vhosts/internal-functions index 93d929bb6..edf212502 100755 --- a/plugins/nginx-vhosts/internal-functions +++ b/plugins/nginx-vhosts/internal-functions @@ -26,3 +26,9 @@ nginx_vhosts_help_cmd() { help_desc fi } + +nginx_clear_config() { + declare desc="Remove the nginx conf file" + declare APP="$1"; + rm -f "$DOKKU_ROOT/$APP/nginx.conf" +} diff --git a/plugins/nginx-vhosts/proxy-clear-config b/plugins/nginx-vhosts/proxy-clear-config new file mode 100755 index 000000000..acd909db7 --- /dev/null +++ b/plugins/nginx-vhosts/proxy-clear-config @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions" +source "$PLUGIN_AVAILABLE_PATH/proxy/functions" + +trigger-nginx-vhosts-clear-config() { + declare desc="clear nginx config for proxy app containers from command line" + declare trigger="trigger-nginx-vhosts-clear-config" + declare APP="$1" + [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" + + if [[ "$(get_app_proxy_type "$APP")" = "nginx" ]]; then + plugn trigger network-clear-config "$APP" + nginx_clear_config "$APP" + fi +} + +trigger-nginx-vhosts-clear-config "$@" From 78f467852e582d116791a364e954a774e1bacd5b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 17:17:53 -0400 Subject: [PATCH 10/85] feat: add a subcommand for retrieving failed app deploy logs This can be useful in cases where a developer wishes to see what error messages are available for a failed deploy, but does not wish to spelunk around `docker ps -a` output. Note that the logs are not made available once a further deploy is triggered, or after the containers have been garbage collected. --- docs/deployment/logs.md | 23 ++++++-- dokku | 2 + plugins/common/property-functions | 11 +--- plugins/logs/commands | 22 +------- plugins/logs/internal-functions | 38 +++++++++++++ plugins/logs/subcommands/default | 12 ++-- plugins/logs/subcommands/failed | 17 ++++++ plugins/scheduler-docker-local/install | 12 ++++ plugins/scheduler-docker-local/post-create | 13 +++++ .../scheduler-docker-local/scheduler-deploy | 10 +++- .../scheduler-docker-local/scheduler-failed | 56 +++++++++++++++++++ 11 files changed, 172 insertions(+), 44 deletions(-) create mode 100755 plugins/logs/internal-functions create mode 100755 plugins/logs/subcommands/failed create mode 100755 plugins/scheduler-docker-local/install create mode 100755 plugins/scheduler-docker-local/post-create create mode 100755 plugins/scheduler-docker-local/scheduler-failed diff --git a/docs/deployment/logs.md b/docs/deployment/logs.md index eefb5983c..f36deceac 100644 --- a/docs/deployment/logs.md +++ b/docs/deployment/logs.md @@ -1,19 +1,21 @@ # Log Management ``` -logs # display recent log output +logs [-h] [-t] [-n num] [-q] [-p process] # Display recent log output +logs:failed # Shows the last failed deploy logs for an app ``` ## Usage -### Application Logs -You can easily get logs of an application using the `logs` command: +### App Logs + +You can easily get logs of an app using the `logs` command: ```shell dokku logs node-js-app ``` -## Behavioral modifiers +#### Behavioral modifiers Dokku also supports certain command-line arguments that augment the `log` command's behavior. @@ -26,8 +28,19 @@ Dokku also supports certain command-line arguments that augment the `log` comman You can use these modifiers as follows: - ```shell dokku logs node-js-app -t -p web ``` will show logs continually from the web process. + +### Failed Deploy Logs + +> Warning: The default `docker-local` scheduler will "store" these until the next deploy or until the old containers are garbage collected - whichever runs first. If you require the logs beyond this point in time, please ship the logs to a centralized log server. + +In some cases, it may be useful to retrieve the logs from a previously failed deploy. + +You can retrieve these logs by using the `logs:failed` command + +```shell +dokku logs:failed node-js-app +``` diff --git a/dokku b/dokku index 21c3588c0..96222c23f 100755 --- a/dokku +++ b/dokku @@ -42,6 +42,8 @@ export PLUGIN_ENABLED_PATH=${PLUGIN_ENABLED_PATH:="$PLUGIN_PATH/enabled"} export PLUGIN_CORE_PATH=${PLUGIN_CORE_PATH:="$DOKKU_LIB_ROOT/core-plugins"} export PLUGIN_CORE_AVAILABLE_PATH=${PLUGIN_CORE_AVAILABLE_PATH:="$PLUGIN_CORE_PATH/available"} export PLUGIN_CORE_ENABLED_PATH=${PLUGIN_CORE_ENABLED_PATH:="$PLUGIN_CORE_PATH/enabled"} +export DOKKU_SYSTEM_GROUP=${DOKKU_SYSTEM_GROUP:="dokku"} +export DOKKU_SYSTEM_USER=${DOKKU_SYSTEM_USER:="dokku"} export DOKKU_API_VERSION=1 export DOKKU_NOT_IMPLEMENTED_EXIT=10 diff --git a/plugins/common/property-functions b/plugins/common/property-functions index f995ce6ef..ff68008f1 100755 --- a/plugins/common/property-functions +++ b/plugins/common/property-functions @@ -67,15 +67,6 @@ fn-plugin-property-setup() { mkdir -p "${DOKKU_LIB_ROOT}/config/${PLUGIN}" chmod 0755 "${DOKKU_LIB_ROOT}/config/${PLUGIN}" - - if [[ -z "$DOKKU_SYSTEM_GROUP" ]]; then - export DOKKU_SYSTEM_GROUP=dokku - fi - - if [[ -z "$DOKKU_SYSTEM_USER" ]]; then - export DOKKU_SYSTEM_USER=dokku - fi - chown "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/config/${PLUGIN}" } @@ -86,7 +77,7 @@ fn-plugin-property-read() { if [[ -z "$PLUGIN" ]] || [[ -z "$APP" ]] || [[ -z "$KEY" ]]; then return 1 fi - + if [[ ! -f "${DOKKU_LIB_ROOT:?}/config/${PLUGIN}/${APP}/${KEY}" ]]; then return 1 fi diff --git a/plugins/logs/commands b/plugins/logs/commands index f51a3f750..9a3d7f7a5 100755 --- a/plugins/logs/commands +++ b/plugins/logs/commands @@ -1,27 +1,11 @@ #!/usr/bin/env bash [[ " help logs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" +source "$PLUGIN_AVAILABLE_PATH/logs/internal-functions" set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -usage() { - declare desc="logs specific usage" - echo "Usage: dokku logs " - echo " display recent log output" - echo "" - echo " -n, --num NUM # the number of lines to display" - echo " -p, --ps PS # only display logs from the given process" - echo " -t, --tail # continually stream logs" - echo " -q, --quiet # display raw logs without colors, time and names" -} - case "$1" in - logs:help) - usage - ;; - - help) - cat< [-h] [-t] [-n num] [-q] [-p process], Show the last logs for an application -EOF + help | logs:help) + cmd-logs-help "$@" ;; *) diff --git a/plugins/logs/internal-functions b/plugins/logs/internal-functions new file mode 100755 index 000000000..81aeb6ce5 --- /dev/null +++ b/plugins/logs/internal-functions @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +fn-logs-usage() { + declare desc="logs specific usage" + echo "Usage: dokku logs " + echo " display recent log output" + echo "" + echo " -n, --num NUM # the number of lines to display" + echo " -p, --ps PS # only display logs from the given process" + echo " -t, --tail # continually stream logs" + echo " -q, --quiet # display raw logs without colors, time and names" +} + +fn-logs-help-content() { + declare desc="return logs plugin help content" + cat< [-h] [-t] [-n num] [-q] [-p process], Display recent log output + logs:failed , Show the last logs for an application +help_content +} + +cmd-logs-help() { + if [[ $1 = "logs:help" ]] ; then + echo -e 'Usage: dokku logs[:COMMAND]' + echo '' + echo 'Output app logs' + echo '' + echo 'Additional commands:' + fn-logs-help-content | sort | column -c2 -t -s, + elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then + fn-logs-help-content + else + cat<&2 ; exit 1 ; fi + if [[ "$EXIT_CODE" != 0 ]]; then fn-logs-usage >&2 ; exit 1 ; fi eval set -- "$TEMP" local DOKKU_LOGS_LINE_NUMBERS="100" @@ -29,7 +27,7 @@ logs_default_cmd() { -p|--ps) local DOKKU_LOGS_ONLY_PROCESS="$2"; shift 2 ;; -q|--quiet) local DOKKU_LOGS_NO_PRETTY_PRINT="true"; shift ;; --) shift; break ;; - *) echo "Internal error"; exit 1;; + *) dokku_log_fail "Internal error";; esac done diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed new file mode 100755 index 000000000..1071a218d --- /dev/null +++ b/plugins/logs/subcommands/failed @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/config/functions" + +cmd-logs-failed() { + declare desc="shows the last failed deploy logs for an app" + declare cmd="logs:failed" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1 + declare APP="$1" + local DOKKU_SCHEDULER + [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" + + DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") + plugn trigger scheduler-failed "$DOKKU_SCHEDULER" "$APP" +} + +cmd-logs-failed "$@" diff --git a/plugins/scheduler-docker-local/install b/plugins/scheduler-docker-local/install new file mode 100755 index 000000000..a6159c0b5 --- /dev/null +++ b/plugins/scheduler-docker-local/install @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +scheduler-docker-local-install() { + declare desc="scheduler-docker-local install plugin trigger" + declare trigger="scheduler-docker-local-install" + + mkdir -p "${DOKKU_LIB_ROOT}/data/scheduler-docker-local" + chown -R "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/data/scheduler-docker-local" +} + +scheduler-docker-local-install "$@" diff --git a/plugins/scheduler-docker-local/post-create b/plugins/scheduler-docker-local/post-create new file mode 100755 index 000000000..9c9f98c29 --- /dev/null +++ b/plugins/scheduler-docker-local/post-create @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +scheduler-docker-local-post-create() { + declare desc="scheduler-docker-local post-create plugin trigger" + declare trigger="scheduler-docker-local-post-create" + declare APP="$1" + + mkdir -p "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/${APP}" + chown -R "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/${APP}" +} + +scheduler-docker-local-post-create "$@" diff --git a/plugins/scheduler-docker-local/scheduler-deploy b/plugins/scheduler-docker-local/scheduler-deploy index e4dd5bb78..c4a463ae6 100755 --- a/plugins/scheduler-docker-local/scheduler-deploy +++ b/plugins/scheduler-docker-local/scheduler-deploy @@ -13,6 +13,8 @@ scheduler-docker-local-scheduler-deploy() { return fi + rm -f "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers" + local DOKKU_DOCKER_STOP_TIMEOUT DOKKU_HEROKUISH DOKKU_NETWORK_BIND_ALL IMAGE DOKKU_HEROKUISH=false IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG") @@ -96,14 +98,16 @@ scheduler-docker-local-scheduler-deploy() { kill_new() { declare desc="wrapper function to kill newly started app container" - local cid="$1" - docker inspect "$cid" &> /dev/null && docker stop "$cid" > /dev/null && docker kill "$cid" &> /dev/null + declare CID="$1" PROC_TYPE="$2" CONTAINER_INDEX="$3" + docker inspect "$CID" &> /dev/null && docker stop "$CID" > /dev/null && docker kill "$CID" &> /dev/null + mkdir -p "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP" + echo "${CID} ${PROC_TYPE}.${CONTAINER_INDEX}" >> "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers" trap - INT TERM EXIT kill -9 $$ } # run checks first, then post-deploy hooks, which switches proxy traffic - trap 'kill_new $cid' INT TERM EXIT + trap 'kill_new $cid $PROC_TYPE $CONTAINER_INDEX' INT TERM EXIT if [[ "$(is_app_proctype_checks_disabled "$APP" "$PROC_TYPE")" == "false" ]]; then dokku_log_info1 "Attempting pre-flight checks" plugn trigger check-deploy "$APP" "$cid" "$PROC_TYPE" "$port" "$ipaddr" diff --git a/plugins/scheduler-docker-local/scheduler-failed b/plugins/scheduler-docker-local/scheduler-failed new file mode 100755 index 000000000..cbba2b9c6 --- /dev/null +++ b/plugins/scheduler-docker-local/scheduler-failed @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" + +scheduler-docker-local-scheduler-failed() { + declare desc="scheduler-docker-local scheduler-failed plugin trigger" + declare trigger="scheduler-docker-local scheduler-failed" + declare DOKKU_SCHEDULER="$1" APP="$2" + local FAILED_CONTAINERS_FILE="${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers" + local DEAD_CONTAINERS=() DOKKU_LOGS_CMD=() RUNNING_CONTAINERS=() + local CID LINE PREFIX + shift 2 + + if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then + return + fi + + if [[ ! -f "$FAILED_CONTAINERS_FILE" ]]; then + dokku_log_warn "No failed containers found" + return + fi + + while read -r LINE || [[ -n "$LINE" ]]; do + CID="$(echo "$LINE" | cut -d ' ' -f1)" + PREFIX="$(echo "$LINE" | cut -d ' ' -f2)" + if docker inspect "${CID}" > /dev/null 2>&1; then + RUNNING_CONTAINERS+=("$CID") + else + DEAD_CONTAINERS+=("$CID") + fi + done < "$FAILED_CONTAINERS_FILE" + + for CID in "${DEAD_CONTAINERS[@]}"; do + dokku_log_warn "App container $CID no longer running" + sed -i "/${CID}/d" "$FAILED_CONTAINERS_FILE" + done + + if [[ ${#RUNNING_CONTAINERS[@]} -eq 0 ]]; then + dokku_log_warn "No failed containers found" + return + fi + + ((MAX_INDEX=${#RUNNING_CONTAINERS[*]} - 1)) || true + for i in ${!RUNNING_CONTAINERS[*]}; do + local CID="${RUNNING_CONTAINERS[i]}" + DOKKU_LOGS_CMD+="(docker logs $DOKKU_LOGS_ARGS $CID 2>&1)" + if [[ $i != "$MAX_INDEX" ]]; then + local DOKKU_LOGS_CMD+="& " + else + local DOKKU_LOGS_CMD+="; " + fi + done + bash -c "($DOKKU_LOGS_CMD)" +} + +scheduler-docker-local-scheduler-failed "$@" From f173c2f1c29f926e1fcfa3d10f3a69a85039ae25 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:30:45 -0400 Subject: [PATCH 11/85] docs: add missing documentation for scheduler-failed plugin trigger --- .../advanced-usage/schedulers/docker-local.md | 3 ++- docs/development/plugin-triggers.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/advanced-usage/schedulers/docker-local.md b/docs/advanced-usage/schedulers/docker-local.md index 1427a0a97..28342344b 100644 --- a/docs/advanced-usage/schedulers/docker-local.md +++ b/docs/advanced-usage/schedulers/docker-local.md @@ -25,7 +25,8 @@ This plugin implements various functionality through `plugn` triggers to integra - `pre-restore` - `scheduler-deploy` - `scheduler-docker-cleanup` +- `scheduler-failed` - `scheduler-run` - `scheduler-stop` - `scheduler-tags-create` -- `scheduler-tags-destroy` \ No newline at end of file +- `scheduler-tags-destroy` diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index a14bea974..f5533c1f7 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1207,6 +1207,25 @@ DOKKU_SCHEDULER="$1"; APP="$2"; FORCE_CLEANUP="$3"; # TODO ``` +### `scheduler-failed` + +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + +- Description: Allows you to run scheduler commands when retrieving failed container logs +- Invoked by: `dokku logs:failed` +- Arguments: `$DOKKU_SCHEDULER $APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +DOKKU_SCHEDULER="$1"; APP="$2"; ARGS="${@:3}"; + +# TODO +``` + ### `scheduler-run` - Description: Allows you to run scheduler commands when a command is executed for your app From f7169bf417c50a7b03439162520ffd8c472384db Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:31:20 -0400 Subject: [PATCH 12/85] chore: clarify plugin trigger name --- docs/advanced-usage/schedulers/docker-local.md | 2 +- docs/development/plugin-triggers.md | 2 +- plugins/logs/subcommands/failed | 2 +- .../{scheduler-failed => scheduler-logs-failed} | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) rename plugins/scheduler-docker-local/{scheduler-failed => scheduler-logs-failed} (86%) diff --git a/docs/advanced-usage/schedulers/docker-local.md b/docs/advanced-usage/schedulers/docker-local.md index 28342344b..2f9ee476a 100644 --- a/docs/advanced-usage/schedulers/docker-local.md +++ b/docs/advanced-usage/schedulers/docker-local.md @@ -25,7 +25,7 @@ This plugin implements various functionality through `plugn` triggers to integra - `pre-restore` - `scheduler-deploy` - `scheduler-docker-cleanup` -- `scheduler-failed` +- `scheduler-logs-failed` - `scheduler-run` - `scheduler-stop` - `scheduler-tags-create` diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index f5533c1f7..b49464b39 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1207,7 +1207,7 @@ DOKKU_SCHEDULER="$1"; APP="$2"; FORCE_CLEANUP="$3"; # TODO ``` -### `scheduler-failed` +### `scheduler-logs-failed` > Warning: The scheduler plugin trigger apis are under development and may change > between minor releases until the 1.0 release. diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed index 1071a218d..24cb441f3 100755 --- a/plugins/logs/subcommands/failed +++ b/plugins/logs/subcommands/failed @@ -11,7 +11,7 @@ cmd-logs-failed() { [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") - plugn trigger scheduler-failed "$DOKKU_SCHEDULER" "$APP" + plugn trigger scheduler-logs-failed "$DOKKU_SCHEDULER" "$APP" } cmd-logs-failed "$@" diff --git a/plugins/scheduler-docker-local/scheduler-failed b/plugins/scheduler-docker-local/scheduler-logs-failed similarity index 86% rename from plugins/scheduler-docker-local/scheduler-failed rename to plugins/scheduler-docker-local/scheduler-logs-failed index cbba2b9c6..1c75705f0 100755 --- a/plugins/scheduler-docker-local/scheduler-failed +++ b/plugins/scheduler-docker-local/scheduler-logs-failed @@ -2,9 +2,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -scheduler-docker-local-scheduler-failed() { - declare desc="scheduler-docker-local scheduler-failed plugin trigger" - declare trigger="scheduler-docker-local scheduler-failed" +scheduler-docker-local-scheduler-logs-failed() { + declare desc="scheduler-docker-local scheduler-logs-failed plugin trigger" + declare trigger="scheduler-docker-local scheduler-logs-failed" declare DOKKU_SCHEDULER="$1" APP="$2" local FAILED_CONTAINERS_FILE="${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers" local DEAD_CONTAINERS=() DOKKU_LOGS_CMD=() RUNNING_CONTAINERS=() @@ -53,4 +53,4 @@ scheduler-docker-local-scheduler-failed() { bash -c "($DOKKU_LOGS_CMD)" } -scheduler-docker-local-scheduler-failed "$@" +scheduler-docker-local-scheduler-logs-failed "$@" From ec34b35a7fc57b893f71392844eef58e0ad13012 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:32:05 -0400 Subject: [PATCH 13/85] feat: allow retrieving failed logs for all apps --- plugins/logs/subcommands/failed | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed index 24cb441f3..40371af19 100755 --- a/plugins/logs/subcommands/failed +++ b/plugins/logs/subcommands/failed @@ -1,15 +1,29 @@ #!/usr/bin/env bash -set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/apps/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x cmd-logs-failed() { declare desc="shows the last failed deploy logs for an app" declare cmd="logs:failed" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1 declare APP="$1" local DOKKU_SCHEDULER - [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" + if [[ -z "$APP" ]]; then + local INSTALLED_APPS=$(dokku_apps) + for app in $INSTALLED_APPS; do + fn-logs-failed-single "$app" | tee || true + done + else + fn-logs-failed-single "$app" + fi +} + +fn-logs-failed-single() { + declare desc="shows the last failed deploy logs for an app" + declare APP="$1" + local DOKKU_SCHEDULER DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") plugn trigger scheduler-logs-failed "$DOKKU_SCHEDULER" "$APP" } From 1538dc5dcb14304f67c05313abef43ca13cd1e30 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:32:53 -0400 Subject: [PATCH 14/85] docs: clarify that the scheduler api is unstable Also add missing dollar signs to variables. --- docs/development/plugin-triggers.md | 30 +++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index b49464b39..57e79fbc7 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1177,9 +1177,12 @@ APP="$1"; ### `scheduler-deploy` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when an app is deployed - Invoked by: `dokku deploy` -- Arguments: `$DOKKU_SCHEDULER APP IMAGE_TAG` +- Arguments: `$DOKKU_SCHEDULER $APP $IMAGE_TAG` - Example: ```shell @@ -1193,9 +1196,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_TAG="$3"; ### `scheduler-docker-cleanup` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when dokku cleanup is invoked - Invoked by: `dokku deploy, dokku cleanup` -- Arguments: `$DOKKU_SCHEDULER APP FORCE_CLEANUP` +- Arguments: `$DOKKU_SCHEDULER $APP $FORCE_CLEANUP` - Example: ```shell @@ -1228,9 +1234,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; ARGS="${@:3}"; ### `scheduler-run` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when a command is executed for your app - Invoked by: `dokku run` -- Arguments: `$DOKKU_SCHEDULER APP ...ARGS` +- Arguments: `$DOKKU_SCHEDULER $APP ...ARGS` - Example: ```shell @@ -1244,9 +1253,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; ARGS="${@:3}"; ### `scheduler-stop` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when a tag is destroyed - Invoked by: `dokku apps:destroy, dokku ps:stop` -- Arguments: `$DOKKU_SCHEDULER APP REMOVE_CONTAINERS` +- Arguments: `$DOKKU_SCHEDULER $APP $REMOVE_CONTAINERS` - Example: ```shell @@ -1260,9 +1272,12 @@ DOKKU_SCHEDULER="$1"; APP="$2"; REMOVE_CONTAINERS="$3"; ### `scheduler-tags-create` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when a tag is created - Invoked by: `dokku tags:create` -- Arguments: `$DOKKU_SCHEDULER APP SOURCE_IMAGE TARGET_IMAGE` +- Arguments: `$DOKKU_SCHEDULER $APP $SOURCE_IMAGE $TARGET_IMAGE` - Example: ```shell @@ -1276,9 +1291,12 @@ DOKKU_SCHEDULER="$1" APP="$2" SOURCE_IMAGE="$3" TARGET_IMAGE="$4" ### `scheduler-tags-destroy` +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + - Description: Allows you to run scheduler commands when a tag is destroyed - Invoked by: `dokku tags:destroy` -- Arguments: `$DOKKU_SCHEDULER APP IMAGE_REPO IMAGE_TAG` +- Arguments: `$DOKKU_SCHEDULER $APP $IMAGE_REPO $IMAGE_TAG` - Example: ```shell From cf99ac9a2ceed5b01443d2dd2adc977bb53842ae Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:40:08 -0400 Subject: [PATCH 15/85] fix: use correct argument --- plugins/logs/subcommands/failed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed index 40371af19..504678703 100755 --- a/plugins/logs/subcommands/failed +++ b/plugins/logs/subcommands/failed @@ -16,7 +16,7 @@ cmd-logs-failed() { fn-logs-failed-single "$app" | tee || true done else - fn-logs-failed-single "$app" + fn-logs-failed-single "$APP" fi } From 87ee233636433f02611c7570a1428c5936a556ed Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:40:39 -0400 Subject: [PATCH 16/85] feat: add a header message --- plugins/logs/subcommands/failed | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed index 504678703..cc2d95190 100755 --- a/plugins/logs/subcommands/failed +++ b/plugins/logs/subcommands/failed @@ -24,6 +24,8 @@ fn-logs-failed-single() { declare desc="shows the last failed deploy logs for an app" declare APP="$1" local DOKKU_SCHEDULER + + dokku_log_info2_quiet "${APP} failed deploy logs" DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local") plugn trigger scheduler-logs-failed "$DOKKU_SCHEDULER" "$APP" } From db2902965334230b59cb177275d22694cb1793ac Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 19:40:52 -0400 Subject: [PATCH 17/85] docs: clarify usage for multiple apps --- docs/deployment/logs.md | 8 +++++++- plugins/logs/subcommands/failed | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/deployment/logs.md b/docs/deployment/logs.md index f36deceac..656e0a858 100644 --- a/docs/deployment/logs.md +++ b/docs/deployment/logs.md @@ -2,7 +2,7 @@ ``` logs [-h] [-t] [-n num] [-q] [-p process] # Display recent log output -logs:failed # Shows the last failed deploy logs for an app +logs:failed [] # Shows the last failed deploy logs ``` ## Usage @@ -44,3 +44,9 @@ You can retrieve these logs by using the `logs:failed` command ```shell dokku logs:failed node-js-app ``` + +You can also retrieve the failed logs for each app: + +```shell +dokku logs:failed node-js-app +``` diff --git a/plugins/logs/subcommands/failed b/plugins/logs/subcommands/failed index cc2d95190..a064ea6b7 100755 --- a/plugins/logs/subcommands/failed +++ b/plugins/logs/subcommands/failed @@ -5,7 +5,7 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x cmd-logs-failed() { - declare desc="shows the last failed deploy logs for an app" + declare desc="shows the last failed deploy logs" declare cmd="logs:failed" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1 declare APP="$1" local DOKKU_SCHEDULER From 1831848f898fbde19103ec9f8b0b72692b348639 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 20:31:53 -0400 Subject: [PATCH 18/85] feat: upgrade herokuish to 0.4.3 --- deb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index 8f8844e81..66635522d 100644 --- a/deb.mk +++ b/deb.mk @@ -1,6 +1,6 @@ HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku' HEROKUISH_REPO_NAME ?= gliderlabs/herokuish -HEROKUISH_VERSION ?= 0.4.2 +HEROKUISH_VERSION ?= 0.4.3 HEROKUISH_ARCHITECTURE = amd64 HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb From 53c5d548f13cc90dc6fc6c29034f19b29966dfc2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 20:35:49 -0400 Subject: [PATCH 19/85] Release 0.12.11 # History ## 0.12.11 ### Bug Fixes - #3238: @josegonzalez Handle proxy issues in app renaming - #3234: @mashrikt Unset GIT_QUARANTINE_PATH when updating repo submodule - #3223: @josegonzalez Get the global scheduler if no app is specified - #3218: @wcalandro Fix error text when using "dokku plugin:uninstall" ### New Features - #3242: @josegonzalez Upgrade herokuish to 0.4.3 - #3241: @josegonzalez Add a subcommand for retrieving failed app deploy logs - #3237: @josegonzalez Support --quiet header when showing all environment variables ### Documentation - #3235: @josegonzalez Switch from ps:rebuild to ps:restart - #3221: @josegonzalez Better callout for why env vars do not get applied to dockerfile builds --- HISTORY.md | 20 +++++++++ README.md | 4 +- contrib/dokku-installer.py | 2 +- debian/control | 2 +- docs/advanced-usage/plugin-management.md | 50 +++++++++++----------- docs/assets/favicons/browserconfig.xml | 8 ++-- docs/assets/favicons/manifest.json | 12 +++--- docs/assets/style.css | 4 +- docs/assets/versions.json | 2 +- docs/development/release-process.md | 2 +- docs/getting-started/installation.md | 4 +- docs/home.html | 40 ++++++++--------- docs/template.html | 36 ++++++++-------- plugins/00_dokku-standard/plugin.toml | 2 +- plugins/20_events/plugin.toml | 2 +- plugins/apps/plugin.toml | 2 +- plugins/build-env/plugin.toml | 2 +- plugins/certs/plugin.toml | 2 +- plugins/checks/plugin.toml | 2 +- plugins/common/plugin.toml | 2 +- plugins/config/plugin.toml | 2 +- plugins/docker-options/plugin.toml | 2 +- plugins/domains/plugin.toml | 2 +- plugins/enter/plugin.toml | 2 +- plugins/git/plugin.toml | 2 +- plugins/logs/plugin.toml | 2 +- plugins/network/plugin.toml | 2 +- plugins/nginx-vhosts/plugin.toml | 2 +- plugins/plugin/plugin.toml | 2 +- plugins/proxy/plugin.toml | 2 +- plugins/ps/plugin.toml | 2 +- plugins/repo/plugin.toml | 2 +- plugins/scheduler-docker-local/plugin.toml | 2 +- plugins/shell/plugin.toml | 2 +- plugins/ssh-keys/plugin.toml | 2 +- plugins/storage/plugin.toml | 2 +- plugins/tags/plugin.toml | 2 +- plugins/tar/plugin.toml | 2 +- 38 files changed, 128 insertions(+), 108 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index b7cec737c..86c7bf9ae 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,25 @@ # History +## 0.12.11 + +### Bug Fixes + +- #3238: @josegonzalez Handle proxy issues in app renaming +- #3234: @mashrikt Unset GIT_QUARANTINE_PATH when updating repo submodule +- #3223: @josegonzalez Get the global scheduler if no app is specified +- #3218: @wcalandro Fix error text when using "dokku plugin:uninstall" + +### New Features + +- #3242: @josegonzalez Upgrade herokuish to 0.4.3 +- #3241: @josegonzalez Add a subcommand for retrieving failed app deploy logs +- #3237: @josegonzalez Support --quiet header when showing all environment variables + +### Documentation + +- #3235: @josegonzalez Switch from ps:rebuild to ps:restart +- #3221: @josegonzalez Better callout for why env vars do not get applied to dockerfile builds + ## 0.12.10 ### New Features diff --git a/README.md b/README.md index b06070c16..71353a4a5 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,8 @@ A fresh VM running any of the following operating systems: To install the latest stable release, run the following commands as a user who has access to `sudo`: ```shell -wget https://raw.githubusercontent.com/dokku/dokku/v0.12.10/bootstrap.sh -sudo DOKKU_TAG=v0.12.10 bash bootstrap.sh +wget https://raw.githubusercontent.com/dokku/dokku/v0.12.11/bootstrap.sh +sudo DOKKU_TAG=v0.12.11 bash bootstrap.sh ``` You can then proceed to the ip address or domain name associated with your server to complete the web-based installation. diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index be0c5db40..583352ffb 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -10,7 +10,7 @@ import subprocess import sys import threading -VERSION = 'v0.12.10' +VERSION = 'v0.12.11' hostname = '' try: diff --git a/debian/control b/debian/control index f3b6a4528..eb2bff19e 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: dokku -Version: 0.12.10 +Version: 0.12.11 Section: web Priority: optional Architecture: amd64 diff --git a/docs/advanced-usage/plugin-management.md b/docs/advanced-usage/plugin-management.md index 81d5afa5d..c7665101e 100644 --- a/docs/advanced-usage/plugin-management.md +++ b/docs/advanced-usage/plugin-management.md @@ -31,31 +31,31 @@ dokku plugin ``` plugn: dev - 00_dokku-standard 0.12.10 enabled dokku core standard plugin - 20_events 0.12.10 enabled dokku core events logging plugin - apps 0.12.10 enabled dokku core apps plugin - build-env 0.12.10 enabled dokku core build-env plugin - certs 0.12.10 enabled dokku core certificate management plugin - checks 0.12.10 enabled dokku core checks plugin - common 0.12.10 enabled dokku core common plugin - config 0.12.10 enabled dokku core config plugin - docker-options 0.12.10 enabled dokku core docker-options plugin - domains 0.12.10 enabled dokku core domains plugin - enter 0.12.10 enabled dokku core enter plugin - git 0.12.10 enabled dokku core git plugin - logs 0.12.10 enabled dokku core logs plugin - named-containers 0.12.10 enabled dokku core named containers plugin - network 0.12.10 enabled dokku core network plugin - nginx-vhosts 0.12.10 enabled dokku core nginx-vhosts plugin - plugin 0.12.10 enabled dokku core plugin plugin - proxy 0.12.10 enabled dokku core proxy plugin - ps 0.12.10 enabled dokku core ps plugin - repo 0.12.10 enabled dokku core repo plugin - shell 0.12.10 enabled dokku core shell plugin - ssh-keys 0.12.10 enabled dokku core ssh-keys plugin - storage 0.12.10 enabled dokku core storage plugin - tags 0.12.10 enabled dokku core tags plugin - tar 0.12.10 enabled dokku core tar plugin + 00_dokku-standard 0.12.11 enabled dokku core standard plugin + 20_events 0.12.11 enabled dokku core events logging plugin + apps 0.12.11 enabled dokku core apps plugin + build-env 0.12.11 enabled dokku core build-env plugin + certs 0.12.11 enabled dokku core certificate management plugin + checks 0.12.11 enabled dokku core checks plugin + common 0.12.11 enabled dokku core common plugin + config 0.12.11 enabled dokku core config plugin + docker-options 0.12.11 enabled dokku core docker-options plugin + domains 0.12.11 enabled dokku core domains plugin + enter 0.12.11 enabled dokku core enter plugin + git 0.12.11 enabled dokku core git plugin + logs 0.12.11 enabled dokku core logs plugin + named-containers 0.12.11 enabled dokku core named containers plugin + network 0.12.11 enabled dokku core network plugin + nginx-vhosts 0.12.11 enabled dokku core nginx-vhosts plugin + plugin 0.12.11 enabled dokku core plugin plugin + proxy 0.12.11 enabled dokku core proxy plugin + ps 0.12.11 enabled dokku core ps plugin + repo 0.12.11 enabled dokku core repo plugin + shell 0.12.11 enabled dokku core shell plugin + ssh-keys 0.12.11 enabled dokku core ssh-keys plugin + storage 0.12.11 enabled dokku core storage plugin + tags 0.12.11 enabled dokku core tags plugin + tar 0.12.11 enabled dokku core tar plugin ``` Installing a plugin is easy as well using the `plugin:install` command. This command will also trigger the `install` pluginhook on all existing plugins. diff --git a/docs/assets/favicons/browserconfig.xml b/docs/assets/favicons/browserconfig.xml index cd18a8fa0..3bb0a66fd 100644 --- a/docs/assets/favicons/browserconfig.xml +++ b/docs/assets/favicons/browserconfig.xml @@ -2,10 +2,10 @@ - - - - + + + + #da532c diff --git a/docs/assets/favicons/manifest.json b/docs/assets/favicons/manifest.json index ca352c941..35ece2e3e 100644 --- a/docs/assets/favicons/manifest.json +++ b/docs/assets/favicons/manifest.json @@ -2,37 +2,37 @@ "name": "Dokku", "icons": [ { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-36x36.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-36x36.png", "sizes": "36x36", "type": "image\/png", "density": "0.75" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-48x48.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-48x48.png", "sizes": "48x48", "type": "image\/png", "density": "1.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-72x72.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-72x72.png", "sizes": "72x72", "type": "image\/png", "density": "1.5" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-96x96.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-96x96.png", "sizes": "96x96", "type": "image\/png", "density": "2.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-144x144.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-144x144.png", "sizes": "144x144", "type": "image\/png", "density": "3.0" }, { - "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.10\/docs\/assets\/favicons\/android-chrome-192x192.png", + "src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.12.11\/docs\/assets\/favicons\/android-chrome-192x192.png", "sizes": "192x192", "type": "image\/png", "density": "4.0" diff --git a/docs/assets/style.css b/docs/assets/style.css index f2b2bbe04..c855ff492 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -39,13 +39,13 @@ h1 { font-size: 1.6em; } .header .navbar-brand a { - background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.10/docs/assets/dokku.png); + background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.11/docs/assets/dokku.png); text-indent: 40px; } .blurb { color: #424242; background-color: #ededed; - background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.10/docs/assets/gplaypattern.png); + background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.12.11/docs/assets/gplaypattern.png); padding: 45px 0; text-align: center; } diff --git a/docs/assets/versions.json b/docs/assets/versions.json index dfa36299d..b6bb9cc0c 100644 --- a/docs/assets/versions.json +++ b/docs/assets/versions.json @@ -9,6 +9,6 @@ "0.9.4", "0.10.5", "0.11.6", - "0.12.10" + "0.12.11" ] } diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 079048eaf..3605fb8aa 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -30,7 +30,7 @@ The workflow looks like this: ```shell # having dokku-arch in ../dokku-arch vagrant up build-arch -# wait for "==> build-arch: ==> Finished making: dokku 0.12.10-2 (Mon Feb 22 23:20:37 CET 2016)" +# wait for "==> build-arch: ==> Finished making: dokku 0.12.11-2 (Mon Feb 22 23:20:37 CET 2016)" cd ../dokku-arch git add PKGBUILD .SRCINFO git commit -m 'Update to dokku 0.9.9' diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 124e8ff5c..3f83237e6 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -21,8 +21,8 @@ To install the latest stable version of dokku, you can run the following shell c ```shell # for debian systems, installs Dokku via apt-get -wget https://raw.githubusercontent.com/dokku/dokku/v0.12.10/bootstrap.sh; -sudo DOKKU_TAG=v0.12.10 bash bootstrap.sh +wget https://raw.githubusercontent.com/dokku/dokku/v0.12.11/bootstrap.sh; +sudo DOKKU_TAG=v0.12.11 bash bootstrap.sh ``` The installation process takes about 5-10 minutes, depending upon internet connection speed. diff --git a/docs/home.html b/docs/home.html index 79b8b7cb9..ee27a8238 100644 --- a/docs/home.html +++ b/docs/home.html @@ -10,30 +10,30 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.12.10/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.12.11/bootstrap.sh

$ - sudo DOKKU_TAG=v0.12.10 bash bootstrap.sh + sudo DOKKU_TAG=v0.12.11 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/template.html b/docs/template.html index 2914c30a4..5f81dacb4 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.12.11/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.12.12/bootstrap.sh

$ - sudo DOKKU_TAG=v0.12.11 bash bootstrap.sh + sudo DOKKU_TAG=v0.12.12 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/template.html b/docs/template.html index 5f81dacb4..74cce8242 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.12.12/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.12.13/bootstrap.sh

$ - sudo DOKKU_TAG=v0.12.12 bash bootstrap.sh + sudo DOKKU_TAG=v0.12.13 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/template.html b/docs/template.html index 74cce8242..b57d43234 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.12.13/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.13.0/bootstrap.sh

$ - sudo DOKKU_TAG=v0.12.13 bash bootstrap.sh + sudo DOKKU_TAG=v0.13.0 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/template.html b/docs/template.html index b57d43234..912cc1d67 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + @@ -98,12 +98,12 @@

$ - wget https://raw.githubusercontent.com/dokku/dokku/v0.13.0/bootstrap.sh + wget https://raw.githubusercontent.com/dokku/dokku/v0.13.1/bootstrap.sh

$ - sudo DOKKU_TAG=v0.13.0 bash bootstrap.sh + sudo DOKKU_TAG=v0.13.1 bash bootstrap.sh

 # go to your server's IP and follow the web installer diff --git a/docs/template.html b/docs/template.html index 912cc1d67..8bd9323e1 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - +