From d27c8f09d1eec408d0a7b5ebfe5746ff008b1978 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 12 Feb 2023 13:08:45 -0500 Subject: [PATCH] chore: remove deprecated common functions --- docs/appendices/0.30.0-migration-guide.md | 3 +++ plugins/common/functions | 32 ----------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/docs/appendices/0.30.0-migration-guide.md b/docs/appendices/0.30.0-migration-guide.md index 00678862b..4060b4bed 100644 --- a/docs/appendices/0.30.0-migration-guide.md +++ b/docs/appendices/0.30.0-migration-guide.md @@ -15,3 +15,6 @@ - `apps#apps_destroy()` is removed in favor of `plugn trigger app-destroy`. - `apps#apps_exists()` is removed in favor of `plugn trigger app-exists`. - `apps#apps_maybe_create()` is removed in favor of `plugn trigger app-maybe-create`. +- The following common shell functions have been removed. + - `common#is_container_running()` (deprecated since 0.12.6) is removed in favor of `common#is_container_status()`. + - `common#is_app_running()` (deprecated since 0.22.0) is removed in favor of `ps#fn-ps-is-app-running()`. diff --git a/plugins/common/functions b/plugins/common/functions index 749f968e7..a6a140796 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -573,22 +573,6 @@ is_deployed() { "$PLUGIN_CORE_AVAILABLE_PATH/common/common" --quiet is-deployed "$APP" } -is_container_running() { - declare desc="return 0 if given docker container id is in running state" - declare deprecated=true - declare CID="$1" - local CONTAINER_STATUS - - dokku_log_warn "Deprecated: common#is_container_status" - CONTAINER_STATUS=$("$DOCKER_BIN" container inspect --format '{{.State.Running}}' "$CID" || true) - - if [[ "$CONTAINER_STATUS" == "true" ]]; then - return 0 - fi - - return 1 -} - is_container_status() { declare desc="return 0 if given docker container id is in given state" local CID=$1 @@ -602,22 +586,6 @@ is_container_status() { return 1 } -is_app_running() { - declare desc="return 0 if given app has a running container" - declare deprecated=true - local APP="$1" - - dokku_log_warn "Deprecated: ps#fn-ps-is-app-running" - - local APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids "$APP" 2>/dev/null) - - if [[ -n "$APP_RUNNING_CONTAINER_IDS" ]]; then - return 0 - else - return 1 - fi -} - dokku_build() { declare desc="build phase" declare APP="$1" IMAGE_SOURCE_TYPE="$2" SOURCECODE_WORK_DIR="$3"