fix(deploy): build checked-out source without GitLab API request

This commit is contained in:
Simo committed 2026-09-06 19:48:49 +02:00
1 parent 193b6686a9
commit 814d8650be
2 files changed
+9 -6

No files matched your search

+1 -6
View File
@@ -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
+8
View File
@@ -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);
});