Fix prod deploy extract permissions and wire frontend accounting BFF upstream.

Allow sudo chown/overwrite on remote tree and ensure ACCOUNTING_SERVICE_URL reaches the frontend container.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mortezakoohjani 2026-07-24 16:17:58 +03:30
parent 7d66932da8
commit 7e1d728322

View File

@ -169,17 +169,23 @@ def main() -> int:
run(app, f"mkdir -p {REMOTE_DIR}") run(app, f"mkdir -p {REMOTE_DIR}")
upload_file(app, tarball, "/tmp/torbatyar_accounting_bundle.tar.gz") upload_file(app, tarball, "/tmp/torbatyar_accounting_bundle.tar.gz")
# Preserve remote .env while extracting # Preserve remote .env while extracting
# Preserve remote .env while extracting (fix docker-owned file perms with sudo)
code, _ = run( code, _ = run(
app, app,
f""" f"""
set -e set -e
cd {REMOTE_DIR} cd {REMOTE_DIR}
if [ -f .env ]; then cp .env /tmp/torbatyar.env.bak; fi if [ -f .env ]; then cp .env /tmp/torbatyar.env.bak; fi
tar -xzf /tmp/torbatyar_accounting_bundle.tar.gz -C {REMOTE_DIR} chown -R {APP_USER}:{APP_USER} {REMOTE_DIR}/frontend {REMOTE_DIR}/backend {REMOTE_DIR}/docker-compose.yml 2>/dev/null || true
chmod -R u+rwX {REMOTE_DIR}/frontend {REMOTE_DIR}/backend 2>/dev/null || true
tar --overwrite -xzf /tmp/torbatyar_accounting_bundle.tar.gz -C {REMOTE_DIR}
if [ -f /tmp/torbatyar.env.bak ]; then cp /tmp/torbatyar.env.bak .env; fi if [ -f /tmp/torbatyar.env.bak ]; then cp /tmp/torbatyar.env.bak .env; fi
chown -R {APP_USER}:{APP_USER} {REMOTE_DIR}/frontend {REMOTE_DIR}/backend 2>/dev/null || true
rm -f /tmp/torbatyar_accounting_bundle.tar.gz rm -f /tmp/torbatyar_accounting_bundle.tar.gz
ls -la {REMOTE_DIR} | head ls -la {REMOTE_DIR} | head
""", """,
sudo=True,
password=APP_PASS,
timeout=300, timeout=300,
) )
if code != 0: if code != 0: