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[@]}"
|
||||
+7
-8
@@ -15,6 +15,7 @@ set -e
|
||||
|
||||
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
|
||||
source "$BUILD_ROOT/helpers/message-helpers.sh"
|
||||
source "$BUILD_ROOT/helpers/host-helpers.sh"
|
||||
|
||||
UPSTREAM_URL="${OMARCHY_UPSTREAM_URL:-https://github.com/basecamp/omarchy.git}"
|
||||
EDGE_DB_URL="${OMARCHY_EDGE_DB_URL:-https://pkgs.omarchy.org/edge/x86_64/omarchy.db.tar.zst}"
|
||||
@@ -43,8 +44,8 @@ Options for release:
|
||||
--commit <sha> (rc) Upstream commit to pin (default: tip of --ref)
|
||||
--ref <branch> (rc) Upstream branch whose tip to pin (default: $DEFAULT_RC_REF)
|
||||
--yes Skip confirmation prompts
|
||||
--host <host> ssh destination of the build host to trigger, overriding
|
||||
\$OMARCHY_BUILD_HOST and .build-host
|
||||
--host <host> ssh destination of the repository host to trigger,
|
||||
overriding \$OMARCHY_REPO_HOST and .repo-host
|
||||
--no-push Rewrite and commit locally; skip push and build trigger
|
||||
--pr When releasing from a non-master branch, open a GitHub PR
|
||||
to master with gh after pushing
|
||||
@@ -314,11 +315,9 @@ regenerate_checksums() {
|
||||
# --- trigger -----------------------------------------------------------------
|
||||
|
||||
trigger_build_host() {
|
||||
local host="${BUILD_HOST_OVERRIDE:-}"
|
||||
[[ -z "$host" ]] && host="${OMARCHY_BUILD_HOST:-}"
|
||||
[[ -z "$host" && -f "$BUILD_ROOT/.build-host" ]] && host=$(<"$BUILD_ROOT/.build-host")
|
||||
if [[ -z "$host" ]]; then
|
||||
print_info "No build host configured (set OMARCHY_BUILD_HOST or $BUILD_ROOT/.build-host)."
|
||||
local host
|
||||
if ! host=$(resolve_repo_host "${REPO_HOST_OVERRIDE:-}"); then
|
||||
print_info "No repository host configured (set OMARCHY_REPO_HOST or $BUILD_ROOT/.repo-host)."
|
||||
print_info "The 6-hourly auto-release timer will pick this up, or trigger manually:"
|
||||
echo " ssh <build-host> 'git -C /root/omarchy-pkgs pull --ff-only && touch /root/.state/.sync-needed-edge && systemctl start omarchy-auto-release-edge.service'"
|
||||
return 0
|
||||
@@ -344,7 +343,7 @@ cmd_release() {
|
||||
--force) force=true; shift ;;
|
||||
--commit) commit_arg="$2"; shift 2 ;;
|
||||
--ref) ref="$2"; shift 2 ;;
|
||||
--host) BUILD_HOST_OVERRIDE="$2"; shift 2 ;;
|
||||
--host) REPO_HOST_OVERRIDE="$2"; shift 2 ;;
|
||||
--yes) assume_yes=true; shift ;;
|
||||
--dry-run) dry_run=true; shift ;;
|
||||
-h | --help) show_usage; exit 0 ;;
|
||||
|
||||
+7
-18
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Push locally built packages to the build host and publish them there.
|
||||
# Push locally built packages to the repository host and publish them there.
|
||||
#
|
||||
# Heavy packages are quicker to build on a local machine than on the server, but
|
||||
# publishing has to happen where the full repository lives: the signing key is on
|
||||
# the build host, and `bin/repo sync` can only produce a correct remote from a
|
||||
# the repository host, and `bin/repo sync` can only produce a correct remote from a
|
||||
# complete local tree. So this uploads the artifacts and runs the publish steps
|
||||
# over ssh rather than syncing from here.
|
||||
|
||||
@@ -12,6 +12,7 @@ set -e
|
||||
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
|
||||
source "$BUILD_ROOT/helpers/message-helpers.sh"
|
||||
source "$BUILD_ROOT/helpers/paths.sh"
|
||||
source "$BUILD_ROOT/helpers/host-helpers.sh"
|
||||
|
||||
HOST=""
|
||||
REMOTE_ROOT="/root/omarchy-pkgs"
|
||||
@@ -72,14 +73,14 @@ while [[ $# -gt 0 ]]; do
|
||||
-h | --help)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Upload packages from build-output/ to the build host, then sign,"
|
||||
echo "Upload packages from build-output/ to the repository host, then sign,"
|
||||
echo "promote, update and sync them there."
|
||||
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> Only push 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: $REMOTE_ROOT)"
|
||||
echo " --dry-run Show what would be pushed, transfer nothing"
|
||||
echo " -y, --yes Do not ask for confirmation"
|
||||
@@ -100,20 +101,8 @@ done
|
||||
|
||||
# --- host resolution ---------------------------------------------------------
|
||||
|
||||
if [[ -z "$HOST" ]]; then
|
||||
HOST="${OMARCHY_BUILD_HOST:-}"
|
||||
[[ -z "$HOST" && -f "$BUILD_ROOT/.build-host" ]] && HOST=$(<"$BUILD_ROOT/.build-host")
|
||||
fi
|
||||
|
||||
if [[ -z "$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"
|
||||
echo ""
|
||||
echo "Note that .build-host also arms the automatic build trigger in"
|
||||
echo "'bin/omarchy-pkgs release'. Use --host or OMARCHY_BUILD_HOST to keep"
|
||||
echo "this command's host separate from that."
|
||||
if ! HOST=$(resolve_repo_host "$HOST"); then
|
||||
print_no_repo_host
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ show_usage() {
|
||||
echo " list List source package metadata (use --repo for published repo)"
|
||||
echo " remove Remove a specific package"
|
||||
echo " sync Sync repository to remote"
|
||||
echo " push Upload local builds to the build host and publish them there"
|
||||
echo " deploy Build locally, then push: one command for a local build machine"
|
||||
echo " push Upload local builds to the repository host and publish them there"
|
||||
echo " deploy Build locally, then push: one command from a build machine"
|
||||
echo ""
|
||||
echo "Typical workflows:"
|
||||
echo " $0 release # Complete release workflow"
|
||||
|
||||
Reference in new issue
Block a user