init
continuous-integration/drone Build encountered an error

This commit is contained in:
曾志威
2026-02-25 18:11:30 +08:00
parent cc3034ecf9
commit 08d1cccba4
+27 -14
View File
@@ -2,6 +2,19 @@ kind: pipeline
name: default
steps:
# 恢复 Gradle 缓存(无需挂载主机卷)
- name: restore-gradle-cache
image: plugins/cache:latest
settings:
mount:
- /root/.gradle/caches
- /root/.gradle/wrapper
key: gradle-{{ checksum "build.gradle" }}
fallback_key: gradle-
backend: local
path: /root/drone/cache
failure: ignore
# 步骤2:拉取其他 Git 项目(common-utils
- name: clone-other-project
image: alpine/git:latest # 轻量 Git 镜像
@@ -16,10 +29,6 @@ steps:
# docker 打包
- name: deploy
image: registry.cn-hangzhou.aliyuncs.com/loghub/wms-system-service:gradle8
volumes:
# 挂载服务器本地缓存目录到容器的 Gradle 缓存目录
- name: gradle-cache
path: /root/.gradle/caches # 容器内的 Gradle 缓存路径
commands:
- cd wms-loghub-3-x
- >
@@ -31,13 +40,17 @@ steps:
-Djib.to.image=registry.cn-hangzhou.aliyuncs.com/loghub/wms-system-service
-Djib.to.tags=walle-wms
# 定义 volume,指向 CI 服务器的本地目录
volumes:
- name: gradle-cache
host:
path: /root/gradle/caches # 服务器上创建的缓存目录
# 创建缓存目录(建议和 Drone 运行用户同权限)
# mkdir -p /root/gradle/caches
# chmod 777 /root/gradle/caches # 简化权限,生产环境可按需调整
# 保存缓存
- name: save-gradle-cache
image: plugins/cache:latest
settings:
mount:
- /root/.gradle/caches
- /root/.gradle/wrapper
key: gradle-{{ checksum "build.gradle" }}
fallback_key: gradle-
backend: local
path: /root/drone/cache
when:
status: [success]
failure: ignore