mirror of
https://github.com/whyour/qinglong.git
synced 2026-10-17 07:20:51 +08:00
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
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user