Merge branch 'master' into add-ppa-before-apt
This commit is contained in:
commit
34d80a18dc
3 files changed
+26
-1
No files matched your search
@@ -8,6 +8,10 @@ apps_pre_delete() {
|
|||||||
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
if ! is_image_herokuish_based "$IMAGE"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d $CACHE_DIR ]]; then
|
if [[ -d $CACHE_DIR ]]; then
|
||||||
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -985,6 +985,7 @@ get_container_ports() {
|
|||||||
|
|
||||||
get_app_urls() {
|
get_app_urls() {
|
||||||
declare desc="print an app's available urls"
|
declare desc="print an app's available urls"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||||
@@ -1015,7 +1016,11 @@ get_app_urls() {
|
|||||||
local URLS="$(merge_dedupe_list "$port_urls $app_urls" " ")"
|
local URLS="$(merge_dedupe_list "$port_urls $app_urls" " ")"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
url)
|
url)
|
||||||
echo "$URLS" | tr ' ' '\n' | head -n1
|
if is_ssl_enabled "$APP"; then
|
||||||
|
echo "$URLS" | tr ' ' '\n' | grep https | head -n1
|
||||||
|
else
|
||||||
|
echo "$URLS" | tr ' ' '\n' | head -n1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
urls)
|
urls)
|
||||||
echo "$URLS" | tr ' ' '\n' | sort
|
echo "$URLS" | tr ' ' '\n' | sort
|
||||||
|
|||||||
@@ -22,6 +22,15 @@ assert_urls() {
|
|||||||
assert_output < <(tr ' ' '\n' <<< "${urls}" | sort)
|
assert_output < <(tr ' ' '\n' <<< "${urls}" | sort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_url() {
|
||||||
|
url=$1
|
||||||
|
run dokku url $TEST_APP
|
||||||
|
echo "output: "$output
|
||||||
|
echo "status: "$status
|
||||||
|
echo "url: ${url}"
|
||||||
|
assert_output "${url}"
|
||||||
|
}
|
||||||
|
|
||||||
build_nginx_config() {
|
build_nginx_config() {
|
||||||
# simulate nginx post-deploy
|
# simulate nginx post-deploy
|
||||||
dokku domains:setup $TEST_APP
|
dokku domains:setup $TEST_APP
|
||||||
@@ -64,6 +73,13 @@ build_nginx_config() {
|
|||||||
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(core) url (app ssl)" {
|
||||||
|
setup_test_tls
|
||||||
|
assert_url "https://dokku.me"
|
||||||
|
build_nginx_config
|
||||||
|
assert_url "https://${TEST_APP}.dokku.me"
|
||||||
|
}
|
||||||
|
|
||||||
@test "(core) urls (wildcard ssl)" {
|
@test "(core) urls (wildcard ssl)" {
|
||||||
setup_test_tls wildcard
|
setup_test_tls wildcard
|
||||||
assert_urls "https://dokku.me"
|
assert_urls "https://dokku.me"
|
||||||
|
|||||||
Reference in new issue
Block a user