Verify deployed release commit

This commit is contained in:
2026-07-05 20:21:15 +09:00
parent 6afc94d5fb
commit 620c9c3eca
2 changed files with 15 additions and 6 deletions

View File

@@ -3,15 +3,17 @@ import { mkdirSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
const qaVersion = process.env.PUBLIC_QA_VERSION ?? makeQaVersion();
const releaseCommit = gitValue(['rev-parse', 'HEAD'], 'unknown');
const releaseShortCommit = gitValue(['rev-parse', '--short', 'HEAD'], 'unknown');
assertNoTrackedChanges();
runPnpmScript('verify:local-release');
runPnpmScript('qa:early');
writeReleaseManifest(qaVersion);
writeReleaseManifest(qaVersion, releaseCommit, releaseShortCommit);
runPnpmScript('deploy:nas:dist');
runPnpmScript('verify:public-deploy', { PUBLIC_QA_VERSION: qaVersion });
runPnpmScript('verify:public-deploy', { PUBLIC_QA_VERSION: qaVersion, PUBLIC_QA_COMMIT: releaseCommit });
console.log(`Shipped and verified public deploy with PUBLIC_QA_VERSION=${qaVersion}`);
console.log(`Shipped and verified public deploy with PUBLIC_QA_VERSION=${qaVersion} at ${releaseShortCommit}`);
function makeQaVersion() {
const stamp = new Date().toISOString().replace(/[-:.TZ]/g, '').slice(0, 14);
@@ -33,12 +35,12 @@ function assertNoTrackedChanges() {
}
}
function writeReleaseManifest(qaVersion) {
function writeReleaseManifest(qaVersion, commit, shortCommit) {
const manifest = {
app: 'heros_web',
qaVersion,
commit: gitValue(['rev-parse', 'HEAD'], 'unknown'),
shortCommit: gitValue(['rev-parse', '--short', 'HEAD'], 'unknown'),
commit,
shortCommit,
branch: gitValue(['branch', '--show-current'], 'unknown'),
generatedAt: new Date().toISOString(),
verification: ['verify:local-release', 'qa:early', 'verify:public-deploy']

View File

@@ -5,6 +5,7 @@ import { chromium } from 'playwright';
const targetUrl = withQaParams(process.env.PUBLIC_QA_URL ?? 'https://comtropy.synology.me/heros_web/');
const screenshotPath = process.env.PUBLIC_QA_SCREENSHOT ?? 'dist/public-deploy-qa.png';
const expectedQaVersion = process.env.PUBLIC_QA_VERSION;
const expectedCommit = process.env.PUBLIC_QA_COMMIT;
const expectedTitle = '\uC0BC\uAD6D\uC9C0: \uC138 \uD615\uC81C\uC758 \uB9F9\uC138';
const relevantLogPattern = /asset|audio|cannot|failed|map|missing|portrait|sprite|story|texture|unit/i;
@@ -110,6 +111,12 @@ try {
`Expected deployed release manifest qaVersion ${expectedQaVersion}: ${JSON.stringify(releaseManifest)}`
);
}
if (expectedCommit) {
assert(
releaseManifest.commit === expectedCommit,
`Expected deployed release manifest commit ${expectedCommit}: ${JSON.stringify(releaseManifest)}`
);
}
const relevantLogs = consoleMessages.filter(
(message) => message.type === 'error' || (isWarning(message.type) && relevantLogPattern.test(message.text))