From c4c47223b3ee4ef36a0c1a99b16fa1d59fed9df9 Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Mon, 21 Jun 2021 23:20:39 +0200 Subject: [PATCH] refactor: drone ci volumes --- .drone.yml | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/.drone.yml b/.drone.yml index dc1447c..46304b5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,35 +8,28 @@ platform: arch: amd64 steps: -- name: restore-cache - image: drillster/drone-volume-cache - volumes: - - name: cache - path: /cache - settings: - restore: true - mount: - - ./target - - name: test image: joseluisq/rust-linux-darwin-builder:1.52.1 + volumes: + - name: cargo-target + path: /drone/src/target + - name: cargo-git + path: /root/.cargo/git + - name: cargo-registry + path: /root/.cargo/registry commands: - make test -- name: rebuild-cache - image: drillster/drone-volume-cache - volumes: - - name: cache - path: /cache - settings: - rebuild: true - mount: - - ./target - volumes: - - name: cache + - name: cargo-target + host: + path: /var/ci-volumes/cargo-target + - name: cargo-git + host: + path: /var/ci-volumes/cargo-git + - name: cargo-registry host: - path: /tmp/cache + path: /var/ci-volumes/cargo-registry trigger: event: @@ -64,6 +57,13 @@ platform: steps: - name: test image: joseluisq/rust-linux-darwin-builder:1.52.1 + volumes: + - name: cargo-target + path: /drone/src/target + - name: cargo-git + path: /root/.cargo/git + - name: cargo-registry + path: /root/.cargo/registry commands: - make test when: @@ -72,6 +72,13 @@ steps: - name: release image: joseluisq/rust-linux-darwin-builder:1.52.1 + volumes: + - name: cargo-target + path: /drone/src/target + - name: cargo-git + path: /root/.cargo/git + - name: cargo-registry + path: /root/.cargo/registry commands: - make prod.release @@ -150,6 +157,17 @@ steps: auto_tag: true auto_tag_suffix: alpine +volumes: + - name: cargo-target + host: + path: /var/ci-volumes/cargo-target + - name: cargo-git + host: + path: /var/ci-volumes/cargo-git + - name: cargo-registry + host: + path: /var/ci-volumes/cargo-registry + trigger: ref: include: @@ -175,11 +193,25 @@ platform: steps: - name: test image: joseluisq/rust-linux-darwin-builder:1.52.1 + volumes: + - name: cargo-target + path: /drone/src/target + - name: cargo-git + path: /root/.cargo/git + - name: cargo-registry + path: /root/.cargo/registry commands: - make test - name: release image: joseluisq/rust-linux-darwin-builder:1.52.1 + volumes: + - name: cargo-target + path: /drone/src/target + - name: cargo-git + path: /root/.cargo/git + - name: cargo-registry + path: /root/.cargo/registry commands: - make prod.release @@ -211,6 +243,17 @@ steps: tags: - v1-dev-alpine +volumes: + - name: cargo-target + host: + path: /var/ci-volumes/cargo-target + - name: cargo-git + host: + path: /var/ci-volumes/cargo-git + - name: cargo-registry + host: + path: /var/ci-volumes/cargo-registry + trigger: target: - staging @@ -226,6 +269,9 @@ platform: os: linux arch: amd64 +clone: + disable: true + steps: - name: notify image: plugins/slack -- libgit2 1.7.2