mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-02-02 18:20:26 +08:00
Merge pull request #116 from 142vip/fix/scripts-bundle
fix: 修复`bundle`脚本构建异常
This commit is contained in:
@@ -7,25 +7,24 @@
|
||||
* - ./scripts/bundle --proxy
|
||||
*/
|
||||
|
||||
import {createRequire} from 'node:module'
|
||||
import { createRequire } from 'node:module'
|
||||
import process from 'node:process'
|
||||
import {
|
||||
VipDockerAddress,
|
||||
OPEN_SOURCE_ADDRESS,
|
||||
buildImage,
|
||||
getRecentGitCommit,
|
||||
} from '@142vip/utils'
|
||||
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
// 获取package.json文件
|
||||
const pkg = createRequire(import.meta.url)('../package.json')
|
||||
|
||||
// 镜像地址
|
||||
const imageName = `${VipDockerAddress}/docs:${pkg.name}-${pkg.version}`
|
||||
const imageName = `${OPEN_SOURCE_ADDRESS.DOCKER_ALIYUNCS_VIP}/docs:${pkg.name}-${pkg.version}`
|
||||
|
||||
// 最近一次提交信息
|
||||
const {hash: gitHash} = await getRecentGitCommit()
|
||||
const { hash: gitHash } = await getRecentGitCommit()
|
||||
|
||||
// 构建镜像
|
||||
await buildImage({
|
||||
@@ -41,12 +40,13 @@ import {
|
||||
['HOME_PAGE', pkg.authorInfo.homePage],
|
||||
['GIT_HASH', gitHash],
|
||||
],
|
||||
memory:20000,
|
||||
memory: 20000,
|
||||
push: true,
|
||||
delete: true,
|
||||
logger: true,
|
||||
})
|
||||
} catch (e) {
|
||||
}
|
||||
catch (e) {
|
||||
console.log('异常信息:', e)
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user