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:
1 parent
fd9c078bf2
commit
34326295e9
7 files changed
+101
-57
No files matched your search
+9
-16
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Build packages locally, then publish them from the build host.
|
||||
# Build packages locally, then publish them from the repository host.
|
||||
#
|
||||
# The two halves of shipping a package built on a local machine: bin/build
|
||||
# produces the artifacts, bin/push-build hands them to the host that owns the
|
||||
@@ -11,6 +11,7 @@ SCRIPT_DIR=$(realpath "${BASH_SOURCE[0]%/*}")
|
||||
BUILD_ROOT=$(realpath "$SCRIPT_DIR/..")
|
||||
source "$BUILD_ROOT/helpers/message-helpers.sh"
|
||||
source "$BUILD_ROOT/helpers/paths.sh"
|
||||
source "$BUILD_ROOT/helpers/host-helpers.sh"
|
||||
|
||||
PACKAGES=()
|
||||
PACKAGE_FLAG_GIVEN=false
|
||||
@@ -64,13 +65,13 @@ while [[ $# -gt 0 ]]; do
|
||||
-h | --help)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Build packages here, then publish them from the build host."
|
||||
echo "Build packages here, then publish them from the repository host."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --arch <arch> Target architecture (default: x86_64)"
|
||||
echo " --mirror <mirror> Mirror to publish to (edge or stable, default: edge)"
|
||||
echo " --package <names> Build and push only these packages (space-separated)"
|
||||
echo " --host <host> ssh destination (default: \$OMARCHY_BUILD_HOST or .build-host)"
|
||||
echo " --host <host> ssh destination (default: \$OMARCHY_REPO_HOST or .repo-host)"
|
||||
echo " --remote-root <path> Repository path on the host (default: /root/omarchy-pkgs)"
|
||||
echo " --dry-run Show the plan, build nothing and transfer nothing"
|
||||
echo " -y, --yes Do not ask for confirmation before publishing"
|
||||
@@ -96,7 +97,7 @@ fi
|
||||
echo ""
|
||||
print_info "This will:"
|
||||
echo " 1. Build packages locally"
|
||||
echo " 2. Upload them to the build host"
|
||||
echo " 2. Upload them to the repository host"
|
||||
echo " 3. Sign, promote, update and sync them there"
|
||||
echo ""
|
||||
|
||||
@@ -112,18 +113,10 @@ fi
|
||||
[[ "$DRY_RUN" == true ]] && BUILD_ARGS+=("--dry-run") && PUSH_ARGS+=("--dry-run")
|
||||
[[ "$ASSUME_YES" == true ]] && PUSH_ARGS+=("--yes")
|
||||
|
||||
# Resolve the host before spending build time on packages that cannot ship.
|
||||
# Resolve the repository host before spending build time on packages that cannot ship.
|
||||
if [[ "$DRY_RUN" != true ]]; then
|
||||
resolved_host="$HOST"
|
||||
if [[ -z "$resolved_host" ]]; then
|
||||
resolved_host="${OMARCHY_BUILD_HOST:-}"
|
||||
[[ -z "$resolved_host" && -f "$BUILD_ROOT/.build-host" ]] && resolved_host=$(<"$BUILD_ROOT/.build-host")
|
||||
fi
|
||||
if [[ -z "$resolved_host" ]]; then
|
||||
print_error "No build host configured"
|
||||
echo ""
|
||||
echo "Pass --host, set OMARCHY_BUILD_HOST, or write the destination to:"
|
||||
echo " $BUILD_ROOT/.build-host"
|
||||
if ! resolve_repo_host "$HOST" >/dev/null; then
|
||||
print_no_repo_host
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -133,6 +126,6 @@ echo ""
|
||||
"$SCRIPT_DIR/build" "${BUILD_ARGS[@]}"
|
||||
echo ""
|
||||
|
||||
print_info "Step 2/2: Pushing to the build host..."
|
||||
print_info "Step 2/2: Pushing to the repository host..."
|
||||
echo ""
|
||||
"$SCRIPT_DIR/push-build" "${PUSH_ARGS[@]}"
|
||||
Reference in new issue
Block a user