feat: ensure we don't try to restore an app that wasn't deployed
This commit is contained in:
@@ -10,6 +10,11 @@ ps_restore_cmd() {
|
|||||||
local APP="$2"
|
local APP="$2"
|
||||||
|
|
||||||
if [[ -n "$APP" ]]; then
|
if [[ -n "$APP" ]]; then
|
||||||
|
if ! (is_deployed "$APP"); then
|
||||||
|
dokku_log_warn "App $APP has not been deployed"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
DOKKU_APP_RESTORE="$(config_get "$APP" DOKKU_APP_RESTORE || true)"
|
DOKKU_APP_RESTORE="$(config_get "$APP" DOKKU_APP_RESTORE || true)"
|
||||||
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
||||||
ps_start "$APP" || dokku_log_warn "dokku ps:restore ${APP} failed"
|
ps_start "$APP" || dokku_log_warn "dokku ps:restore ${APP} failed"
|
||||||
@@ -37,7 +42,7 @@ ps_restore_all() {
|
|||||||
for app in $(dokku_apps); do
|
for app in $(dokku_apps); do
|
||||||
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
|
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
|
||||||
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
|
||||||
echo "Restoring app $app ..."
|
dokku_log_verbose "Restoring app $app ..."
|
||||||
if ps_start "$app"; then
|
if ps_start "$app"; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user