refactor: remove bundled personal portfolio
This commit is contained in:
@@ -40,7 +40,7 @@ fi
|
||||
|
||||
docker exec "$container_name" node -e "fetch('http://127.0.0.1:3000/').then(async r=>{if(!r.ok||!(await r.text()).includes('Your Name'))process.exit(1)})"
|
||||
# Exercise the packaged maintenance command and native SQLite driver in the image.
|
||||
docker exec "$container_name" node maintenance.mjs import-legacy
|
||||
docker exec "$container_name" node maintenance.mjs init
|
||||
docker exec --env OWNER_EMAIL=smoke@example.com --env OWNER_PASSWORD=Isolated-container-smoke-password-2026 "$container_name" node maintenance.mjs create-owner
|
||||
|
||||
docker exec -i "$container_name" node <<'NODE'
|
||||
@@ -53,26 +53,16 @@ async function expectOk(path, options) {
|
||||
}
|
||||
|
||||
const english = await expectOk('/');
|
||||
await expectOk('/fa');
|
||||
await expectOk('/projects/interanet-solutions');
|
||||
await expectOk('/fa/projects/interanet-solutions');
|
||||
await expectOk('/projects/sample-projects');
|
||||
|
||||
const html = await english.text();
|
||||
const staticAsset = html.match(/(?:src|href)="(\/_next\/static\/[^"?#]+)/)?.[1];
|
||||
if (!staticAsset) throw new Error('No built static asset was found in the home page.');
|
||||
await expectOk(staticAsset);
|
||||
|
||||
const optimized = await expectOk(
|
||||
'/_next/image?url=%2Fimages%2Favatar.png&w=256&q=75',
|
||||
{ headers: { Accept: 'image/webp' } },
|
||||
);
|
||||
const contentType = optimized.headers.get('content-type') ?? '';
|
||||
if (!/^image\/(?:webp|png)$/.test(contentType)) {
|
||||
throw new Error(`Unexpected optimized image type: ${contentType}`);
|
||||
}
|
||||
if ((await optimized.arrayBuffer()).byteLength === 0) {
|
||||
throw new Error('Optimized image response was empty.');
|
||||
}
|
||||
|
||||
await expectOk('/images/portfolio-placeholder.svg');
|
||||
|
||||
NODE
|
||||
|
||||
# Upload through the real authenticated endpoint, then replace the container.
|
||||
@@ -103,7 +93,7 @@ for (let attempt = 0; attempt < 30; attempt++) {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
}
|
||||
if (!ready) throw new Error('Replacement container did not start');
|
||||
const page = await fetch(`${origin}/projects/interanet-solutions`);
|
||||
const page = await fetch(`${origin}/projects/sample-projects`);
|
||||
if (!page.ok) throw new Error('Database did not survive container replacement');
|
||||
const key = readFileSync('/data/smoke-media-key', 'utf8');
|
||||
const media = await fetch(`${origin}/media/${key}`);
|
||||
|
||||
Reference in New Issue
Block a user