Files
videoreg.ru/deploy/scripts/write-release-manifest.mjs
T
huncode 2ce58fcbc0
Master Production Deploy / production (push) Failing after 49s
feat: complete dashcam catalog ingestion demo
2026-07-31 02:01:58 +03:00

37 lines
956 B
JavaScript

import { readFileSync } from 'node:fs';
function requireEnv(name) {
const value = process.env[name];
if (!value) {
throw new Error(`${name} is required`);
}
return value;
}
function readJson(path) {
return JSON.parse(readFileSync(path, 'utf8'));
}
const smoke = readJson(requireEnv('SMOKE_RESULT_PATH'));
const manifest = {
commitSha: requireEnv('COMMIT_SHA'),
releaseId: requireEnv('RELEASE_ID'),
webImageDigest: requireEnv('WEB_IMAGE_DIGEST'),
ingestionImageDigest: requireEnv('INGESTION_IMAGE_DIGEST'),
deployTimestamp: new Date().toISOString(),
smokeResult: smoke,
workflowRunId: requireEnv('WORKFLOW_RUN_ID'),
};
for (const [name, image] of Object.entries({
webImageDigest: manifest.webImageDigest,
ingestionImageDigest: manifest.ingestionImageDigest,
})) {
if (!/@sha256:[a-f0-9]{64}$/i.test(image)) {
throw new Error(`${name} must be digest-pinned`);
}
}
console.log(JSON.stringify(manifest, null, 2));