diff --git a/plugins/caddy-vhosts/command-functions b/plugins/caddy-vhosts/command-functions index 351cf88e5..a8d56f85f 100755 --- a/plugins/caddy-vhosts/command-functions +++ b/plugins/caddy-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/caddy-vhosts/pre-restore b/plugins/caddy-vhosts/pre-restore index 4990a7d8e..3e357b296 100755 --- a/plugins/caddy-vhosts/pre-restore +++ b/plugins/caddy-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/common/functions b/plugins/common/functions index a3ed2c9ef..3d5246c21 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -eo pipefail [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" has_tty() { declare desc="return 0 if we have a tty" @@ -975,10 +976,6 @@ fn-migrate-config-to-property() { source "$PLUGIN_AVAILABLE_PATH/config/functions" fi - if ! declare -f -F fn-plugin-property-write >/dev/null; then - source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" - fi - if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then local value=$(plugn trigger config-get-global "$GLOBAL_CONFIG_VAR" || true) if [[ -n "$value" ]]; then diff --git a/plugins/haproxy-vhosts/command-functions b/plugins/haproxy-vhosts/command-functions index 20358ec13..00ac09698 100755 --- a/plugins/haproxy-vhosts/command-functions +++ b/plugins/haproxy-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/haproxy-vhosts/pre-restore b/plugins/haproxy-vhosts/pre-restore index ed637bd96..ca74e46a1 100755 --- a/plugins/haproxy-vhosts/pre-restore +++ b/plugins/haproxy-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/nginx-vhosts/pre-restore b/plugins/nginx-vhosts/pre-restore index 40565f897..e326fdb9f 100755 --- a/plugins/nginx-vhosts/pre-restore +++ b/plugins/nginx-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/openresty-vhosts/command-functions b/plugins/openresty-vhosts/command-functions index 09ad8f708..a3515429e 100755 --- a/plugins/openresty-vhosts/command-functions +++ b/plugins/openresty-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/openresty-vhosts/pre-restore b/plugins/openresty-vhosts/pre-restore index 8903a23ae..f347f2629 100755 --- a/plugins/openresty-vhosts/pre-restore +++ b/plugins/openresty-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/traefik-vhosts/command-functions b/plugins/traefik-vhosts/command-functions index 6e43edce1..9d7a922a1 100755 --- a/plugins/traefik-vhosts/command-functions +++ b/plugins/traefik-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/traefik-vhosts/pre-restore b/plugins/traefik-vhosts/pre-restore index 698d97788..6d641a3fa 100755 --- a/plugins/traefik-vhosts/pre-restore +++ b/plugins/traefik-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/tests/unit/core_2.bats b/tests/unit/core_2.bats index 26cf2708c..fed11c1bf 100644 --- a/tests/unit/core_2.bats +++ b/tests/unit/core_2.bats @@ -112,6 +112,27 @@ teardown() { assert_urls "http://dokku.example.com" "http://${TEST_APP}.${DOKKU_DOMAIN}" "https://dokku.example.com" "https://${TEST_APP}.${DOKKU_DOMAIN}" "https://test.${DOKKU_DOMAIN}" "http://test.${DOKKU_DOMAIN}" } +@test "(core) sourcing common/functions exposes fn-plugin-property-* helpers" { + run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-get-default" + echo "output: $output" + echo "status: $status" + assert_success + + run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-write" + echo "output: $output" + echo "status: $status" + assert_success +} + +@test "(core) release_and_deploy does not emit command not found errors" { + run deploy_app + echo "output: $output" + echo "status: $status" + assert_success + assert_output_not_contains "fn-plugin-property-get-default: command not found" + assert_output_not_contains "fn-plugin-property-get: command not found" +} + @test "(core) git-remote (off-port)" { run deploy_app nodejs-express ssh://dokku@127.0.0.1:22333/$TEST_APP echo "output: $output"