fix: correct issues in upgrade and fix tests

This commit is contained in:
Jose Diaz-Gonzalez
2018-10-11 14:16:47 -04:00
parent 4948e2b91d
commit 1542a9556f
3 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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

1
tests/test_helper.bash Normal file → Executable file
View File

@@ -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"