@@ -3,9 +3,9 @@ import { VipDocker, VipGit, VipNodeJS, VipPackageJSON } from '@142vip/utils'
33/**
44 * 功能:构建Docker镜像
55 */
6- async function buildImageMain ( ) : Promise < void > {
6+ export async function buildImageMain ( ) {
77 // 获取package.json文件
8- const { name, version, description } = VipPackageJSON . getPackageJSON < { description : string } > ( )
8+ const { name, version, description } = VipPackageJSON . getPackageJSON ( )
99
1010 // 镜像地址
1111 const imageName = `${ OPEN_SOURCE_ADDRESS . DOCKER_ALIYUNCS_VIP } /docs:${ name } -${ version } `
@@ -16,7 +16,7 @@ async function buildImageMain(): Promise<void> {
1616 let realImageName = imageName
1717
1818 // 如果version是否为预发布,是预发布则用hash当镜像名
19- if ( VipGit . isPrerelease ( version ) ) {
19+ if ( typeof version === 'string' && VipGit . isPrerelease ( version ) ) {
2020 realImageName = `${ imageName . split ( ':' ) [ 0 ] } :${ name } -${ version } -${ gitShortHash } `
2121 }
2222
@@ -25,7 +25,7 @@ async function buildImageMain(): Promise<void> {
2525 imageName : realImageName ,
2626 buildArgs : [
2727 // 参数中是否包含 --proxy
28- [ 'NEED_PROXY ' , VipNodeJS . getProcessArgv ( ) . includes ( '--proxy' ) ] ,
28+ [ 'NEED_PROXY_BUILD ' , VipNodeJS . getProcessArgv ( ) . includes ( '--proxy' ) ] ,
2929 [ 'APP_NAME' , name ] ,
3030 [ 'APP_VERSION' , version ] ,
3131 [ 'APP_DESCRIPTION' , description ] ,
@@ -41,5 +41,3 @@ async function buildImageMain(): Promise<void> {
4141 progress : 'plain' ,
4242 } )
4343}
44-
45- void buildImageMain ( )
0 commit comments