修改基础镜像
Some checks failed
/ build-parent-pom (push) Successful in 2m6s
/ build-common-modules (push) Successful in 1m44s
/ build-and-push-services (ruoyi-auth) (push) Failing after 45s
/ build-and-push-services (ruoyi-gateway) (push) Failing after 40s
/ build-and-push-services (ruoyi-modules/Property) (push) Failing after 1m23s
/ build-and-push-services (ruoyi-modules/Sis) (push) Failing after 32s
/ build-and-push-services (ruoyi-modules/ruoyi-gen) (push) Failing after 42s
/ build-and-push-services (ruoyi-modules/ruoyi-job) (push) Failing after 42s
/ build-and-push-services (ruoyi-modules/ruoyi-resource) (push) Failing after 48s
/ build-and-push-services (ruoyi-modules/ruoyi-system) (push) Failing after 57s
/ build-and-push-services (ruoyi-modules/ruoyi-workflow) (push) Failing after 48s
/ build-and-push-services (ruoyi-seata-server) (push) Failing after 21s
/ build-and-push-services (ruoyi-sentinel-dashboard) (push) Failing after 21s
/ build-and-push-services (ruoyi-snailjob-server) (push) Failing after 23s
/ build-and-push-services (ruoyi-visual/ruoyi-monitor) (push) Failing after 40s
/ build-and-push-services (ruoyi-visual/ruoyi-nacos) (push) Failing after 37s

This commit is contained in:
mocheng 2025-08-14 17:09:22 +08:00
parent 11087e3f33
commit 6a7a0a344f

View File

@ -1,225 +1,3 @@
#run-name: ${{ gitea.actor }} 构建镜像并推送不含JAR依赖上传🚀
#on:
# push:
# branches:
# - master
#
#jobs:
# build-parent-pom:
# runs-on: ubuntu
# steps:
# - name: 拉取代码仓库
# uses: http://git.missmoc.top/mocheng/checkout@v4
#
# - name: 配置环境变量(绝对路径)
# 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
# fi
# if [ ! -f "$MAVEN_HOME/bin/mvn" ]; then
# 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
#
# - name: 配置Maven仓库
# run: |
# mkdir -p ~/.m2
# cat > ~/.m2/settings.xml << EOF
# <?xml version="1.0" encoding="UTF-8"?>
# <settings>
# <localRepository>/root/.m2/repository</localRepository>
# <profiles>
# <profile>
# <id>multi-repo</id>
# <repositories>
# <repository>
# <id>local-repo</id>
# <url>file:///root/.m2/repository</url>
# </repository>
# <repository>
# <id>aliyun-public</id>
# <url>https://maven.aliyun.com/repository/public</url>
# </repository>
# </repositories>
# </profile>
# </profiles>
# <activeProfiles>
# <activeProfile>multi-repo</activeProfile>
# </activeProfiles>
# </settings>
# EOF
#
# - name: 构建主POM仅本地安装不上传
# run: |
# MAIN_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/pom.xml"
# if [ ! -f "$MAIN_POM_ABSOLUTE_PATH" ]; then
# echo "错误主POM文件不存在"
# exit 1
# fi
#
# retries=3
# count=0
# until "$MAVEN_HOME/bin/mvn" clean install -U -DskipTests -f "$MAIN_POM_ABSOLUTE_PATH"; do
# count=$((count + 1))
# if [ $count -ge $retries ]; then
# echo "错误主POM构建失败"
# exit 1
# fi
# sleep 10
# done
#
# # build-common-modules:
# # needs: build-parent-pom
# # runs-on: ubuntu
# # steps:
# # - name: 拉取代码仓库
# # uses: http://git.missmoc.top/mocheng/checkout@v4
#
# # - name: 配置环境变量
# # run: |
# # export JAVA_HOME="/java17/java17"
# # export MAVEN_HOME="/maven/apache-maven-3.9.11"
# # 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
#
# # - name: 构建通用模块(仅本地使用,不上传)
# # run: |
# # COMMON_MODULES=(
# # "ruoyi-common"
# # "ruoyi-api"
# # "ruoyi-common-bom"
# # "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
# # count=$((count + 1))
# # if [ $count -ge $retries ]; then
# # echo "错误:模块 $module 构建失败"
# # exit 1
# # fi
# # sleep 10
# # done
# # done
#
# build-and-push-services:
# needs: build-common-modules
# runs-on: ubuntu
# strategy:
# matrix:
# service:
# - ruoyi-auth
# - ruoyi-gateway
# - ruoyi-modules/Property
# - ruoyi-modules/ruoyi-gen
# - ruoyi-modules/ruoyi-job
# - ruoyi-modules/ruoyi-resource
# - ruoyi-modules/ruoyi-system
# - ruoyi-modules/ruoyi-workflow
# - ruoyi-modules/Sis
# - ruoyi-visual/ruoyi-monitor
# - ruoyi-visual/ruoyi-nacos
# - ruoyi-seata-server
# - ruoyi-sentinel-dashboard
# - ruoyi-snailjob-server
# steps:
# - name: 拉取代码仓库
# uses: http://git.missmoc.top/mocheng/checkout@v4
#
# - name: 配置环境变量
# run: |
# export JAVA_HOME="/java17/java17"
# export MAVEN_HOME="/maven/apache-maven-3.9.11"
# 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
#
# - name: 构建服务模块
# run: |
# SERVICE_NAME="${{ matrix.service }}"
# SERVICE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/pom.xml"
# if [ ! -f "$SERVICE_POM_ABSOLUTE_PATH" ]; then
# echo "错误:服务 $SERVICE_NAME 的POM文件不存在"
# exit 1
# fi
#
# "$MAVEN_HOME/bin/mvn" clean package -U -DskipTests -f "$SERVICE_POM_ABSOLUTE_PATH"
#
# - name: 配置Docker Buildx
# uses: http://git.missmoc.top/mocheng/setup-buildx-action@v3
#
# - name: 登录到容器仓库
# uses: http://git.missmoc.top/mocheng/login-action@v3
# with:
# registry: ${{ secrets.REGISTRY_URL }}
# username: ${{ secrets.REGISTRY_USER }}
# password: ${{ secrets.REGISTRY_PASS }}
#
# - name: 确定Dockerfile路径
# id: dockerfile-path
# 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"
# push: true
# cache-from: type=gha
# cache-to: type=gha,mode=max
#
# # 关键配置允许该仓库使用HTTP
# daemon-config: |
# {
# "insecure-registries": ["172.100.10.45:3000"]
# }
#
# # 确保buildx使用正确的网络配置
# driver-opts: |
# network=host
## 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
run-name: ${{ gitea.actor }} 构建镜像并推送不含JAR依赖上传🚀
on:
push: