mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-04-08 21:19:09 +08:00
chrome: 删除无用脚本和注释,优化ci自动化
This commit is contained in:
@@ -23,19 +23,21 @@ const imageName=`${repoAddress}:${projectName}-${packageVersion}`
|
||||
|
||||
/**
|
||||
* 获取构建镜像的脚本
|
||||
* - faster: "faster"
|
||||
* @param containerBuild
|
||||
* @param needProxy
|
||||
*/
|
||||
function getBuildImageScript(faster){
|
||||
// 是否容器构建
|
||||
const isContainerBuild=faster==="faster"
|
||||
|
||||
function getBuildImageScript({containerBuild,needProxy=false}){
|
||||
// 基础构建脚本
|
||||
const baseBuildScript=containerBuild?"":(
|
||||
needProxy?"./scripts/bundle build_proxy":"./scripts/bundle build"
|
||||
)
|
||||
return [
|
||||
// 构建镜像
|
||||
`
|
||||
${isContainerBuild? `./scripts/bundle build && `:""}
|
||||
${baseBuildScript}
|
||||
docker build \
|
||||
--build-arg APP_VERSION=${packageVersion} \
|
||||
--build-arg CONTAINER_BUILD=${!isContainerBuild} \
|
||||
--build-arg CONTAINER_BUILD=${containerBuild} \
|
||||
-t ${imageName} .
|
||||
`,
|
||||
// 推送镜像
|
||||
@@ -61,8 +63,19 @@ function getBuildImageScript(faster){
|
||||
const SupportScripts={
|
||||
build:'vuepress build docs',
|
||||
build_proxy:'PROXY_DOMAIN=true vuepress build docs',
|
||||
image:getBuildImageScript(),
|
||||
image_faster:getBuildImageScript("faster")
|
||||
image:getBuildImageScript({
|
||||
containerBuild:true,
|
||||
needProxy:false
|
||||
}),
|
||||
image_proxy:getBuildImageScript({
|
||||
containerBuild:true,
|
||||
needProxy:true
|
||||
}),
|
||||
// 直接从本地拿dist文件,生成镜像
|
||||
image_faster:getBuildImageScript({
|
||||
containerBuild:false,
|
||||
needProxy:false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +105,11 @@ async function getScriptCommand(){
|
||||
name: SupportScripts.image,
|
||||
value: '#0000ff'
|
||||
},
|
||||
{
|
||||
message: 'build to docker image with proxy',
|
||||
name: SupportScripts.image_proxy,
|
||||
value: '#0000ff'
|
||||
},
|
||||
{
|
||||
message: 'build to docker image faster',
|
||||
name: SupportScripts.image_faster,
|
||||
@@ -111,9 +129,6 @@ async function getScriptCommand(){
|
||||
|
||||
;(async ()=>{
|
||||
const scriptCommand= await getScriptCommand()
|
||||
console.log(`>>>> ${scriptCommand} `)
|
||||
|
||||
// 执行
|
||||
// await execShell(scriptCommand)
|
||||
await execShell(scriptCommand)
|
||||
})()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user