wp-s3-action
Woodpecker CI plugin to perform S3 actions.
steps:
- name: sync
image: quay.io/thegeeklab/wp-s3-action
settings:
access_key: randomstring
secret_key: random-secret
region: us-east-1
bucket: my-bucket.s3-website-us-east-1.amazonaws.com
source: folder/to/archive
target: /target/location
-
S3 access key.Default: none
-
Access control list.Default: none
-
Name of the bucket.Default: none
-
Cache-control settings for uploads.Default: none
-
ID of cloudfront distribution to invalidate.Default: none
-
Content-encoding settings for uploads.Default: none
-
Content-type settings for uploads.Default: none
-
Delete locally removed files from the target.Default: false
-
Endpoint for the s3 connection.Default: none
-
Skip SSL verification.Default: false
-
Plugin log level.Default: info
-
Customize number concurrent files to process.Default: 100
-
Additional metadata for uploads.Default: none
-
Enable path style for bucket paths.Default: false
-
Redirects to create.Default: none
-
S3 region.Default: us-east-1
-
S3 secret key.Default: none
-
Upload source path.Default: .
-
Upload target path.Default: /
Customize acl
, content_type
, content_encoding
or cache_control
:
steps:
- name: sync
image: quay.io/thegeeklab/wp-s3-action
settings:
access_key: randomstring
secret_key: random-secret
region: us-east-1
bucket: my-bucket.s3-website-us-east-1.amazonaws.com
source: folder/to/archive
target: /target/location
acl:
"public/*": public-read
"private/*": private
content_type:
".svg": image/svg+xml
content_encoding:
".js": gzip
".css": gzip
cache_control: "public, max-age: 31536000"
All map
parameters can be specified as map
for a subset of files or as string
for all files.
- For the
acl
parameter the key must be a glob. Files without a matching rule will default toprivate
. - For the
content_type
parameter, the key must be a file extension (including the leading dot). To apply a configuration to files without extension, the key can be set to an empty string""
. For files without a matching rule, the content type is determined automatically. - For the
content_encoding
parameter, the key must be a file extension (including the leading dot). To apply a configuration to files without extension, the key can be set to an empty string""
. For files without a matching rule, no Content Encoding header is set. - For the
cache_control
parameter, the key must be a file extension (including the leading dot). If you want to set cache control for files without an extension, set the key to the empty string""
. For files without a matching rule, no Cache Control header is set.
Sync to Minio S3:
To use Minio S3 its required to set path_style: true
.
steps:
- name: sync
image: quay.io/thegeeklab/wp-s3-action
settings:
endpoint: https://minio.example.com
access_key: randomstring
secret_key: random-secret
bucket: my-bucket
source: folder/to/archive
target: /target/location
path_style: true
Build the binary with the following command:
make build
Build the container image with the following command:
docker build --file Containerfile.multiarch --tag thegeeklab/wp-s3-action .
docker run --rm \
-e PLUGIN_BUCKET=my_bucket \
-e AWS_ACCESS_KEY_ID=randomstring \
-e AWS_SECRET_ACCESS_KEY=random-secret \
-v $(pwd):/build:z \
-w /build \
thegeeklab/wp-s3-action