fix: trying to fix auto-pulls 26 !
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
# Auto-deploy generated files
|
||||
deploy.sh
|
||||
deploy.log
|
||||
.deploy-trigger
|
||||
|
||||
# Secrets
|
||||
.env
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
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
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
@@ -42,13 +42,12 @@ async def deploy(request: Request):
|
||||
|
||||
logger.info("Auto-deploy triggered via Gitea webhook")
|
||||
|
||||
# Trigger the host-side systemd service which runs as the bellsystems user.
|
||||
# This avoids running git/docker as root inside the container.
|
||||
await asyncio.create_subprocess_shell(
|
||||
"systemctl start bellsystems-deploy",
|
||||
stdout=asyncio.subprocess.DEVNULL,
|
||||
stderr=asyncio.subprocess.DEVNULL,
|
||||
)
|
||||
# Write a trigger file to the host-mounted project path.
|
||||
# A host-side watcher service (bellsystems-deploy-watcher) polls for this
|
||||
# file and runs deploy-host.sh as the bellsystems user when it appears.
|
||||
trigger_path = f"{settings.deploy_project_path}/.deploy-trigger"
|
||||
with open(trigger_path, "w") as f:
|
||||
f.write("deploy\n")
|
||||
|
||||
logger.info("Auto-deploy triggered via systemd")
|
||||
logger.info("Auto-deploy trigger file written")
|
||||
return {"ok": True, "message": "Deploy started"}
|
||||
|
||||
@@ -10,9 +10,8 @@ services:
|
||||
- ./data/built_melodies:/app/storage/built_melodies
|
||||
- ./data/firmware:/app/storage/firmware
|
||||
- ./data/firebase-service-account.json:/app/firebase-service-account.json:ro
|
||||
# Auto-deploy: systemd socket so container can trigger host services
|
||||
- /run/systemd/private:/run/systemd/private
|
||||
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
|
||||
# Auto-deploy: project root so container can write the trigger file
|
||||
- /home/bellsystems/bellsystems-cp:/home/bellsystems/bellsystems-cp
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on: []
|
||||
|
||||
Reference in New Issue
Block a user