refactor: rename computed-* helpers, expose computed vector and network keys
Addresses review feedback on #8640. fn-archive-max-size, fn-archive-max-files, fn-git-deploy-branch, and fn-git-keep-git-dir are renamed with `computed` in the function name so the names match the resolved-with-default semantic they implement, and every caller is updated in lockstep. logs:report renames the misordered --logs-vector-global-image and --logs-vector-global-networks to --logs-global-vector-image and --logs-global-vector-networks, makes the global getters return the raw stored value, and adds --logs-computed-vector-image, --logs-computed-vector-networks, and --logs-computed-vector-sink. network:report --global gains the computed-* keys for attach-post-create, attach-post-deploy, initial-network, and tld so external tooling can read the resolved value at global scope. The --quiet flag is dropped from every :report --format json | jq invocation across the PR's bats files; the report's --format json output is the only stdout and the flag is redundant.
This commit is contained in:
@@ -65,7 +65,7 @@ cmd-git-hook() {
|
||||
|
||||
plugn trigger app-exists "$APP" 2>/dev/null || is_valid_app_name "$APP"
|
||||
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-computed-deploy-branch "$APP")"
|
||||
if ! git check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then
|
||||
echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via deploy-branch setting."
|
||||
echo $'\e[1G\e[K'"-----> For more details, please see the man page for 'git-check-ref-format.'"
|
||||
@@ -84,7 +84,7 @@ cmd-git-hook() {
|
||||
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 1 ]]; then
|
||||
plugn trigger receive-branch "$APP" "$newrev" "$refname"
|
||||
plugn trigger deploy-source-set "$APP" "git-push" "$newrev"
|
||||
elif [[ -z "$(fn-git-deploy-branch "$APP" "")" ]]; then
|
||||
elif [[ -z "$(fn-git-computed-deploy-branch "$APP" "")" ]]; then
|
||||
local deploy_branch="${refname/refs\/heads\//}"
|
||||
deploy_branch="${deploy_branch/refs\/tags\//}"
|
||||
|
||||
@@ -115,7 +115,7 @@ git_build() {
|
||||
fi
|
||||
local REF="$REV"
|
||||
else
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-computed-deploy-branch "$APP")"
|
||||
if [[ -f "$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" ]]; then
|
||||
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user