From f5acdf2fff3afeacc925f3857ddc971d75702628 Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Wed, 20 May 2026 01:33:07 +0200 Subject: [PATCH] (refactor) Remove obsolete source-copy deploy script Delete the old scripts/deploy path that installed pobsync into /opt/pobsync/lib with a standalone /opt/pobsync/bin wrapper. Production deployment is now owned by the native systemd installer and updater, so keeping the legacy deploy script would make the supported install story less clear and easier to misuse. --- scripts/deploy | 97 -------------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100755 scripts/deploy diff --git a/scripts/deploy b/scripts/deploy deleted file mode 100755 index e65825e..0000000 --- a/scripts/deploy +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# Deploy pobsync runtime into /opt/pobsync without pip/venv. -# Copies python package sources into /opt/pobsync/lib and installs a stable entrypoint in /opt/pobsync/bin. - -set -eu - -PREFIX="/opt/pobsync" - -usage() { - echo "Usage: $0 [--prefix /opt/pobsync]" >&2 - exit 2 -} - -while [ $# -gt 0 ]; do - case "$1" in - --prefix) - [ $# -ge 2 ] || usage - PREFIX="$2" - shift 2 - ;; - -h|--help) - usage - ;; - *) - echo "Unknown arg: $1" >&2 - usage - ;; - esac -done - -# Determine repo root from this script location -SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" -REPO_ROOT="$(CDPATH= cd -- "${SCRIPT_DIR}/.." && pwd)" - -SRC_PKG="${REPO_ROOT}/src/pobsync" -if [ ! -d "${SRC_PKG}" ]; then - echo "ERROR: expected python package at ${SRC_PKG}" >&2 - exit 1 -fi - -BIN_DIR="${PREFIX}/bin" -LIB_DIR="${PREFIX}/lib" -DST_PKG="${LIB_DIR}/pobsync" -BUILD_FILE="${DST_PKG}/_build.txt" - -mkdir -p "${BIN_DIR}" "${LIB_DIR}" - -# Copy code into /opt/pobsync/lib/pobsync -# We use rsync if available (clean updates with --delete), otherwise fall back to cp -a. -if command -v rsync >/dev/null 2>&1; then - rsync -a --delete \ - --exclude '__pycache__/' \ - --exclude '*.pyc' \ - --exclude '*.pyo' \ - --exclude '*.pyd' \ - "${SRC_PKG}/" "${DST_PKG}/" -else - # Fallback: wipe + copy - rm -rf "${DST_PKG}" - mkdir -p "${DST_PKG}" - cp -a "${SRC_PKG}/." "${DST_PKG}/" -fi - -# Write build info (best-effort) -GIT_SHA="unknown" -if command -v git >/dev/null 2>&1 && [ -d "${REPO_ROOT}/.git" ]; then - GIT_SHA="$(cd "${REPO_ROOT}" && git rev-parse HEAD 2>/dev/null || echo unknown)" -fi - -NOW_UTC="$(date -u +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || echo unknown)" -{ - echo "deployed_at_utc=${NOW_UTC}" - echo "git_sha=${GIT_SHA}" - echo "repo_root=${REPO_ROOT}" -} > "${BUILD_FILE}" - -# Install stable entrypoint that always runs code from /opt/pobsync/lib -WRAPPER="${BIN_DIR}/pobsync" -cat > "${WRAPPER}" <