Adrien Vergé 9585fa84d1 Use rsync -aHAX --delete
When creating/restoring cache, the user wants the created files and dir
to *replace* existing ones. This also implies deleting leftover files.

To be clearer, let's take an example with a JS / TypeScript project:
- A project needs to install some "typings" named `footypes` in
  `node_modules`.
- `footypes` becomes deprecated and should be replaced by `footypes2`.
  The developer then replaces `footypes` with `footypes2` in his
  `package.json`.
- On next builds, old cache is restored (including
  `node_modules/footypes`). Then `footypes2` is also installed in
  `node_modules`.
- Builds now fail because there are conflicting typings for library
  `foo`: both `footypes` and `footypes2` are present.

With the `--delete` flag added to `rsync`, when creating new caches,
files that are not present in source dir are deleted from target dir.
2016-12-13 15:20:57 +01:00
2016-12-13 15:20:57 +01:00
2016-12-12 11:20:44 +01:00
2016-12-07 11:38:56 +01:00

drone-volume-cache

This is a pure Bash Drone 0.5 plugin to cache files and/or folders to a locally mounted volume.

For more information on how to use the plugin, please take a look at the docs.

Docker

Build the docker image by running:

docker build --rm=true -t drillster/drone-volume-cache .

Usage

Execute from the working directory:

docker run --rm \
  -e PLUGIN_REBUILD=true \
  -e PLUGIN_MOUNT="./node_modules" \
  -e DRONE_REPO_OWNER="foo" \
  -e DRONE_REPO_NAME="bar" \
  -v $(pwd):$(pwd) \
  -v /tmp/cache:/cache \
  -w $(pwd) \
  drillster/drone-volume-cache
S
Description
No description provided
Readme MIT 71 KiB
Languages
Shell 94.2%
Dockerfile 5.8%