fix: trying to fix auto-pulls 26 !

This commit is contained in:
2026-02-27 06:10:43 +02:00
parent 97410230e1
commit fad6912627
4 changed files with 10 additions and 15 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
# Auto-deploy generated files # Auto-deploy generated files
deploy.sh deploy.sh
deploy.log deploy.log
.deploy-trigger
# Secrets # Secrets
.env .env

View File

@@ -1,9 +1,5 @@
FROM python:3.11-slim FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
systemctl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
COPY requirements.txt . COPY requirements.txt .

View File

@@ -42,13 +42,12 @@ async def deploy(request: Request):
logger.info("Auto-deploy triggered via Gitea webhook") logger.info("Auto-deploy triggered via Gitea webhook")
# Trigger the host-side systemd service which runs as the bellsystems user. # Write a trigger file to the host-mounted project path.
# This avoids running git/docker as root inside the container. # A host-side watcher service (bellsystems-deploy-watcher) polls for this
await asyncio.create_subprocess_shell( # file and runs deploy-host.sh as the bellsystems user when it appears.
"systemctl start bellsystems-deploy", trigger_path = f"{settings.deploy_project_path}/.deploy-trigger"
stdout=asyncio.subprocess.DEVNULL, with open(trigger_path, "w") as f:
stderr=asyncio.subprocess.DEVNULL, f.write("deploy\n")
)
logger.info("Auto-deploy triggered via systemd") logger.info("Auto-deploy trigger file written")
return {"ok": True, "message": "Deploy started"} return {"ok": True, "message": "Deploy started"}

View File

@@ -10,9 +10,8 @@ services:
- ./data/built_melodies:/app/storage/built_melodies - ./data/built_melodies:/app/storage/built_melodies
- ./data/firmware:/app/storage/firmware - ./data/firmware:/app/storage/firmware
- ./data/firebase-service-account.json:/app/firebase-service-account.json:ro - ./data/firebase-service-account.json:/app/firebase-service-account.json:ro
# Auto-deploy: systemd socket so container can trigger host services # Auto-deploy: project root so container can write the trigger file
- /run/systemd/private:/run/systemd/private - /home/bellsystems/bellsystems-cp:/home/bellsystems/bellsystems-cp
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
ports: ports:
- "8000:8000" - "8000:8000"
depends_on: [] depends_on: []