Explicit host config outranks the local build-host inference; document it
The published-db marker also exists on any workstation that once ran a full local release, so --host / OMARCHY_REPO_HOST / .repo-host are now checked before on_repo_host everywhere (triggers, advances, doctor). README documents the detection, the caveat, and the .repo-host tie-breaker.
This commit is contained in:
@@ -493,6 +493,16 @@ root@pkgs.example.com
|
|||||||
|
|
||||||
All connections are plain ssh; nothing else is used to reach the host.
|
All connections are plain ssh; nothing else is used to reach the host.
|
||||||
|
|
||||||
|
**How "this machine is the build host" is detected — and its one caveat.**
|
||||||
|
The marker is the published database living in this checkout
|
||||||
|
(`pkgs.omarchy.org/<channel>/<arch>/omarchy.db*`), the same convention the
|
||||||
|
rest of `bin/` uses. A workstation that once ran a full local
|
||||||
|
`bin/repo release` carries that marker too and would infer it is the host.
|
||||||
|
An explicitly configured destination always outranks the inference — `--host`,
|
||||||
|
`OMARCHY_REPO_HOST`, and `.repo-host` are checked first, and only when none is
|
||||||
|
set does local detection apply. So if a machine ever misidentifies itself,
|
||||||
|
writing the real host into `.repo-host` is the fix.
|
||||||
|
|
||||||
## Directory Structure
|
## Directory Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
+3
-1
@@ -323,7 +323,9 @@ regenerate_checksums() {
|
|||||||
|
|
||||||
trigger_build_host() {
|
trigger_build_host() {
|
||||||
local host
|
local host
|
||||||
if on_repo_host; then
|
# Explicit host configuration outranks the local-host inference (a
|
||||||
|
# workstation that ran a full local release carries the db marker too).
|
||||||
|
if ! resolve_repo_host "${REPO_HOST_OVERRIDE:-}" >/dev/null && on_repo_host; then
|
||||||
print_info "Triggering edge build locally (this is the build host)..."
|
print_info "Triggering edge build locally (this is the build host)..."
|
||||||
if mkdir -p "${OMARCHY_STATE_DIR:-/root/.state}" &&
|
if mkdir -p "${OMARCHY_STATE_DIR:-/root/.state}" &&
|
||||||
touch "${OMARCHY_STATE_DIR:-/root/.state}/.sync-needed-edge" &&
|
touch "${OMARCHY_STATE_DIR:-/root/.state}/.sync-needed-edge" &&
|
||||||
|
|||||||
+14
-11
@@ -241,14 +241,17 @@ touch /root/.state/.sync-needed-rc
|
|||||||
systemctl start --no-block omarchy-auto-release-rc.service
|
systemctl start --no-block omarchy-auto-release-rc.service
|
||||||
'
|
'
|
||||||
|
|
||||||
|
# An explicitly configured destination outranks the local-host inference: a
|
||||||
|
# workstation that once ran a full local release carries the published-db
|
||||||
|
# marker too, and its .repo-host must still win.
|
||||||
trigger_rc_build() {
|
trigger_rc_build() {
|
||||||
local host
|
local host
|
||||||
if on_repo_host; then
|
if host=$(repo_host); then
|
||||||
print_info "Triggering rc build locally (this is the build host)..."
|
|
||||||
bash -c "$RC_TRIGGER_SCRIPT"
|
|
||||||
elif host=$(repo_host); then
|
|
||||||
print_info "Triggering rc build on $host..."
|
print_info "Triggering rc build on $host..."
|
||||||
ssh "$host" "$RC_TRIGGER_SCRIPT"
|
ssh "$host" "$RC_TRIGGER_SCRIPT"
|
||||||
|
elif on_repo_host; then
|
||||||
|
print_info "Triggering rc build locally (this is the build host)..."
|
||||||
|
bash -c "$RC_TRIGGER_SCRIPT"
|
||||||
else
|
else
|
||||||
print_no_host_help "build the rc channel" "$RC_TRIGGER_SCRIPT"
|
print_no_host_help "build the rc channel" "$RC_TRIGGER_SCRIPT"
|
||||||
return 1
|
return 1
|
||||||
@@ -259,14 +262,14 @@ host_advance() { # host_advance <from> <to> [extra args...]
|
|||||||
local from="$1" to="$2"
|
local from="$1" to="$2"
|
||||||
shift 2
|
shift 2
|
||||||
local host
|
local host
|
||||||
if on_repo_host; then
|
if host=$(repo_host); then
|
||||||
|
print_info "Advancing $from -> $to on $host..."
|
||||||
|
ssh "$host" "cd /root/omarchy-pkgs && git pull --ff-only && bin/repo advance --from $from --to $to --skip-prod-check $*"
|
||||||
|
elif on_repo_host; then
|
||||||
# This checkout holds the published tree — advance right here, from this
|
# This checkout holds the published tree — advance right here, from this
|
||||||
# checkout's tooling (no pull: the operator controls their working copy).
|
# checkout's tooling (no pull: the operator controls their working copy).
|
||||||
print_info "Advancing $from -> $to locally (this is the build host)..."
|
print_info "Advancing $from -> $to locally (this is the build host)..."
|
||||||
"$BUILD_ROOT/bin/repo" advance --from "$from" --to "$to" --skip-prod-check "$@"
|
"$BUILD_ROOT/bin/repo" advance --from "$from" --to "$to" --skip-prod-check "$@"
|
||||||
elif host=$(repo_host); then
|
|
||||||
print_info "Advancing $from -> $to on $host..."
|
|
||||||
ssh "$host" "cd /root/omarchy-pkgs && git pull --ff-only && bin/repo advance --from $from --to $to --skip-prod-check $*"
|
|
||||||
else
|
else
|
||||||
print_no_host_help "advance $from -> $to" \
|
print_no_host_help "advance $from -> $to" \
|
||||||
" cd /root/omarchy-pkgs && bin/repo advance --from $from --to $to --skip-prod-check $*"
|
" cd /root/omarchy-pkgs && bin/repo advance --from $from --to $to --skip-prod-check $*"
|
||||||
@@ -960,10 +963,10 @@ cmd_doctor() {
|
|||||||
print_warning "rc channel db not readable — bootstrap it first: bin/repo bootstrap-rc (on the build host)"
|
print_warning "rc channel db not readable — bootstrap it first: bin/repo bootstrap-rc (on the build host)"
|
||||||
fi
|
fi
|
||||||
local host
|
local host
|
||||||
if on_repo_host; then
|
if host=$(repo_host); then
|
||||||
print_success "this machine IS the build host — host operations run locally"
|
|
||||||
elif host=$(repo_host); then
|
|
||||||
check "build host ssh ($host)" ssh -o ConnectTimeout=10 "$host" true
|
check "build host ssh ($host)" ssh -o ConnectTimeout=10 "$host" true
|
||||||
|
elif on_repo_host; then
|
||||||
|
print_success "this machine IS the build host — host operations run locally"
|
||||||
else
|
else
|
||||||
print_warning "no build host configured — set OMARCHY_REPO_HOST, --host, or write an ssh destination (root@<host> or an ssh-config alias) to $BUILD_ROOT/.repo-host; until then builds trigger on the 6h timer only"
|
print_warning "no build host configured — set OMARCHY_REPO_HOST, --host, or write an ssh destination (root@<host> or an ssh-config alias) to $BUILD_ROOT/.repo-host; until then builds trigger on the 6h timer only"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user