aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.drone.yml49
-rw-r--r--script/builder_image/Dockerfile6
-rw-r--r--script/builder_image/Makefile8
3 files changed, 41 insertions, 22 deletions
diff --git a/.drone.yml b/.drone.yml
index 822f2e42..b0b54792 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -5,9 +5,16 @@ name: default
workspace:
base: /drone/garage
+volumes:
+- name: cargo_home
+ temp: {}
+
steps:
- name: restore-cache
image: meltwater/drone-cache:dev
+ volumes:
+ - name: cargo_home
+ path: /drone/cargo
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
@@ -21,40 +28,41 @@ steps:
cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
+ - '/drone/cargo'
- 'target'
- - '/drone/cargo/registry/index'
- - '/drone/cargo/registry/cache'
- - '/drone/cargo/bin'
- - '/drone/cargo/git/db'
path_style: true
endpoint: https://garage.deuxfleurs.fr
when:
branch:
- - nonexistent_skip_this_step
+ - nonexistent_skip_this_step
- name: build
- image: rust:buster
+ image: lxpz/garage_builder_amd64:1
+ volumes:
+ - name: cargo_home
+ path: /drone/cargo
environment:
CARGO_HOME: /drone/cargo
commands:
- - apt-get update
- - apt-get install --yes libsodium-dev
- - rustup component add rustfmt
- pwd
- cargo fmt -- --check
- cargo build
- name: cargo-test
- image: rust:buster
+ image: lxpz/garage_builder_amd64:1
+ volumes:
+ - name: cargo_home
+ path: /drone/cargo
environment:
CARGO_HOME: /drone/cargo
commands:
- - apt-get update
- - apt-get install --yes libsodium-dev
- cargo test
- name: rebuild-cache
image: meltwater/drone-cache:dev
+ volumes:
+ - name: cargo_home
+ path: /drone/cargo
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
@@ -68,25 +76,22 @@ steps:
cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
+ - '/drone/cargo'
- 'target'
- - '/drone/cargo/registry/index'
- - '/drone/cargo/registry/cache'
- - '/drone/cargo/git/db'
- - '/drone/cargo/bin'
path_style: true
endpoint: https://garage.deuxfleurs.fr
when:
branch:
- - nonexistent_skip_this_step
+ - nonexistent_skip_this_step
- name: smoke-test
- image: rust:buster
+ image: lxpz/garage_builder_amd64:1
+ volumes:
+ - name: cargo_home
+ path: /drone/cargo
environment:
CARGO_HOME: /drone/cargo
commands:
- - apt-get update
- - apt-get install --yes libsodium-dev awscli python-pip
- - pip install s3cmd
- ./script/test-smoke.sh || (cat /tmp/garage.log; false)
---
@@ -124,6 +129,6 @@ steps:
---
kind: signature
-hmac: 39f293cab9824270b0e7aac4f6cbaaca57727fdc8feb2b822942cc82b3f7a64a
+hmac: de82026387bd09e547dbc9cc5d232fd865204b4f393d32508c50b58f8e60611d
...
diff --git a/script/builder_image/Dockerfile b/script/builder_image/Dockerfile
new file mode 100644
index 00000000..292d551d
--- /dev/null
+++ b/script/builder_image/Dockerfile
@@ -0,0 +1,6 @@
+FROM rust:buster
+RUN apt-get update && \
+ apt-get install --yes libsodium-dev awscli python-pip && \
+ rm -rf /var/lib/apt/lists/*
+RUN rustup component add rustfmt
+RUN pip install s3cmd
diff --git a/script/builder_image/Makefile b/script/builder_image/Makefile
new file mode 100644
index 00000000..00b0f6c7
--- /dev/null
+++ b/script/builder_image/Makefile
@@ -0,0 +1,8 @@
+DOCKER=lxpz/garage_builder_amd64
+
+docker:
+ docker build -t $(DOCKER):$(TAG) .
+ docker push $(DOCKER):$(TAG)
+ docker tag $(DOCKER):$(TAG) $(DOCKER):latest
+ docker push $(DOCKER):latest
+