noenv/s3-sync
Drone S3 Sync Plugin
1.4K
Drone plugin to synchronize a directory with an Amazon S3 Bucket.
This is a fork of the official plugin
Build
Build the binary with the following command:
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
go build -v -a -tags netgo -o release/linux/amd64/drone-s3-sync
Docker
Build the Docker image with the following command:
docker build \
--label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
--file Dockerfile --tag noenv/s3-sync .
Usage
docker run --rm \
-e PLUGIN_SOURCE=<source> \
-e PLUGIN_TARGET=<target> \
-e PLUGIN_BUCKET=<bucket> \
-e AWS_ACCESS_KEY_ID=<access_key> \
-e AWS_SECRET_ACCESS_KEY=<secret_key> \
-v $(pwd):$(pwd) \
-w $(pwd) \
noenv/s3-sync
Debug
DEBUG=1 ./release/linux/amd64/drone-s3-sync \
--access-key <access_key> \
--secret-key <secret_key> \
--bucket <bucket> \
--region <region> \
--source . \
--target / \
--access public-read \
--content-type '{".txt":"text/plain"}' \
--cache-control '{"*.txt":"max-age=3600"}' \
--delete \
--dry-run
Source
docker pull noenv/s3-sync