deploy.sh pulls and runs from ~/src/todo
Some checks are pending
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

Revert the AGENTS.md deploy line: kuhy has an uncommitted edit there,
so changing the file blocked the pull. deploy.sh itself now redirects a
worktree run to the main checkout, past phone_deploy's exit-49 guard.

Todo: 2556952d

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-19 20:50:20 +01:00
parent d5764fce7b
commit 5d83ff561e
3 changed files with 25 additions and 6 deletions

View File

@ -50,8 +50,7 @@ and sync peer-to-peer through a GitHub repo used as dumb storage.
- lint: `flutter analyze`
- coverage: `flutter test --coverage --reporter=compact`
- coverage-gaps: `coverage-gaps coverage/lcov.info`
- deploy: `git -C ~/src/todo pull --ff-only && ~/src/todo/scripts/deploy.sh` (MCP service, desktop pacman package, phone release;
exits non-zero unless every health check passes; runs from the main checkout because phone_deploy refuses a worktree, exit 49)
- deploy: `scripts/deploy.sh` (MCP service, desktop pacman package, phone release; exits non-zero unless every health check passes)
## Architecture

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.102+1
version: 1.0.103+1
environment:
sdk: ^3.12.2

View File

@ -22,15 +22,18 @@
# version means equal code); the MCP binary is cheap and always rebuilt.
#
# Nothing live runs from ~/src/todo (the MCP is a frozen binary, the desktop
# app lives in /opt/todo), so this deploys the checkout it sits in. The
# declared deploy (CLAUDE.md) fast-forwards ~/src/todo and runs from there:
# phone_deploy refuses a production install from a worktree (exit 49).
# app lives in /opt/todo), but phone_deploy refuses a production install
# from a worktree (exit 49). So a run from anywhere else (the board runs it
# in its worktree) fast-forwards ~/src/todo, checks it now holds this
# commit, and re-executes from there. A pull blocked by kuhy's own edits
# fails with git's message, which the board recognises and reports.
# ============================================================================
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
readonly ROOT
readonly CHECKOUT="${TODO_CHECKOUT:-${HOME}/src/todo}"
readonly SERIAL="${ADB_SERIAL:-23181JEGR08034}"
readonly APP_ID="dev.kuhy.todo"
readonly MCP_UNIT="todo-mcp.service"
@ -165,6 +168,22 @@ deploy_phone() {
phone_health "$want"
}
# Deploy from kuhy's main checkout, never from a worktree (see header).
run_from_checkout() {
local here want have
here="$(realpath -m -- "$ROOT")"
[[ $here == "$(realpath -m -- "$CHECKOUT")" ]] && return 0
want="$(git -C "$ROOT" rev-parse HEAD)"
echo "[deploy] running from $CHECKOUT, not $here"
git -C "$CHECKOUT" pull --ff-only
have="$(git -C "$CHECKOUT" rev-parse HEAD)"
if [[ $have != "$want" ]]; then
echo "[deploy] FAILED: $CHECKOUT is at $have after the pull, not $want" >&2
exit 1
fi
exec "$CHECKOUT/scripts/deploy.sh" "$@"
}
main() {
local targets=("$@") t
((${#targets[@]})) || targets=(mcp desktop phone)
@ -181,4 +200,5 @@ main() {
echo "[deploy] all healthy: ${targets[*]} at $(pubspec_version)"
}
run_from_checkout "$@"
main "$@"