fix: trying to fix auto-pulls 9 !
This commit is contained in:
@@ -5,6 +5,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
curl \
|
curl \
|
||||||
&& curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz \
|
&& curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz \
|
||||||
| tar -xz --strip-components=1 -C /usr/local/bin docker/docker \
|
| tar -xz --strip-components=1 -C /usr/local/bin docker/docker \
|
||||||
|
&& curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
||||||
|
-o /usr/local/bin/docker-compose \
|
||||||
|
&& chmod +x /usr/local/bin/docker-compose \
|
||||||
|
&& mkdir -p /usr/local/lib/docker/cli-plugins \
|
||||||
|
&& ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins/docker-compose \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -43,7 +43,13 @@ async def deploy(request: Request):
|
|||||||
logger.info("Auto-deploy triggered via Gitea webhook")
|
logger.info("Auto-deploy triggered via Gitea webhook")
|
||||||
|
|
||||||
project_path = settings.deploy_project_path
|
project_path = settings.deploy_project_path
|
||||||
cmd = f"git config --global --add safe.directory {project_path} && cd {project_path} && git pull origin main && docker compose up -d --build"
|
cmd = (
|
||||||
|
f"git config --global --add safe.directory {project_path} && "
|
||||||
|
f"cd {project_path} && "
|
||||||
|
f"git fetch origin main && "
|
||||||
|
f"git reset --hard origin/main && "
|
||||||
|
f"docker-compose up -d --build"
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
proc = await asyncio.create_subprocess_shell(
|
proc = await asyncio.create_subprocess_shell(
|
||||||
cmd,
|
cmd,
|
||||||
|
|||||||
Reference in New Issue
Block a user