From 37fc1d721fce2d09b415d85d00c3e2af2bf86ff4 Mon Sep 17 00:00:00 2001
From: Felix Ableitner <me@nutomic.com>
Date: Thu, 10 Dec 2020 13:21:34 +0100
Subject: [PATCH] use volume for diesel cli

---
 .drone.yml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 5bd490ed..ffffb79b 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -24,15 +24,17 @@ steps:
     commands:
       - mdbook build docs/
 
-  - name: install test deps
+  - name: install diesel cli
     image: ekidd/rust-musl-builder:experimental-stable
     user: root
+    volumes:
+      - name: dieselcli
+        path: /dieselcli
     commands:
-      - apt-get -y update
-      - apt-get -y install --no-install-recommends espeak postgresql-client
       - cargo install diesel_cli --no-default-features --features postgres
+      - mv /root/.cargo/bin/diesel /dieselcli/diesel
 
-  - name: cargo test
+  - name: install deps and run cargo test
     image: ekidd/rust-musl-builder:experimental-stable
     user: root
     environment:
@@ -40,8 +42,13 @@ steps:
       DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
       RUST_BACKTRACE: 1
       RUST_TEST_THREADS: 1
+    volumes:
+      - name: dieselcli
+        path: /dieselcli
     commands:
-      - /root/.cargo/bin/diesel migration run
+      - apt-get -y update
+      - apt-get -y install --no-install-recommends espeak postgresql-client
+      - /dieselcli/diesel migration run
       - cargo test --workspace --no-fail-fast
       
   - name: run federation tests
@@ -84,3 +91,7 @@ services:
   environment:
     POSTGRES_USER: lemmy
     POSTGRES_PASSWORD: password
+
+volumes:
+  - name: dieselcli
+    temp: {}
\ No newline at end of file
-- 
2.44.1