Drone Cache
by meltwater
A Drone plugin for caching current workspace files between builds to reduce your build times. `drone-cache` is a small CLI program, written in Go without any external OS dependencies (such as tar, etc).
Example
kind: pipeline
name: default
steps:
- name: restore-cache
image: meltwater/drone-cache:dev
pull: true
settings:
access-key:
from_secret: aws_access_key_id
secret-key:
from_secret: aws_secret_access_key
restore: true
bucket: drone-cache-bucket
region: eu-west-1
mount:
- 'vendor'
- name: build
image: golang:1.11-alpine
pull: true
commands:
- apk add --update make git
- make drone-cache
- name: rebuild-cache
image: meltwater/drone-cache:dev
pull: true
settings:
access-key:
from_secret: aws_access_key_id
secret-key:
from_secret: aws_secret_access_key
rebuild: true
bucket: drone-cache-bucket
region: eu-west-1
mount:
- 'vendor'
Properties
backend
stringoptionalcache backend to use in plugin (s3, filesystem).
Default: s3
mount
arrayoptionalcache directories, an array of folders to cache.
Default: none
rebuild
booleanoptionalwhether to rebuild the cache directories.
Default: false
restore
booleanoptionalwhether to restore the cache directories.
Default: false
cache-key
stringoptionalcache key to use for the cache directories.
Default: none
archive-format
stringoptionalarchive format to use for the cache directories (tar, gzip).
Default: tar
debug
booleanoptionalwhether to enable debug mode.
Default: false
filesystem-cache-route
stringoptionallocal filesystem root directory for the filesystem cache.
Default: /tmp/cache
endpoint
stringoptionalendpoint for the s3 connection.
Default: none
access-key
stringoptionalAWS access key.
Secret recommendedDefault: none
secret-key
stringoptionalAWS secret key.
Secret recommendedDefault: none
bucket
stringoptionalAWS bucket name.
Default: none
region
stringoptionalAWS bucket region.
Default: none
path-style
booleanoptionaluse path style for bucket paths. (true for minio, false for aws).
Default: false
acl
stringoptionalupload files with acl (private, public-read, ...).
Default: private
encryption
stringoptionalserver-side encryption algorithm (AES256, aws:kms).
Default: none