From b7724b826cd2d6b8228a79cc920e463ae4219d96 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Oct 2018 14:16:47 -0400 Subject: [PATCH] fix: correct issues in upgrade and fix tests --- common-functions | 1 + subcommands/upgrade | 4 ++-- tests/service_unlink.bats | 2 +- tests/test_helper.bash | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 tests/test_helper.bash diff --git a/common-functions b/common-functions index 21c89e7..f2a9716 100755 --- a/common-functions +++ b/common-functions @@ -283,6 +283,7 @@ service_container_rm() { [[ -z "$ID" ]] && return 0 dokku_log_verbose_quiet "Removing container" + docker update --restart=no "$SERVICE_NAME" > /dev/null 2>&1 if ! docker rm "$SERVICE_NAME" > /dev/null 2>&1; then dokku_log_fail "Unable to remove container for service $SERVICE" fi diff --git a/subcommands/upgrade b/subcommands/upgrade index 37cd4c6..76f1a9b 100755 --- a/subcommands/upgrade +++ b/subcommands/upgrade @@ -21,8 +21,6 @@ service-upgrade-cmd() { verify_service_name "$SERVICE" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" - local ID="$(cat "$SERVICE_ROOT/ID")" - is_container_status "$ID" "Running" || dokku_log_fail "Service ${SERVICE} container is not running" service_parse_args "${@:2}" @@ -40,6 +38,7 @@ service-upgrade-cmd() { if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then dokku_log_info2 "Stopping all linked services" for app in $(service_linked_apps "$SERVICE"); do + [[ "$app" == "-" ]] && continue ps_stop "$app" done fi @@ -51,6 +50,7 @@ service-upgrade-cmd() { if [[ "$SERVICE_RESTART_APPS" == "true" ]]; then dokku_log_info2 "Starting all linked services" for app in $(service_linked_apps "$SERVICE"); do + [[ "$app" == "-" ]] && continue ps_start "$app" done fi diff --git a/tests/service_unlink.bats b/tests/service_unlink.bats index 24aaca3..fe6c17c 100755 --- a/tests/service_unlink.bats +++ b/tests/service_unlink.bats @@ -52,7 +52,7 @@ teardown() { check_value="Deploy options: --restart=on-failure:10" fi - options=$(dokku $report_action my_app | xargs) + options=$(dokku --quiet $report_action my_app | xargs) assert_equal "$options" "$check_value" } diff --git a/tests/test_helper.bash b/tests/test_helper.bash old mode 100644 new mode 100755 index 9872522..ef7ab44 --- a/tests/test_helper.bash +++ b/tests/test_helper.bash @@ -1,5 +1,4 @@ #!/usr/bin/env bash -export DOKKU_QUIET_OUTPUT=1 export DOKKU_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku" export DOKKU_VERSION=${DOKKU_VERSION:-"master"} export PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/bin:$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/dokku:$PATH"