增加前端打包处理

This commit is contained in:
wangchuan
2026-01-14 19:18:03 +08:00
parent f305bd9500
commit bee295738f
4 changed files with 26 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ has_docker() {
# 判断是否存在当前应用的镜像
has_image() {
c=$(docker images|grep $IMAGE_NAME[[:blank:]]|wc -l)
c=$(docker images|grep $IMAGE_NAME|wc -l)
if [ $c = 0 ]
then
return 1
@@ -52,7 +52,7 @@ has_image() {
# 判断是否存在网络连接
checkOrCreate_network() {
c=$(docker network ls|grep "${NETWORK_NAME}[[:blank:]]"|wc -l)
c=$(docker network ls|grep "${NETWORK_NAME}"|wc -l)
if [ $c = 0 ]
then
docker network create $NETWORK_NAME >/dev/null
@@ -131,13 +131,13 @@ load_image() {
# 启动容器
run() {
stop_jar_run
latestImageId=$(docker images|grep $IMAGE_NAME[[:blank:]]|head -1|awk '{OFS=":"}{print $1,$2}')
latestImageId=$(docker images|grep $IMAGE_NAME|sort -r|head -1|awk '{OFS=":"}{print $1}')
echo "服务 $PROJECT_NAME 最新镜像ID为 $latestImageId"
has_stop_container
if [ $? = 0 ]
then
containerId=$(docker ps -a -f name=$PROJECT_NAME\$|awk '{print $1}')
nowImage=$(docker ps -a -f name=$PROJECT_NAME\$|awk '{print $2}')
containerId=$(docker ps -a -f name=$PROJECT_NAME\$|awk '{print $1}'|sed -n 2p)
nowImage=$(docker ps -a -f name=$PROJECT_NAME\$|awk '{print $2}'|sed -n 2p)
if [ $nowImage != $latestImageId ]
then
docker rm -f $containerId
@@ -249,7 +249,7 @@ version() {
# 获取当前服务所存在的镜像版本
images() {
has_docker
echo "当前使用镜像为:$(docker images|grep $IMAGE_NAME[[:blank:]]|awk '{OFS=":"}{print $1,$2}')"
echo "当前使用镜像为:$(docker images|grep $IMAGE_NAME|awk '{OFS=":"}{print $1}')"
}
case "$1" in