Files
qinglong/test/helpers/upgrade-fixture.cjs
T
whyour 0218404d9f fix: 修复页面升级、ql update 与静态资源版本同步 (#3086)
* fix: validate panel upgrades and synchronize versioned static builds

* fix: add static-only mirror backfill workflow

* fix: avoid lifecycle self-kill and stop cancelled upgrade groups

* fix: build images when the shared upgrade engine changes

* fix: dispatch upgrade lifecycle through a fixed script

* fix: reclaim upgrade locks safely and normalize health probes

* fix: match backend base URL normalization exactly
2026-10-07 17:43:03 +08:00

31 lines
1009 B
JavaScript

const fs = require('node:fs');
const path = require('node:path');
const { createHash } = require('node:crypto');
const { collectBuildFiles } = require('../../docker/build-manifest.cjs');
const sourceCommit = 'a'.repeat(40);
function writeManifest(source, staticRoot) {
const lockfile = path.join(source, 'pnpm-lock.yaml');
if (!fs.existsSync(lockfile)) fs.writeFileSync(lockfile, 'fixture lock\n');
fs.mkdirSync(path.join(staticRoot, 'dist'), { recursive: true });
if (!fs.existsSync(path.join(staticRoot, 'dist/index.html')))
fs.writeFileSync(
path.join(staticRoot, 'dist/index.html'),
'<div id="root"></div>',
);
fs.writeFileSync(
path.join(staticRoot, 'build-info.json'),
JSON.stringify({
version: 1,
dirty: false,
sourceCommit,
lockfileSha256: createHash('sha256')
.update(fs.readFileSync(lockfile))
.digest('hex'),
files: collectBuildFiles(staticRoot),
}),
);
}
module.exports = { writeManifest, sourceCommit };