feat: 支持前端独立打包与测试服Docker发布

This commit is contained in:
Yvan
2026-11-05 11:54:02 +08:00
parent c7d4ffbd9c
commit c4acb91c27
16 changed files with 702 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
import { options, sourceInfo, run, fail } from './release.mjs'
try {
const args = options({ tag: { type: 'string' }, 'source-ref': { type: 'string' } })
if (args.help) console.log('pnpm build:docker [--tag VERSION] [--source-ref FRONTEND_COMMIT]')
else {
const info = sourceInfo(args)
run('docker', ['build', '-f', 'deploy/Dockerfile', '--build-arg', `VERSION=${info.version}`, '--build-arg', `SOURCE_REVISION=${info.revision}`, '--build-arg', `SOURCE_TREE=${info.tree}`, '-t', `sw2/frontend:${info.version}`, '.'])
console.log(`镜像:sw2/frontend:${info.version}`)
}
} catch (error) { fail(error) }