Name the server OMARCHY_REPO_HOST, not OMARCHY_BUILD_HOST

Builds now happen wherever the operator likes, so naming the destination after
building described the old arrangement rather than the current one. What the
push and deploy commands reach is the machine that serves pkgs.omarchy.org and
holds the signing key: the repository host. It also runs the scheduled builds,
which is why the trigger in omarchy-pkgs release points at the same place.

Resolution moves into helpers/host-helpers.sh, which all three commands now
share instead of repeating: --host, then OMARCHY_REPO_HOST, then .repo-host.
OMARCHY_BUILD_HOST and .build-host keep working as fallbacks, so existing
environments and checkouts are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-12 03:46:58 -07:00
co-authored by Claude Opus 5
parent fd9c078bf2
commit 34326295e9
7 changed files with 101 additions and 57 deletions
+55
View File
@@ -0,0 +1,55 @@
# Resolving the Omarchy repository host
#
# One machine both hosts pkgs.omarchy.org and runs the scheduled builds. The
# commands that reach it are doing repository work — uploading artifacts,
# signing, publishing — so the setting is named for the repository rather than
# for building, which now happens on whatever machine the operator prefers.
#
# OMARCHY_BUILD_HOST and .build-host are the previous names and still work.
# Usage: resolve_repo_host [explicit-host]
# Prints the host, or nothing when none is configured.
resolve_repo_host() {
local explicit="${1:-}"
if [[ -n "$explicit" ]]; then
echo "$explicit"
return 0
fi
if [[ -n "${OMARCHY_REPO_HOST:-}" ]]; then
echo "$OMARCHY_REPO_HOST"
return 0
fi
if [[ -n "${OMARCHY_BUILD_HOST:-}" ]]; then
echo "$OMARCHY_BUILD_HOST"
return 0
fi
local file
for file in "$BUILD_ROOT/.repo-host" "$BUILD_ROOT/.build-host"; do
if [[ -f "$file" ]]; then
# Ignore blank lines and comments so the file can be annotated.
local value
value=$(grep -vE '^\s*(#|$)' "$file" | head -1 | tr -d '[:space:]')
if [[ -n "$value" ]]; then
echo "$value"
return 0
fi
fi
done
return 1
}
# Shared wording so every command explains configuration the same way.
print_no_repo_host() {
print_error "No repository host configured"
echo ""
echo "Pass --host, set OMARCHY_REPO_HOST, or write the destination to:"
echo " $BUILD_ROOT/.repo-host"
echo ""
echo "That file also arms the automatic build trigger in 'bin/omarchy-pkgs"
echo "release'. Use --host or OMARCHY_REPO_HOST to keep them separate."
}