caching round 2
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
xeals 2020-10-15 22:56:33 +11:00
parent 8dcb6e253d
commit 3f994e88cf
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
2 changed files with 33 additions and 60 deletions

View File

@ -1,21 +1,15 @@
local CacheVolume = "cache";
local Cache(name, settings) = { local Cache(name, settings) = {
name: name, name: name,
image: "meltwater/drone-cache", image: "drillster/drone-volume-cache",
pull: true, volumes: [ {
settings: { name: CacheVolume,
backend: "filesystem", path: "/cache"
cache_key: "{{ .Repo.Name }}", } ],
archive_format: "gzip", settings: settings + {
mount: [ mount: ["/nix/store"]
"/nix/store" }
]
} + settings,
volumes: [
{
name: "cache",
path: "/tmp/cache"
}
]
}; };
local Pipeline(channel) = { local Pipeline(channel) = {
@ -30,12 +24,12 @@ local Pipeline(channel) = {
CACHIX_CACHE: "xeals", CACHIX_CACHE: "xeals",
CACHIX_SIGNING_KEY: { from_secret: "cachix_key" }, CACHIX_SIGNING_KEY: { from_secret: "cachix_key" },
}, },
volumes: [ volumes: [ {
{ name: CacheVolume,
name: "cache", host: {
temp: {} path: "/tmp/drone/cache"
} }
], } ],
steps: [ steps: [
Cache("restore-nix-store", { Cache("restore-nix-store", {
restore: true restore: true

View File

@ -9,18 +9,14 @@ platform:
steps: steps:
- name: restore-nix-store - name: restore-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
restore: true restore: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
- name: build - name: build
image: nixos/nix image: nixos/nix
@ -46,18 +42,14 @@ steps:
NUR_REPO: xeals NUR_REPO: xeals
- name: save-nix-store - name: save-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
rebuild: true rebuild: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
when: when:
status: status:
- success - success
@ -65,7 +57,8 @@ steps:
volumes: volumes:
- name: cache - name: cache
temp: {} host:
path: /tmp/cache
--- ---
kind: pipeline kind: pipeline
@ -78,18 +71,14 @@ platform:
steps: steps:
- name: restore-nix-store - name: restore-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
restore: true restore: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
- name: build - name: build
image: nixos/nix image: nixos/nix
@ -115,18 +104,14 @@ steps:
NUR_REPO: xeals NUR_REPO: xeals
- name: save-nix-store - name: save-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
rebuild: true rebuild: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
when: when:
status: status:
- success - success
@ -134,7 +119,8 @@ steps:
volumes: volumes:
- name: cache - name: cache
temp: {} host:
path: /tmp/cache
--- ---
kind: pipeline kind: pipeline
@ -147,18 +133,14 @@ platform:
steps: steps:
- name: restore-nix-store - name: restore-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
restore: true restore: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
- name: build - name: build
image: nixos/nix image: nixos/nix
@ -184,18 +166,14 @@ steps:
NUR_REPO: xeals NUR_REPO: xeals
- name: save-nix-store - name: save-nix-store
pull: true image: drillster/drone-volume-cache
image: meltwater/drone-cache
settings: settings:
archive_format: gzip
backend: filesystem
cache_key: "{{ .Repo.Name }}"
mount: mount:
- /nix/store - /nix/store
rebuild: true rebuild: true
volumes: volumes:
- name: cache - name: cache
path: /tmp/cache path: /cache
when: when:
status: status:
- success - success
@ -203,6 +181,7 @@ steps:
volumes: volumes:
- name: cache - name: cache
temp: {} host:
path: /tmp/cache
... ...