From bdc3353a5cb1458295c983b11b1c33107276bf63 Mon Sep 17 00:00:00 2001 From: Mirko Geissler Date: Thu, 30 Jun 2016 08:17:21 +0200 Subject: [PATCH] Remove domains:set-global command --- docs/configuration/domains.md | 2 +- plugins/domains/commands | 1 - plugins/domains/functions | 12 ------------ plugins/domains/subcommands/set-global | 13 ------------- tests/unit/20_domains.bats | 12 ------------ 5 files changed, 1 insertion(+), 39 deletions(-) delete mode 100755 plugins/domains/subcommands/set-global diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 2bd4e4f25..5f3e7efbd 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -21,7 +21,7 @@ Applications typically have the following structure for their hostname: scheme://subdomain.domain.tld ``` -The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial configuration and stored in the `$DOKKU_ROOT/VHOST` file. It can then be modified with `dokku domains:set-global`. This value is used as a default TLD for all applications on a host. +The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial configuration and stored in the `$DOKKU_ROOT/VHOST` file. It can then be modified with `dokku domains:add-global` and `dokku domains:remove-global`. This value is used as a default TLD for all applications on a host. If a FQDN such as `other.tld` is used as the application name, the default `$DOKKU_ROOT/VHOST` will be ignored and the resulting vhost URL for that application will be `other.tld`. The exception to this rule being that if the FQDN has the same ending as the default vhost (such as `subdomain.domain.tld`), then the entire FQDN will be treated as a subdomain. The application will therefore be deployed at `subdomain.domain.tld.domain.tld`. diff --git a/plugins/domains/commands b/plugins/domains/commands index 95dfdee9d..e7f12bf2f 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -15,7 +15,6 @@ case "$1" in domains:enable , Enable VHOST support domains:remove DOMAIN, Remove a domain from app domains:remove-global DOMAIN, Remove global domain name - domains:set-global , Set global domain name help_content } diff --git a/plugins/domains/functions b/plugins/domains/functions index 65ce85628..2cc3a78a4 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -163,15 +163,3 @@ domains_remove_global() { dokku_log_info1 "Removed $DOMAIN" done } - -domains_set_global() { - declare desc="set global domain name" - local NEW_GLOBAL_VHOST="$1"; local GLOBAL_VHOST_PATH="$DOKKU_ROOT/VHOST" - - if [[ -n "$NEW_GLOBAL_VHOST" ]]; then - echo "$NEW_GLOBAL_VHOST" > "$GLOBAL_VHOST_PATH" - dokku_log_info1 "Set global domain to $NEW_GLOBAL_VHOST" - else - dokku_log_fail "New global domain name must not be blank" - fi -} diff --git a/plugins/domains/subcommands/set-global b/plugins/domains/subcommands/set-global deleted file mode 100755 index 18ae15a11..000000000 --- a/plugins/domains/subcommands/set-global +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -source "$PLUGIN_AVAILABLE_PATH/domains/functions" - -domains_set_global_cmd() { - declare desc="set global domain name from command line" - local cmd="domains:set-global" - [[ -z $2 ]] && dokku_log_fail "Please specify a global domain name" - domains_set_global "$2" -} - -domains_set_global_cmd "$@" diff --git a/tests/unit/20_domains.bats b/tests/unit/20_domains.bats index a15df8883..173b36fc0 100644 --- a/tests/unit/20_domains.bats +++ b/tests/unit/20_domains.bats @@ -142,18 +142,6 @@ teardown() { refute_line "global.dokku.me" } -@test "(domains) domains:set-global" { - run dokku domains:set-global global.dokku.me - echo "output: "$output - echo "status: "$status - assert_success - - run bash -c "dokku domains | grep -q global.dokku.me" - echo "output: "$output - echo "status: "$status - assert_success -} - @test "(domains) domains (multiple global domains)" { run dokku domains:add-global global1.dokku.me global2.dokku.me echo "output: "$output