feat: 支持前端独立打包与测试服Docker发布
This commit is contained in:
@@ -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) }
|
||||
Reference in New Issue
Block a user