refactor: simplify how url generation works

The URLS file is no longer necessary as urls are now generated directly from the app VHOST file.

This also moves all the url generation logic to the domains plugin.
This commit is contained in:
Jose Diaz-Gonzalez
2022-12-02 02:19:59 -05:00
parent f4f0a29446
commit edd6e476b3
23 changed files with 247 additions and 179 deletions

View File

@@ -218,10 +218,6 @@ destroy_key() {
rm -f /tmp/testkey* &>/dev/null || true
}
add_domain() {
dokku domains:add "$TEST_APP" "$1"
}
# shellcheck disable=SC2119
check_urls() {
local PATTERN="$1"
@@ -288,10 +284,14 @@ assert_not_external_port() {
assert_url() {
url="$1"
run /bin/bash -c "dokku url $TEST_APP"
run /bin/bash -c "dokku url $TEST_APP | xargs"
echo "VHOST: $(cat $DOKKU_ROOT/$TEST_APP/VHOST | xargs)"
echo "tls: $(ls $DOKKU_ROOT/$TEST_APP/tls || true)"
echo "proxy-is-enabled: $(dokku plugin:trigger proxy-is-enabled "$TEST_APP")"
echo "port-map: $(dokku config:get "$TEST_APP" DOKKU_PROXY_PORT_MAP)"
echo "url: $(dokku urls $TEST_APP)"
echo "output: $output"
echo "status: $status"
echo "url: ${url}"
assert_output "${url}"
}
@@ -299,9 +299,13 @@ assert_urls() {
# shellcheck disable=SC2124
urls="$@"
run /bin/bash -c "dokku urls $TEST_APP | xargs"
echo "VHOST: $(cat $DOKKU_ROOT/$TEST_APP/VHOST | xargs)"
echo "tls: $(ls $DOKKU_ROOT/$TEST_APP/tls || true)"
echo "proxy-is-enabled: $(dokku plugin:trigger proxy-is-enabled "$TEST_APP")"
echo "port-map: $(dokku config:get "$TEST_APP" DOKKU_PROXY_PORT_MAP)"
echo "urls: $(dokku urls $TEST_APP)"
echo "output: $output"
echo "status: $status"
echo "urls:" "$urls"
assert_output "$urls"
}