1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/www/content/s3.md

88 lines
3.0 KiB
Markdown
Raw Normal View History

2018-05-13 20:49:28 +02:00
---
title: S3
series: customization
hideFromIndex: true
weight: 115
---
Since [v0.74.0](https://github.com/goreleaser/goreleaser/releases/tag/v0.74.0),
GoReleaser supports pushing artifacts to Amazon S3 and other API-compatible
2019-02-01 14:59:34 +02:00
object storages ([minio][] for example).
2018-05-13 20:49:28 +02:00
[minio]: https://www.minio.io
Right now, the implementation is quite simple and probably won't cover all
use cases. If you need one of such use cases, please open an issue/pull request.
2019-03-25 01:10:30 +02:00
Here is what you can customize:
2018-05-13 20:49:28 +02:00
## Customization
```yaml
# .goreleaser.yml
s3:
# You can have multiple s3 configs
-
2019-01-24 20:17:39 +02:00
# Template for the bucket name(without the s3:// prefix)
2018-05-13 20:56:36 +02:00
# Default is empty.
2018-05-13 20:49:28 +02:00
bucket: my-bucket
# IDs of the artifacts you want to upload.
ids:
- foo
- bar
2018-05-13 20:56:36 +02:00
# AWS Region to use.
# Defaults is us-east-1
2018-05-13 20:49:28 +02:00
region: us-east-1
2018-07-09 08:57:46 +02:00
# Template for the path/name inside the bucket.
2018-05-13 20:49:28 +02:00
# Default is `{{ .ProjectName }}/{{ .Tag }}`
folder: "foo/bar/{{.Version}}"
2018-05-13 20:56:36 +02:00
# Set a custom profile to use for this s3 config. If you have multiple
# profiles setup in you ~/.aws config, this shall help defining which
# profile to use in which s3 bucket.
# Default is empty.
profile: my-profile
2018-05-13 20:49:28 +02:00
# Endpoint allows you to set a custom endpoint, which is useful if you
# want to push your artifacts to a minio server for example.
2018-05-13 20:56:36 +02:00
# Default is AWS S3 URL.
2018-05-13 20:49:28 +02:00
endpoint: "http://minio.foo.com"
2018-07-22 00:07:20 +02:00
# Sets the ACL of the object using the specified canned ACL.
# Default is private.
acl: public-read
2018-05-13 20:49:28 +02:00
```
2018-07-09 08:57:46 +02:00
> Learn more about the [name template engine](/templates).
2018-07-22 00:07:20 +02:00
> Learn more about the [acl](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
2018-07-09 08:57:46 +02:00
2018-05-13 20:49:28 +02:00
## Authentication
GoReleaser will authenticate using the [same methods defined by aws-cli][auth].
You can read the [docs][auth] to find out more about it.
Currently it supports authentication with:
2019-03-25 01:10:30 +02:00
- An [EnvProvider][EnvProvider] which retrieves credentials from the environment
variables of the running process. Environment credentials never expire.
Environment variables used:
- Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY`
- Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY`
- A [SharedCredentialsProvider][SharedCredentialsProvider] which retrieves
credentials from the current user's home directory, and keeps track if those
credentials are expired. Profile ini file example: `$HOME/.aws/credentials`
- A AssumeRoleTokenProvider with enabled SharedConfigState which uses MFA
prompting for token code on stdin. Go to [session doc][session] for more
details.
You can also set different profile names for each S3 config, so you may be able
2018-05-13 20:56:36 +02:00
to push to buckets in different accounts, for example.
2018-05-13 20:49:28 +02:00
[auth]: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
[envProvider]: https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials/#EnvProvider
[sharedCredentialsProvider]: https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials/#SharedCredentialsProvider
[session]: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/