From 814d8650be5cb53c9b162d23f012523288640747 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sun, 6 Sep 2026 19:48:49 +0200 Subject: [PATCH] fix(deploy): build checked-out source without GitLab API request --- Dockerfile | 7 +------ src/lib/deploy-workflow-contract.test.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a413e63ad0..062e088b51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,12 +47,7 @@ RUN --mount=type=cache,id=epicnext-pnpm,target=/pnpm/store,sharing=locked \ # Source changes invalidate compilation, but keep the installed dependencies. COPY . . -# --- Automatische GitLab Pull --- -# Vraagt de meest recente commit op van gitlab.epicnabbo.nl (project: remco/EpicNext-Cms). -# Bij een nieuwe commit breekt Docker hier automatisch de cache en haalt hij direct de nieuwste code binnen. -# (remco%2FEpicNext-Cms is de URL-encoded variant van remco/EpicNext-Cms) -ADD https://gitlab.epicnabbo.nl/api/v4/projects/remco%2FEpicNext-Cms/repository/branches/main /tmp/commit.json -RUN git pull origin main +# Build only the checked out source; CI owns revision selection and freshness checks. # Build the production bundle. # The .env file is loaded ONLY inside this RUN layer (not persisted as ENV, so no diff --git a/src/lib/deploy-workflow-contract.test.ts b/src/lib/deploy-workflow-contract.test.ts index b649a09084..343a733fc1 100644 --- a/src/lib/deploy-workflow-contract.test.ts +++ b/src/lib/deploy-workflow-contract.test.ts @@ -31,3 +31,11 @@ it("preserves production runtime configuration and recent cache", () => { ); expect(deploy).not.toContain("docker volume prune"); }); +it("builds the checked out source without fetching a moving remote branch", () => { + const dockerfile = readFileSync("Dockerfile", "utf8"); + expect(dockerfile).toContain("COPY . ."); + expect(dockerfile).not.toMatch( + /^ADD\s+https?:\/\/.*(?:repository|branches)/m, + ); + expect(dockerfile).not.toMatch(/^RUN\s+git\s+(?:pull|fetch|clone)\b/m); +});