Sign inSign up

arizbuno/drone-s3-sync

By arizbuno

•Updated almost 7 years ago

S3 Sync Plugin for Drone v1

Image
0

2.3K

arizbuno/drone-s3-sync repository overview

⁠Drone AWS S3 Synchronisation Pipeline Plugin

Build Status for Drone S3 Plugin

https://hub.docker.com/r/jonathanio/drone-s3-sync/⁠

This plugin for a Drone⁠ Pipeline utilises the aws s3 sync command to synchronise files and folders with a selected Amazon S3 bucket.

This plugin is loosely based on the original drone-s3-sync⁠ repository by joshdvir⁠, but has been expanded with additional checking, SSE support, and the ability to assume a Role before running the aws CLI commands.

⁠Options

All options are managed below a settings key:

KeyOptionalDetails
aws_access_key_idOptionalAmazon AWS Access Key credential.
aws_secret_access_keyOptionalAmazon AWS Secret Access Key credential.
aws_assume_roleOptionalThe full ARN of a role to be assumed before running the synchronisation (and invalidating the CloudFront distribution, if set).
bucketRequiredThe name (but not the domain name) of the bucket to upload to.
regionOptionalThe region the bucket is within, as so to connect to it for the synchronisation (defaults to us-east-1 if not set).
aclOptionalSets the ACL for the object when the command is performed (e.g. private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control, and log-delivery-write).
sseOptionalSets the SSE parameter for the upload, if required, to enable encryption of the files at rest in the S3 bucket.
cache_controlOptionalIf provided, set this as the Cache-Control header in the file metadata.
sourceOptionalThe location of folder (defaults to ., the current directory) to synchronise, either absolute or relative to the current working directory (i.e. the root of the repository).
targetOptionalThe target folder to upload the files and folders in source to inside your S3 bucket (defaults to /).
excludeOptionalExclude all files or objects from the synchronisation that match the specified pattern.
includeOptionalDon't exclude files or objects from the synchronisation that match the specified pattern.
deleteOptionalSet to true to configure the synchronisation to delete files in the target that are not found in the source (defaults to false).
show_only_errorsOptionalSet to true to only show errors during the synchronisation, rather than every file uploaded (defaults to false).
cloudfront_distribution_idOptionalThe CloudFront Distribution ID to invalidate after synchronising, with the target used as the root of the invalidation path (by default this will be /*).

⁠Example

Use the following as an example configuration to use to synchronise files to S3 from within your .drone.yml files:

pipeline:
  synchronise-files:
    image: jonathanio/drone-s3-sync:latest
    settings:
      aws_assume_role: arn:aws:iam::123456789012:role/MyDeploymentRole
      bucket: my-example-bucket
      region: eu-west-2
      acl: public-read
      sse: AES256
      source: public/
      target: /
      exclude: "*.log"
      delete: true
      cloudfront_distribution_id: "9c5785d3ece6a9cdefa4"
    when:
      event: push
      branch: master

⁠Licence

MIT

⁠Author

and based upon work by joshdvir⁠.

Tag summary

Content type

Image

Digest

Size

24.8 MB

Last updated

almost 7 years ago

docker pull arizbuno/drone-s3-sync