diff --git a/.drone.yml b/.drone.yml index 727d257..7f4340b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,17 @@ kind: pipeline # 定义一个管道 type: docker # 当前管道的类型 name: test # 当前管道的名称 steps: # 定义管道的执行步骤 + #加载缓存 + - name: cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + restore: true + mount: + - ./vendo + - name: build-jar # 步骤名称 image: maven:3.8.5-openjdk-8 # 当前步骤使用的镜像 volumes: @@ -15,6 +26,7 @@ steps: # 定义管道的执行步骤 - cp entrypoint.sh /app/build/ - cp Dockerfile /app/build/ - cp run.sh /app/build/ + - name: build-docker image: plugins/docker volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置 @@ -28,4 +40,26 @@ steps: # 定义管道的执行步骤 - cd /app/build - chmod +x run.sh - sh run.sh - - docker ps \ No newline at end of file + - docker ps + + #构建缓存 + - name: rebuild + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + rebuild: true + mount: + - ./vendor + +volumes: # 定义流水线挂载目录,用于共享数据 + - name: maven-build + host: + path: /home/data/maven/build # 从宿主机中挂载的目录 + - name: maven-cache + host: + path: /home/data/maven/cache + - name: docker + host: + path: /var/run/docker.sock \ No newline at end of file diff --git a/pom.xml b/pom.xml index e5f6247..705b38d 100644 --- a/pom.xml +++ b/pom.xml @@ -40,5 +40,13 @@ + + + aliyun-repos + aliyun Releases + http://maven.aliyun.com/nexus/content/groups/public/ + + + \ No newline at end of file