feat(docker): prepare portable images with runtime hotel configuration
This commit is contained in:
1 parent
745d0b7247
commit
c4496e710b
28 files changed
+622
-104
No files matched your search
@@ -50,6 +50,9 @@ function simulate(scenario: string) {
|
||||
TEST_SHA: sha,
|
||||
SCENARIO: scenario,
|
||||
CMS_PUBLIC_URL: "https://example.test",
|
||||
CMS_IMAGE_REPOSITORY: scenario.startsWith("registry")
|
||||
? "registry.test/team/cms"
|
||||
: "",
|
||||
},
|
||||
});
|
||||
if (result.error) throw result.error;
|
||||
@@ -66,6 +69,22 @@ function simulate(scenario: string) {
|
||||
}
|
||||
}
|
||||
describe("Docker clone updates", () => {
|
||||
it("pulls matching prebuilt application and migrations without building", () => {
|
||||
const r = simulate("registry");
|
||||
expect(r.status, r.output).toBe(0);
|
||||
expect(r.calls).toContain(`docker pull registry.test/team/cms:${sha}`);
|
||||
expect(r.calls).toContain(
|
||||
`docker pull registry.test/team/cms:${sha}-migrations`,
|
||||
);
|
||||
expect(r.calls).not.toContain("docker build");
|
||||
expect(r.calls).not.toContain("docker compose build");
|
||||
expect(r.calls).toContain("target=/app/.env,readonly");
|
||||
});
|
||||
it("keeps the current container when the registry pull fails", () => {
|
||||
const r = simulate("registry-failure");
|
||||
expect(r.status).not.toBe(0);
|
||||
expect(r.calls).not.toContain("compose up");
|
||||
});
|
||||
it("removes only historical release tags beyond the current and previous", () => {
|
||||
const r = simulate("success");
|
||||
expect(r.calls).toContain(`docker image rm epicnext-cms:${"c".repeat(40)}`);
|
||||
|
||||
Reference in new issue
Block a user