From a2d2d247932cbda3b192c003934bfad37fe1eefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EC=B0=BD=EC=9A=B1?= Date: Mon, 20 Jul 2026 12:58:44 +0900 Subject: [PATCH] build: name the two delivery folders and stop archiving by default Delivery had two ambiguously-named outputs and always produced an archive, which made it unclear what actually gets uploaded/copied. - dist/1_cafe24_upload/ -> FTP-upload contents to the Cafe24 web host - dist/2_pi_install/ -> copy folder to the Pi, run ./install_offline.sh Archives are now opt-in: MAKE_ZIP=1 (Cafe24) / MAKE_TARBALL=1 (Pi). Docs and tests updated to the new paths. Tests: 165 pass, 2 skipped. --- deploy/README.md | 12 +++++++----- deploy/bundle/build_offline_bundle.sh | 14 +++++++++++--- server/deploy/build_cafe24_package.sh | 12 ++++++++---- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 1bb71bc..826aec7 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -55,16 +55,18 @@ wheel tags may not resolve; if it fails, build natively): deploy/bundle/build_offline_bundle.sh --cross # target aarch64 / cp311 ``` -Output: `dist/move-detect-edge-bundle-aarch64-cp311.tar.gz` (+ `MANIFEST.txt` -listing the bundled wheels). This single file crosses the air gap. +Output: the folder `dist/2_pi_install/` (+ `MANIFEST.txt` listing the bundled +wheels). Copy the WHOLE FOLDER across the air gap as-is — no archive step. +Set `MAKE_TARBALL=1` if you would rather transfer one +`dist/2_pi_install-aarch64-cp311-hailo8.tar.gz` file. ## 2. Transfer + install (on the air-gapped Pi) -Copy the tarball across the gap (USB, one-way transfer, etc.), then: +Copy `dist/2_pi_install/` across the gap (USB, one-way transfer, etc.), then: ```bash -tar xzf move-detect-edge-bundle-aarch64-cp311.tar.gz -cd move-detect-edge-bundle +# tarball variant only (MAKE_TARBALL=1): tar xzf 2_pi_install-aarch64-cp311-hailo8.tar.gz +cd 2_pi_install sudo ./install_offline.sh ``` diff --git a/deploy/bundle/build_offline_bundle.sh b/deploy/bundle/build_offline_bundle.sh index 06c5230..3b52b64 100755 --- a/deploy/bundle/build_offline_bundle.sh +++ b/deploy/bundle/build_offline_bundle.sh @@ -20,7 +20,7 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" OUT_DIR="${OUT_DIR:-$REPO_ROOT/dist}" -STAGE="$OUT_DIR/move-detect-edge-bundle" +STAGE="$OUT_DIR/2_pi_install" WHEELHOUSE="$STAGE/wheelhouse" PYVER="${PYVER:-3.11}" # Pi OS Bookworm ships CPython 3.11 PYABI="cp${PYVER//./}" # cp311 @@ -187,9 +187,17 @@ else fi echo ">> [6/6] packaging tarball" +if [ "${MAKE_TARBALL:-0}" != "1" ]; then + # Default: leave $STAGE uncompressed — copy the folder to the Pi (USB/scp) and run + # install_offline.sh inside it. Set MAKE_TARBALL=1 for a single transferable file. + echo ">> skipped (MAKE_TARBALL=1 to also produce a .tar.gz)" + echo ">> DONE: $STAGE" + echo ">> copy this folder to the Pi, then run ./install_offline.sh inside it." + exit 0 +fi # Embed the Hailo arch in the filename: hailo8 and hailo8l bundles are byte-different but were # otherwise identically named, so the wrong one could be shipped to a board and crash-loop. -TARBALL="$OUT_DIR/move-detect-edge-bundle-${TARGET_ARCH}-${PYABI}-${HAILO_ARCH}.tar.gz" -tar -C "$OUT_DIR" -czf "$TARBALL" "move-detect-edge-bundle" +TARBALL="$OUT_DIR/2_pi_install-${TARGET_ARCH}-${PYABI}-${HAILO_ARCH}.tar.gz" +tar -C "$OUT_DIR" -czf "$TARBALL" "2_pi_install" echo ">> DONE: $TARBALL" echo ">> transfer this single file across the air gap, then run install_offline.sh on the Pi." diff --git a/server/deploy/build_cafe24_package.sh b/server/deploy/build_cafe24_package.sh index 3bffef5..1bfef83 100755 --- a/server/deploy/build_cafe24_package.sh +++ b/server/deploy/build_cafe24_package.sh @@ -11,9 +11,9 @@ # Run on the BUILD machine (needs composer + php — dev-only tools, never on the host): # server/deploy/build_cafe24_package.sh # -# Output: dist/cafe24/ and dist/move-detect-cafe24.zip +# Output: dist/1_cafe24_upload/ and dist/move-detect-cafe24.zip # -# dist/cafe24/ +# dist/1_cafe24_upload/ # ├── move_detect_app/ -> UPLOAD to the FTP root. Not web-reachable. # │ ├── config.php the ONLY file the operator edits # │ ├── src/ vendor/ storage/snapshots/ @@ -44,7 +44,7 @@ PRIVATE_DIR="${PRIVATE_DIR:-move_detect_app}" REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" SERVER="$REPO_ROOT/server" OUT_DIR="${OUT_DIR:-$REPO_ROOT/dist}" -STAGE="$OUT_DIR/cafe24" +STAGE="$OUT_DIR/1_cafe24_upload" ZIP="$OUT_DIR/move-detect-cafe24.zip" command -v composer >/dev/null 2>&1 || { echo "ERROR: composer not found on the build machine." >&2; exit 1; } @@ -223,7 +223,11 @@ echo " -> every staged .php parses" echo ">> [6/6] zipping" rm -f "$ZIP" -if command -v zip >/dev/null 2>&1; then +if [ "${MAKE_ZIP:-0}" != "1" ]; then + # Default: leave the folder uncompressed. The operator uploads $STAGE/ over FTP as-is, + # which is also the only path that cannot mangle directory separators (see below). + echo " -> skipped (MAKE_ZIP=1 to also produce $ZIP)" +elif command -v zip >/dev/null 2>&1; then ( cd "$STAGE" && zip -rq "$ZIP" . ) elif command -v python3 >/dev/null 2>&1; then # No `zip` (common on Windows/Git Bash). Use Python's zipfile with POSIX (forward-slash)