Google Cloud Storage Cache
by hvalle
The GCS cache plugin can be used to preserve files and directories between builds.
Example
kind: pipeline
name: default
steps:
- name: restore-cache
image: homerovalle/drone-gcs-cache
pull: true
settings:
bucket: gcs_bucket
json_key: your-service-account-json-key
restore: true
- name: build
image: node
commands:
- npm install
- name: rebuild-cache
image: homerovalle/drone-gcs-cache
pull: true
mount:
- node_modules
settings:
bucket: gcs_bucket
json_key: your-service-account-json-key
rebuild: true
- name: flush-cache
image: homerovalle/drone-gcs-cache
pull: true
settings:
bucket: gcs_bucket
json_key: your-service-account-json-key
flush: true
flush_age: 14
Properties
json_key
stringrequiredservice account json key.
Secret recommendedDefault: none
restore
booleanoptionalmode to restore the build environment from cache.
Default: false
rebuild
booleanoptionalmode to rebuild the cache from the build environment and specified mounts.
Default: false
flush
booleanoptionalmode to flush the cache of old cache items (please be sure to set this so we don't waste storage).
Default: false
flush_age
numberoptionalflush cache files older then x days.
Default: 30
mount
arrayoptionallist of files/directories to cache.
Default: none
debug
booleanoptionalenabling more logging for debugging.
Default: false
filename
stringoptionalfilename to use for cache.
Default: none
bucket
stringrequiredbucket to use to rebuild and restore cache.
Default: none
path
stringrequiredpath to store the cache file.
Default: [bucket]/<owner>/<repo>/<branch>/
fallback_path
stringrequiredfallback path for the cache file.
Default: [bucket]/<owner>/<repo>/<branch>/
flush_path
stringrequiredpath to search for flushable cache files.
Default: [bucket]/<owner>/<repo>/