mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Implement domains:reset
This commit is contained in:
committed by
Jose Diaz-Gonzalez
parent
b97086a8bd
commit
67311264d7
@@ -36,6 +36,7 @@ fn-help-content() {
|
||||
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
||||
domains:remove-global <domain> [<domain> ...], Remove global domain names
|
||||
domains:report [<app>|--global] [<flag>], Displays a domains report for one or more apps
|
||||
domains:reset <app>, Reset app domains to global-configured domains
|
||||
domains:set <app> <domain> [<domain> ...], Set domains for app
|
||||
domains:set-global <domain> [<domain> ...], Set global domain names
|
||||
help_content
|
||||
|
||||
22
plugins/domains/subcommands/reset
Executable file
22
plugins/domains/subcommands/reset
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||
|
||||
cmd-domains-reset() {
|
||||
declare desc="reset app domains to global-configured domains"
|
||||
declare cmd="domains:reset"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
verify_app_name "$APP"
|
||||
local APP_VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
rm -f "$APP_VHOST_PATH"
|
||||
domains_setup "$APP"
|
||||
plugn trigger post-domains-update "$APP" "reset"
|
||||
dokku_log_info1 "Reset domains for $APP"
|
||||
}
|
||||
|
||||
cmd-domains-reset "$@"
|
||||
Reference in New Issue
Block a user