The S3 plugin uploads files and build artifacts to your S3 bucket, or S3-compatible bucket such as Minio. The below pipeline configuration demonstrates simple usage:

pipeline:
  s3:
    image: plugins/s3
    bucket: my-bucket-name
    source: public/**/*
    target: /target/location
    secretFrom: # Use an Amazon or Generic secret type
      AWS_ACCESS_KEY_ID:
        name: s3-secret-name
        keyRef: AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY:
        name: s3-secret-name
        keyRef: AWS_SECRET_ACCESS_KEY

S3-specific bucket attributes can easily be configured:

pipeline:
  s3:
    image: plugins/s3
    bucket: my-bucket-name
    source: public/**/*
    target: /target/location
    acl: public-read
    region: us-east-1

The plugin provides various tools to filter what content should be uploaded. The following example shows how to strip a prefix from source path and exclude certain files.

pipeline:
  s3:
    image: plugins/s3
    bucket: my-bucket-name
    source: public/**/*
    target: /target/location
    strip_prefix: public/
    exclude:
      - **/*.xml

Minio

The S3 plugin is compatible with any S3-like Object Storage, like Minio:

pipeline:
  s3:
    image: plugins/s3
    bucket: my-bucket-name
    source: public/**/*
    target: /target/location
    path_style: true # This MUST be true for Minio
    endpoint: https://play.minio.io:9000

Parameter Reference

parameter required description
bucket yes bucket name
source yes source location of the files, using a glob matching pattern
target yes target location of files in the bucket
region no bucket region (us-east-1, eu-west-1, etc, defaults to us-east-1)
endpoint no custom endpoint URL (optional, to use a S3 compatible non-Amazon service)
acl no access to files that are uploaded (private, public-read, etc, defaults to private)
encryption no if provided, use server-side encryption
strip_prefix no strip the prefix from source path
exclude no glob exclusion patterns
path_style no whether path style URLs should be used (true for minio)