2021-10-30 14:50:23 +02:00
|
|
|
# Blobs (s3, gcs, azblob)
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
The `blobs` allows you to upload artifacts to Amazon S3, Azure Blob and
|
|
|
|
Google GCS.
|
|
|
|
|
2019-06-05 15:51:01 +02:00
|
|
|
## Customization
|
|
|
|
|
|
|
|
```yaml
|
2021-12-23 02:52:01 +02:00
|
|
|
# .goreleaser.yaml
|
2019-08-02 21:17:38 +02:00
|
|
|
blobs:
|
2019-06-05 15:51:01 +02:00
|
|
|
# You can have multiple blob configs
|
|
|
|
-
|
2022-10-14 15:17:30 +02:00
|
|
|
# Cloud provider name:
|
|
|
|
# - s3 for AWS S3 Storage
|
|
|
|
# - azblob for Azure Blob Storage
|
|
|
|
# - gs for Google Cloud Storage
|
|
|
|
#
|
|
|
|
# Templateable.
|
2019-06-05 15:51:01 +02:00
|
|
|
provider: azblob
|
2019-06-09 21:51:24 +02:00
|
|
|
|
2019-11-20 18:08:25 +02:00
|
|
|
# Set a custom endpoint, useful if you're using a minio backend or
|
|
|
|
# other s3-compatible backends.
|
2022-10-14 15:17:30 +02:00
|
|
|
#
|
2019-11-20 18:08:25 +02:00
|
|
|
# Implies s3ForcePathStyle and requires provider to be `s3`
|
2022-10-14 15:17:30 +02:00
|
|
|
#
|
|
|
|
# Templateable.
|
2019-11-20 18:08:25 +02:00
|
|
|
endpoint: https://minio.foo.bar
|
|
|
|
|
2019-12-27 19:18:41 +02:00
|
|
|
# Sets the bucket region.
|
|
|
|
# Requires provider to be `s3`
|
|
|
|
# Defaults to empty.
|
2022-10-14 15:17:30 +02:00
|
|
|
#
|
|
|
|
# Templateable.
|
2019-12-27 19:18:41 +02:00
|
|
|
region: us-west-1
|
|
|
|
|
|
|
|
# Disables SSL
|
|
|
|
# Requires provider to be `s3`
|
|
|
|
# Defaults to false
|
|
|
|
disableSSL: true
|
|
|
|
|
2019-06-05 15:51:01 +02:00
|
|
|
# Template for the bucket name
|
2022-10-14 15:17:30 +02:00
|
|
|
#
|
|
|
|
# Templateable.
|
2019-06-05 15:51:01 +02:00
|
|
|
bucket: goreleaser-bucket
|
2019-06-09 21:51:24 +02:00
|
|
|
|
|
|
|
# IDs of the artifacts you want to upload.
|
|
|
|
ids:
|
|
|
|
- foo
|
|
|
|
- bar
|
|
|
|
|
2019-06-05 15:51:01 +02:00
|
|
|
# Template for the path/name inside the bucket.
|
|
|
|
# Default is `{{ .ProjectName }}/{{ .Tag }}`
|
|
|
|
folder: "foo/bar/{{.Version}}"
|
2020-05-25 20:07:40 +02:00
|
|
|
|
2021-11-22 19:53:08 +02:00
|
|
|
# You can add extra pre-existing files to the bucket.
|
|
|
|
# The filename on the release will be the last part of the path (base).
|
|
|
|
# If another file with the same name exists, the last one found will be used.
|
|
|
|
# These globs can also include templates.
|
|
|
|
#
|
2020-05-25 20:07:40 +02:00
|
|
|
# Defaults to empty.
|
|
|
|
extra_files:
|
|
|
|
- glob: ./path/to/file.txt
|
|
|
|
- glob: ./glob/**/to/**/file/**/*
|
|
|
|
- glob: ./glob/foo/to/bar/file/foobar/override_from_previous
|
2021-11-24 03:18:47 +02:00
|
|
|
- glob: ./single_file.txt
|
|
|
|
name_template: file.txt # note that this only works if glob matches 1 file only
|
2019-06-05 15:51:01 +02:00
|
|
|
-
|
|
|
|
provider: gs
|
|
|
|
bucket: goreleaser-bucket
|
|
|
|
folder: "foo/bar/{{.Version}}"
|
|
|
|
-
|
|
|
|
provider: s3
|
|
|
|
bucket: goreleaser-bucket
|
|
|
|
folder: "foo/bar/{{.Version}}"
|
|
|
|
```
|
|
|
|
|
2020-05-10 23:59:21 +02:00
|
|
|
!!! tip
|
2020-11-19 22:31:26 +02:00
|
|
|
Learn more about the [name template engine](/customization/templates/).
|
2019-06-05 15:51:01 +02:00
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
GoReleaser's blob pipe authentication varies depending upon the blob provider as mentioned below:
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2019-06-28 13:51:19 +02:00
|
|
|
### S3 Provider
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
S3 provider support AWS
|
|
|
|
[default credential provider](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials)
|
|
|
|
chain in the following order:
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2019-06-28 13:51:19 +02:00
|
|
|
- Environment variables.
|
|
|
|
- Shared credentials file.
|
2019-08-02 21:17:38 +02:00
|
|
|
- If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
|
2019-06-28 13:51:19 +02:00
|
|
|
|
|
|
|
### Azure Blob Provider
|
|
|
|
|
2022-09-17 05:13:09 +02:00
|
|
|
It supports authentication only with
|
2020-05-11 14:35:58 +02:00
|
|
|
[environment variables](https://docs.microsoft.com/en-us/azure/storage/common/storage-azure-cli#set-default-azure-storage-account-environment-variables):
|
2019-06-05 15:51:01 +02:00
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
- `AZURE_STORAGE_ACCOUNT`
|
|
|
|
- `AZURE_STORAGE_KEY` or `AZURE_STORAGE_SAS_TOKEN`
|
2019-06-05 15:51:01 +02:00
|
|
|
|
|
|
|
### [GCS Provider](https://cloud.google.com/docs/authentication/production)
|
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
GCS provider uses
|
|
|
|
[Application Default Credentials](https://cloud.google.com/docs/authentication/production)
|
|
|
|
in the following order:
|
2019-06-28 13:51:19 +02:00
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
- Environment Variable (`GOOGLE_APPLICATION_CREDENTIALS`)
|
|
|
|
- Default Service Account from the compute instance (Compute Engine,
|
|
|
|
Kubernetes Engine, Cloud function etc).
|
2019-06-28 13:51:19 +02:00
|
|
|
|
2020-05-11 14:35:58 +02:00
|
|
|
## ACLs
|
2020-01-26 17:25:27 +02:00
|
|
|
|
|
|
|
There is no common way to set ACLs across all bucket providers, so, [go-cloud][]
|
|
|
|
[does not support it yet][issue1108].
|
|
|
|
|
|
|
|
You are expected to set the ACLs on the bucket/folder/etc, depending on your
|
|
|
|
provider.
|
|
|
|
|
|
|
|
[go-cloud]: https://gocloud.dev/howto/blob/
|
|
|
|
[issue1108]: https://github.com/google/go-cloud/issues/1108
|