Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
This commit is contained in:
@@ -2,7 +2,7 @@ run-name: ${{ gitea.actor }} 构建镜像并推送(不含JAR依赖上传)
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-parent-pom:
|
||||
@@ -195,26 +195,11 @@ jobs:
|
||||
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"
|
||||
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
|
||||
|
||||
# 关键配置:允许该仓库使用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
|
||||
|
89
.gitea/workflows/master.yml
Normal file
89
.gitea/workflows/master.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
name: Build and Push to Target Registry
|
||||
|
||||
# 监听master分支的推送事件
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
name: 构建并推送镜像到目标仓库
|
||||
runs-on: ubuntu
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: 拉取代码
|
||||
uses: http://git.missmoc.top/mocheng/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 使用Maven构建项目
|
||||
run: |
|
||||
echo "===== 开始Maven构建 ====="
|
||||
/maven/apache-maven-3.9.11/bin/mvn clean package -DskipTests
|
||||
|
||||
echo "===== Maven构建完成 ====="
|
||||
|
||||
- name: 构建并推送Docker镜像
|
||||
env:
|
||||
# 替换为你的Docker Registry地址(例如:localhost:5000 或 192.168.1.100:5000)
|
||||
TARGET_REGISTRY: 127.0.0.1:5000
|
||||
# 目标仓库中的项目名称
|
||||
TARGET_PROJECT: smartparks
|
||||
run: |
|
||||
echo "===== 环境信息 ====="
|
||||
echo "目标仓库: $TARGET_REGISTRY/$TARGET_PROJECT"
|
||||
|
||||
# 【删除登录步骤】因为仓库无认证,无需登录
|
||||
|
||||
echo "===== 查找项目中的Dockerfile ====="
|
||||
dockerfiles=$(find . -type f -name "Dockerfile" ! -path "./.git/*")
|
||||
if [ -z "$dockerfiles" ]; then
|
||||
echo "警告:未找到任何Dockerfile"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 处理每个Dockerfile(后续构建、推送逻辑与之前类似,保持不变)
|
||||
echo "$dockerfiles" | while read -r dockerfile; do
|
||||
echo "===== 处理Dockerfile: $dockerfile ====="
|
||||
|
||||
docker_context=$(dirname "$dockerfile")
|
||||
image_tag=$(echo "$docker_context" | sed 's|./||g' | tr '/' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9_-]//g')
|
||||
full_image_name="$TARGET_REGISTRY/$TARGET_PROJECT:$image_tag-${{ github.sha }}"
|
||||
echo "镜像名称: $full_image_name"
|
||||
|
||||
# 检查JAR包是否存在
|
||||
echo "===== 检查JAR包 ====="
|
||||
jar_files=$(find "$docker_context" -name "*.jar" -type f)
|
||||
if [ -z "$jar_files" ]; then
|
||||
echo "警告:在 $docker_context 目录中未找到JAR包"
|
||||
continue
|
||||
fi
|
||||
echo "找到JAR包:"
|
||||
echo "$jar_files"
|
||||
|
||||
echo "===== 构建镜像 ====="
|
||||
if ! docker build -t "$full_image_name" -f "$dockerfile" "$docker_context"; then
|
||||
echo "错误:构建镜像失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "===== 推送镜像到仓库 ====="
|
||||
if ! docker push "$full_image_name"; then
|
||||
echo "错误:推送镜像失败,请检查仓库是否可访问"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 推送latest标签(逻辑保持不变)
|
||||
latest_image="$TARGET_REGISTRY/$TARGET_PROJECT:$image_tag-latest"
|
||||
echo "===== 推送最新标签: $latest_image ====="
|
||||
docker tag "$full_image_name" "$latest_image"
|
||||
if ! docker push "$latest_image"; then
|
||||
echo "错误:推送latest标签失败"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "===== 清理操作 ====="
|
||||
docker system prune -f
|
||||
echo "===== 所有操作完成 ===="
|
@@ -2,7 +2,8 @@
|
||||
#FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
|
||||
#FROM registry.cn-hangzhou.aliyuncs.com/aliyun_openjdk/openjdk:17-jdk-slim
|
||||
#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds
|
||||
FROM 172.100.10.45:3000/by2025/base-images/liberica-openjdk-debian:17.0.11-cds
|
||||
#FROM 127.0.0.1:5000/smartparks/base-images/liberica-openjdk-debian
|
||||
FROM 127.0.0.1:5000/smartparks/base-images/liberica-openjdk-debian:17.0.11-cds
|
||||
#FROM findepi/graalvm:java17-native
|
||||
|
||||
LABEL maintainer="Lion Li"
|
||||
|
@@ -6,14 +6,15 @@ import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.vo.ServiceWorkOrdersVo;
|
||||
import org.dromara.property.service.IServiceWorkOrdersService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 【业务管理-工单处理】
|
||||
@@ -38,4 +39,11 @@ public class MServiceWorkOrdersController extends BaseController {
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody MServiceWorkOrdersBo bo) {
|
||||
return toAjax(serviceWorkOrdersService.insertMServiceWorkOrdersBo(bo));
|
||||
}
|
||||
/**
|
||||
* 小程序查询【工单处理】
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ServiceWorkOrdersVo> list(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
|
||||
return serviceWorkOrdersService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user