feat(cms): improve catalog, editorial recovery and operations
This commit is contained in:
1 parent
2fead134e6
commit
c389c3893d
122 files changed
+8137
-703
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { createServer } from "node:http";
|
||||
import { setTimeout as delay } from "node:timers/promises";
|
||||
import { verifyRuntimeMetadata } from "./verify-runtime-metadata.mjs";
|
||||
|
||||
const [image, release] = process.argv.slice(2);
|
||||
if (!image || !/^[0-9a-f]{40}$/.test(release ?? ""))
|
||||
@@ -95,30 +96,7 @@ try {
|
||||
await delay(1000);
|
||||
}
|
||||
if (!ready) throw new Error(`${hotel}: expected HTTP release not served`);
|
||||
const page = await fetch(`${base}/login`, {
|
||||
signal: AbortSignal.timeout(30000),
|
||||
});
|
||||
const html = await page.text();
|
||||
if (
|
||||
!page.ok ||
|
||||
!html.includes(`Fixture ${hotel}`) ||
|
||||
!html.includes(base)
|
||||
)
|
||||
throw new Error(
|
||||
`${hotel}: hotel name/domain were not resolved at runtime`,
|
||||
);
|
||||
const manifest = await fetch(`${base}/manifest.webmanifest`, {
|
||||
signal: AbortSignal.timeout(15000),
|
||||
});
|
||||
if ((await manifest.json()).name !== `Fixture ${hotel}`)
|
||||
throw new Error(`${hotel}: manifest contains build-time settings`);
|
||||
for (const path of ["/robots.txt", "/sitemap.xml"]) {
|
||||
const response = await fetch(base + path, {
|
||||
signal: AbortSignal.timeout(15000),
|
||||
});
|
||||
if (!response.ok || !(await response.text()).includes(base))
|
||||
throw new Error(`${hotel}: ${path} contains build-time domain`);
|
||||
}
|
||||
await verifyRuntimeMetadata(base, hotel);
|
||||
const avatar = await fetch(
|
||||
`${base}/api/imaging/avatar?figure=hd-180-1&img_format=png`,
|
||||
{ signal: AbortSignal.timeout(15000) },
|
||||
|
||||
Reference in new issue
Block a user