mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-11-03 05:44:05 +08:00
feat: 修改侧边栏结构,优化镜像构建脚本
- 新增docker快速打包脚本 - 主题内容优化
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
## 功能:本地前后端项目构建、打包镜像,上传docker仓库
|
||||
## 参考:https://blog.csdn.net/Dontla/article/details/125210694
|
||||
## 使用示例:bash xxx.sh 版本号 faster[可选]
|
||||
## - bash build_image.sh 0.0.1 faster
|
||||
## 作者:储凡
|
||||
## 使用示例:bash xxx.sh 版本号
|
||||
## - bash build_image.sh 0.0.1
|
||||
##
|
||||
|
||||
|
||||
## 日志颜色定义
|
||||
readonly successLogger="\033[36m"
|
||||
readonly errorLogger="\033[1;31m"
|
||||
@@ -16,12 +15,13 @@ readonly currentTime=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
## 项目名称
|
||||
readonly projectName="408CSFamily"
|
||||
## 仓库地址
|
||||
readonly repoAddress="registry.cn-hangzhou.aliyuncs.com/142vip/doc_book:"
|
||||
readonly repoAddress="registry.cn-hangzhou.aliyuncs.com/142vip/doc_book"
|
||||
## 版本号
|
||||
version=${1}
|
||||
|
||||
## 是否先本地构建,执行npm run build操作
|
||||
isFaster=${2}
|
||||
## 镜像名称
|
||||
imageTagName=${repoAddress}${projectName}-${version}
|
||||
imageTagName=${repoAddress}:${projectName}-${version}
|
||||
|
||||
|
||||
prepare_check(){
|
||||
@@ -33,7 +33,15 @@ prepare_check(){
|
||||
|
||||
run(){
|
||||
echo -e "${successLogger}---------------- shell ${projectName} start ---------------- "
|
||||
docker build -t "${imageTagName}" .
|
||||
|
||||
if [ "${isFaster}" == "faster" ];then
|
||||
## 本地构建、快速制作镜像
|
||||
npm run build && docker build -f Faster.Dockerfile --build-arg APP_VERSION="${version}" -t "${imageTagName}" .
|
||||
else
|
||||
## ci流程构建
|
||||
docker build -f Dockerfile --build-arg APP_VERSION="${version}" -t "${imageTagName}" .
|
||||
fi
|
||||
|
||||
echo -e "${successLogger}---------------- shell ${projectName} end ---------------- "
|
||||
push_docker_image
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user