diff --git a/README.md b/README.md index 1644495..db000de 100644 --- a/README.md +++ b/README.md @@ -467,12 +467,31 @@ bin/repo advance --from rc --to stable Neither package is on the `fast` ring, and `bin/omarchy-pkgs` never touches stable — promotion is always this explicit step. -### Build trigger +### Build trigger and the build host -After pushing, the command triggers the build host over ssh when -`OMARCHY_REPO_HOST` is set (env var, or a hostname in the git-ignored -`.repo-host` file). Without it, the 6-hourly auto-release timer picks up the -change on its own. +Release commands run from anywhere. When the machine you are on **is** the +build host (detected by the published database living in this checkout), host +operations — build triggers, `advance`, promotion — execute locally. From any +other machine they go over ssh to the configured host; without a configured +host, the exact commands to run are printed and the 6-hourly auto-release +timer serves as the backstop. + +The host setting is any destination `ssh` accepts, resolved in this order: + +1. `--host ` on the command +2. `OMARCHY_REPO_HOST` environment variable +3. the git-ignored `.repo-host` file (one line; `#` comments allowed) + +The server layout lives under `/root`, so the value is `root@`, +`root@`, or — nicest — a `Host` alias from `~/.ssh/config` that +carries the user, key, and port: + +``` +# .repo-host +root@pkgs.example.com +``` + +All connections are plain ssh; nothing else is used to reach the host. ## Directory Structure diff --git a/bin/omarchy-pkgs b/bin/omarchy-pkgs index f72ecc8..707fe51 100755 --- a/bin/omarchy-pkgs +++ b/bin/omarchy-pkgs @@ -19,6 +19,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" UPSTREAM_URL="${OMARCHY_UPSTREAM_URL:-https://github.com/basecamp/omarchy.git}" @@ -322,8 +323,19 @@ regenerate_checksums() { trigger_build_host() { local host + if on_repo_host; then + print_info "Triggering edge build locally (this is the build host)..." + if mkdir -p "${OMARCHY_STATE_DIR:-/root/.state}" && + touch "${OMARCHY_STATE_DIR:-/root/.state}/.sync-needed-edge" && + systemctl start --no-block omarchy-auto-release-edge.service; then + print_success "Edge build triggered" + else + print_warning "Could not start the edge release service — the 6-hourly timer will pick it up" + fi + return 0 + fi 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 "No repository host configured (set OMARCHY_REPO_HOST or $BUILD_ROOT/.repo-host — any ssh destination, e.g. root@ or an ssh-config alias)." print_info "The 6-hourly auto-release timer will pick this up, or trigger manually:" echo " ssh 'git -C /root/omarchy-pkgs pull --ff-only && touch /root/.state/.sync-needed-edge && systemctl start omarchy-auto-release-edge.service'" return 0 diff --git a/bin/omarchy-release b/bin/omarchy-release index 9a476ed..bee7afb 100755 --- a/bin/omarchy-release +++ b/bin/omarchy-release @@ -18,6 +18,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" UPSTREAM_URL="${OMARCHY_UPSTREAM_URL:-https://github.com/basecamp/omarchy.git}" @@ -209,19 +210,19 @@ rc_branch_pin() { # prints "pkgver commit", empty when no rc branch } # --- build host -------------------------------------------------------------- +# +# Every command runs from anywhere: when this machine IS the build host +# (on_repo_host — the published database lives here), host operations execute +# locally; otherwise they go over ssh to the configured destination. The +# destination is anything ssh accepts — root@, root@, or an +# ~/.ssh/config Host alias — from --host, $OMARCHY_REPO_HOST, or .repo-host. repo_host() { resolve_repo_host "$REPO_HOST_OVERRIDE"; } -host_or_print() { # prints the host, or prints manual instructions and fails - local host what="$1" cmd="$2" - if host=$(repo_host); then - echo "$host" - return 0 - fi - print_warning "No build host configured (set OMARCHY_REPO_HOST, --host, or $BUILD_ROOT/.repo-host)" - echo "Run this on the build host to $what:" >&2 - echo " $cmd" >&2 - return 1 +print_no_host_help() { # print_no_host_help