修改基础镜像
Some checks failed
/ build-parent-pom (push) Successful in 2m6s
/ build-and-push-services (ruoyi-auth) (push) Failing after 1m24s
/ build-and-push-services (ruoyi-gateway) (push) Failing after 1m26s
/ build-and-push-services (ruoyi-modules/Property) (push) Failing after 1m37s
/ build-and-push-services (ruoyi-modules/Sis) (push) Failing after 35s
/ build-and-push-services (ruoyi-modules/ruoyi-gen) (push) Failing after 1m1s
/ build-and-push-services (ruoyi-modules/ruoyi-job) (push) Failing after 1m31s
/ build-and-push-services (ruoyi-modules/ruoyi-resource) (push) Failing after 1m29s
/ build-and-push-services (ruoyi-modules/ruoyi-system) (push) Failing after 1m34s
/ build-and-push-services (ruoyi-modules/ruoyi-workflow) (push) Failing after 0s
/ build-and-push-services (ruoyi-seata-server) (push) Failing after 21s
/ build-and-push-services (ruoyi-sentinel-dashboard) (push) Failing after 20s
/ build-and-push-services (ruoyi-snailjob-server) (push) Failing after 22s
/ build-and-push-services (ruoyi-visual/ruoyi-monitor) (push) Failing after 1m29s
/ build-and-push-services (ruoyi-visual/ruoyi-nacos) (push) Failing after 1m14s
Some checks failed
/ build-parent-pom (push) Successful in 2m6s
/ build-and-push-services (ruoyi-auth) (push) Failing after 1m24s
/ build-and-push-services (ruoyi-gateway) (push) Failing after 1m26s
/ build-and-push-services (ruoyi-modules/Property) (push) Failing after 1m37s
/ build-and-push-services (ruoyi-modules/Sis) (push) Failing after 35s
/ build-and-push-services (ruoyi-modules/ruoyi-gen) (push) Failing after 1m1s
/ build-and-push-services (ruoyi-modules/ruoyi-job) (push) Failing after 1m31s
/ build-and-push-services (ruoyi-modules/ruoyi-resource) (push) Failing after 1m29s
/ build-and-push-services (ruoyi-modules/ruoyi-system) (push) Failing after 1m34s
/ build-and-push-services (ruoyi-modules/ruoyi-workflow) (push) Failing after 0s
/ build-and-push-services (ruoyi-seata-server) (push) Failing after 21s
/ build-and-push-services (ruoyi-sentinel-dashboard) (push) Failing after 20s
/ build-and-push-services (ruoyi-snailjob-server) (push) Failing after 22s
/ build-and-push-services (ruoyi-visual/ruoyi-monitor) (push) Failing after 1m29s
/ build-and-push-services (ruoyi-visual/ruoyi-nacos) (push) Failing after 1m14s
This commit is contained in:
parent
6410e15b88
commit
8b9e053517
@ -15,7 +15,7 @@ jobs:
|
||||
run: |
|
||||
export JAVA_HOME="/java17/java17"
|
||||
export MAVEN_HOME="/maven/apache-maven-3.9.11"
|
||||
|
||||
|
||||
if [ ! -f "$JAVA_HOME/bin/java" ]; then
|
||||
echo "错误:JDK可执行文件不存在于 $JAVA_HOME/bin/java"
|
||||
exit 1
|
||||
@ -24,12 +24,12 @@ jobs:
|
||||
echo "错误:Maven可执行文件不存在于 $MAVEN_HOME/bin/mvn"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
|
||||
echo "$JAVA_HOME/bin" >> $GITHUB_PATH
|
||||
echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV
|
||||
echo "$MAVEN_HOME/bin" >> $GITHUB_PATH
|
||||
|
||||
|
||||
"$JAVA_HOME/bin/java" -version
|
||||
"$MAVEN_HOME/bin/mvn" -v
|
||||
|
||||
@ -68,7 +68,7 @@ jobs:
|
||||
echo "错误:主POM文件不存在"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
retries=3
|
||||
count=0
|
||||
until "$MAVEN_HOME/bin/mvn" clean install -U -DskipTests -f "$MAIN_POM_ABSOLUTE_PATH"; do
|
||||
@ -105,14 +105,14 @@ jobs:
|
||||
# "ruoyi-common-alibaba-bom"
|
||||
# "ruoyi-api-bom"
|
||||
# )
|
||||
|
||||
|
||||
# for module in "${COMMON_MODULES[@]}"; do
|
||||
# MODULE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${module}/pom.xml"
|
||||
# if [ ! -f "$MODULE_POM_ABSOLUTE_PATH" ]; then
|
||||
# echo "警告:模块 $module 不存在,跳过"
|
||||
# continue
|
||||
# fi
|
||||
|
||||
|
||||
# retries=3
|
||||
# count=0
|
||||
# until "$MAVEN_HOME/bin/mvn" clean compile install -U -DskipTests -f "$MODULE_POM_ABSOLUTE_PATH"; do
|
||||
@ -166,7 +166,7 @@ jobs:
|
||||
echo "错误:服务 $SERVICE_NAME 的POM文件不存在"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
"$MAVEN_HOME/bin/mvn" clean package -U -DskipTests -f "$SERVICE_POM_ABSOLUTE_PATH"
|
||||
|
||||
- name: 配置Docker Buildx
|
||||
@ -184,22 +184,58 @@ jobs:
|
||||
run: |
|
||||
SERVICE_NAME="${{ matrix.service }}"
|
||||
DOCKERFILE_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/Dockerfile"
|
||||
|
||||
|
||||
if [ -f "$DOCKERFILE_ABSOLUTE_PATH" ]; then
|
||||
echo "dockerfile_path=$DOCKERFILE_ABSOLUTE_PATH" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "dockerfile_path=${GITHUB_WORKSPACE}/Dockerfile" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# - name: 构建并推送Docker镜像(仅推送镜像,不上传JAR)
|
||||
# uses: http://git.missmoc.top/mocheng/build-push-action@v5
|
||||
# with:
|
||||
# context: "${{ github.workspace }}"
|
||||
# file: ${{ github.workspace }}/${{ matrix.service }}/Dockerfile
|
||||
# tags: 172.100.10.45:3000/by2025/smartparks/${{ matrix.service }}:latest
|
||||
# # tags: ${{ secrets.REGISTRY_URL }}/by2025/$(echo ${{ matrix.service }} | tr 'A-Z' 'a-z'):${{ github.sha }}
|
||||
# # tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:2.0.4
|
||||
# push: true
|
||||
# cache-from: type=gha
|
||||
# cache-to: type=gha,mode=max
|
||||
#
|
||||
- name: 构建并推送Docker镜像(仅推送镜像,不上传JAR)
|
||||
uses: http://git.missmoc.top/mocheng/build-push-action@v5
|
||||
with:
|
||||
# 指定构建上下文为当前工作目录
|
||||
context: "${{ github.workspace }}"
|
||||
file: ${{ github.workspace }}/${{ matrix.service }}/Dockerfile
|
||||
tags: 172.100.10.45:3000/by2025/smartparks/${{ matrix.service }}:latest
|
||||
# tags: ${{ secrets.REGISTRY_URL }}/by2025/$(echo ${{ matrix.service }} | tr 'A-Z' 'a-z'):${{ github.sha }}
|
||||
# tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:2.0.4
|
||||
|
||||
# 指定Dockerfile路径,基于矩阵中的服务名称
|
||||
file: "${{ github.workspace }}/${{ matrix.service }}/Dockerfile"
|
||||
|
||||
# 镜像标签,推送到私有仓库
|
||||
tags: "172.100.10.45:3000/by2025/smartparks/${{ matrix.service }}:latest"
|
||||
|
||||
# 启用镜像推送
|
||||
push: true
|
||||
|
||||
# 使用GitHub Actions缓存加速构建
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
|
||||
# 新增:设置镜像拉取超时时间(秒)
|
||||
pull-timeout: 300
|
||||
|
||||
# 新增:构建参数,可在Dockerfile中使用ARG引用
|
||||
build-args: |
|
||||
# 示例:使用国内镜像源加速基础镜像拉取
|
||||
BASE_IMAGE_MIRROR=registry.cn-hangzhou.aliyuncs.com
|
||||
|
||||
# 新增:配置Docker守护进程的镜像加速源
|
||||
daemon-config: |
|
||||
{
|
||||
"registry-mirrors": [
|
||||
"https://registry.cn-hangzhou.aliyuncs.com",
|
||||
"https://hub-mirror.c.163.com",
|
||||
"https://mirror.baidubce.com"
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user