Files
dokku/plugins/ps/subcommands/restore
Jose Diaz-Gonzalez 1835b04809 feat: refactor to use network plugin
- Add proxy-build-config hook to rebuild network and proxy settings for an application
- Scope nginx:build-config to work only when it is the configured proxy for an application
- Refactor deploy code to interact with network plugin for computed and actual ipaddr/port settings
- Ensure the proxy-build-config plugin trigger is called on ps:restore
- Expose a few plugin triggers for retrieving networking information for a given APP/PROC_TYPE/CONTAINER_ID combination
2017-10-02 15:05:13 -07:00

31 lines
888 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
ps_restore_cmd() {
declare desc="starts all apps with DOKKU_APP_RESTORE not set to 0 via command line"
local cmd="ps:restore"
if which parallel > /dev/null 2>&1; then
dokku_apps | parallel dokku ps:start
dokku_apps | parallel plugn trigger proxy-build-config
return
fi
for app in $(dokku_apps); do
local DOKKU_APP_RESTORE=$(config_get "$app" DOKKU_APP_RESTORE || true)
if [[ $DOKKU_APP_RESTORE != 0 ]]; then
echo "Restoring app $app ..."
if ps_start "$app"; then
plugn trigger proxy-build-config "$app"
continue
fi
dokku_log_warn "dokku ps:restore ${app} failed"
fi
done
}
ps_restore_cmd "$@"