1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-05-06 13:04:12 +08:00

refactor: 优化脚本逻辑,升级@142vip/utils依赖 (#144)

This commit is contained in:
142vip.cn
2025-03-26 23:55:04 +08:00
committed by GitHub
parent 28aec1242d
commit 84fc0f9608
4 changed files with 355 additions and 13 deletions

View File

@@ -8,11 +8,11 @@
*/
import { createRequire } from 'node:module'
import process from 'node:process'
import {
OPEN_SOURCE_ADDRESS,
VipDocker,
VipGit,
VipNodeJS,
} from '@142vip/utils'
(async () => {
@@ -24,21 +24,21 @@ import {
const imageName = `${OPEN_SOURCE_ADDRESS.DOCKER_ALIYUNCS_VIP}/docs:${pkg.name}-${pkg.version}`
// 最近一次提交信息
const { hash: gitHash } = await VipGit.getRecentGitCommit()
const shortGitHash = VipGit.getRecentCommitShortHash()
// 构建镜像
await VipDocker.buildImage({
imageName,
buildArgs: [
// 参数中是否包含 --proxy
['NEED_PROXY', process.argv.includes('--proxy')],
['NEED_PROXY', VipNodeJS.getProcessArgv().includes('--proxy')],
['APP_NAME', pkg.name],
['APP_VERSION', pkg.version],
['APP_DESCRIPTION', pkg.description],
['AUTHOR', pkg.authorInfo.name],
['EMAIL', pkg.authorInfo.email],
['HOME_PAGE', pkg.authorInfo.homePage],
['GIT_HASH', gitHash],
['GIT_HASH', shortGitHash],
],
memory: 20000,
push: true,