mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-13 13:48:40 +02:00
feat: add acl option for s3 (#732)
This commit is contained in:
parent
abd30ccfa1
commit
e77f666cd9
@ -281,6 +281,7 @@ type S3 struct {
|
||||
Folder string
|
||||
Profile string
|
||||
Endpoint string // used for minio for example
|
||||
ACL string
|
||||
}
|
||||
|
||||
// Put HTTP upload configuration
|
||||
|
@ -38,6 +38,9 @@ func (Pipe) Default(ctx *context.Context) error {
|
||||
if s3.Region == "" {
|
||||
s3.Region = "us-east-1"
|
||||
}
|
||||
if s3.ACL == "" {
|
||||
s3.ACL = "private"
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -99,6 +102,7 @@ func upload(ctx *context.Context, conf config.S3) error {
|
||||
Bucket: aws.String(conf.Bucket),
|
||||
Key: aws.String(filepath.Join(folder, artifact.Name)),
|
||||
Body: f,
|
||||
ACL: aws.String(conf.ACL),
|
||||
})
|
||||
return err
|
||||
})
|
||||
|
@ -49,6 +49,7 @@ func TestDefaults(t *testing.T) {
|
||||
Bucket: "foo",
|
||||
Region: "us-east-1",
|
||||
Folder: "{{ .ProjectName }}/{{ .Tag }}",
|
||||
ACL: "private",
|
||||
}}, ctx.Config.S3)
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,13 @@ s3:
|
||||
# want to push your artifacts to a minio server for example.
|
||||
# Default is AWS S3 URL.
|
||||
endpoint: "http://minio.foo.com"
|
||||
# Sets the ACL of the object using the specified canned ACL.
|
||||
# Default is private.
|
||||
acl: public-read
|
||||
```
|
||||
|
||||
> Learn more about the [name template engine](/templates).
|
||||
> Learn more about the [acl](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html).
|
||||
|
||||
## Authentication
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user