aboutsummaryrefslogtreecommitdiff
path: root/.drone.yml
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-17 18:46:36 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-17 22:13:08 +0100
commitb5dc4d33a993ac285cd9c66d5363c3506eac25fc (patch)
treea535c6817d5f84f3f882eba2cbfbcc8e0b70d3c2 /.drone.yml
parenta3d9d0faac990dda729edbd885c24b2ba9f97e8e (diff)
downloadgarage-b5dc4d33a993ac285cd9c66d5363c3506eac25fc.tar.gz
garage-b5dc4d33a993ac285cd9c66d5363c3506eac25fc.zip
CI improvements
Diffstat (limited to '.drone.yml')
-rw-r--r--.drone.yml55
1 files changed, 51 insertions, 4 deletions
diff --git a/.drone.yml b/.drone.yml
index 8d356893..15582cc3 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -1,7 +1,21 @@
kind: pipeline
name: default
+workspace:
+ base: /drone
+
+clone:
+ disable: true
+
steps:
+ - name: clone
+ image: alpine/git
+ commands:
+ - mkdir -p cargo
+ - git clone https://git.deuxfleurs.fr/Deuxfleurs/garage.git
+ - cd garage
+ - git checkout $DRONE_COMMIT
+
- name: restore-cache
image: meltwater/drone-cache:dev
environment:
@@ -14,20 +28,38 @@ steps:
restore: true
archive_format: "gzip"
bucket: drone-cache
- cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
+ cache_key: '{{ .Repo.Name }}_{{ checksum "garage/Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
- - 'target'
+ - 'garage/target'
+ - 'cargo/registry/index'
+ - 'cargo/registry/cache'
+ - 'cargo/git/db'
+ - 'cargo/bin'
path_style: true
endpoint: https://garage.deuxfleurs.fr
- name: build
image: rust:buster
+ environment:
+ CARGO_HOME: /drone/cargo
commands:
- apt-get update
- apt-get install --yes libsodium-dev
+ - pwd
+ - cd garage
- cargo build
+ - name: cargo-test
+ image: rust:buster
+ environment:
+ CARGO_HOME: /drone/cargo
+ commands:
+ - apt-get update
+ - apt-get install --yes libsodium-dev
+ - cd garage
+ - cargo test
+
- name: rebuild-cache
image: meltwater/drone-cache:dev
environment:
@@ -40,9 +72,24 @@ steps:
rebuild: true
archive_format: "gzip"
bucket: drone-cache
- cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
+ cache_key: '{{ .Repo.Name }}_{{ checksum "garage/Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
- - 'target'
+ - 'garage/target'
+ - 'cargo/registry/index'
+ - 'cargo/registry/cache'
+ - 'cargo/git/db'
+ - 'cargo/bin'
path_style: true
endpoint: https://garage.deuxfleurs.fr
+
+ - name: smoke-test
+ image: rust:buster
+ environment:
+ CARGO_HOME: /drone/cargo
+ commands:
+ - apt-get update
+ - apt-get install --yes libsodium-dev awscli python-pip
+ - pip install s3cmd
+ - cd garage
+ - ./script/test-smoke.sh || (cat /tmp/garage.log; false)