1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-09-16 09:26:52 +02:00

feat: also support minio

This commit is contained in:
Carlos Alexandro Becker
2018-05-13 14:22:03 -03:00
committed by Carlos Alexandro Becker
parent 1c426847d9
commit 17f09de1e8
3 changed files with 11 additions and 4 deletions

View File

@@ -81,4 +81,5 @@ snapcraft:
confinement: classic confinement: classic
s3: s3:
- bucket: goreleaser - bucket: goreleaser
endpoint: http://localhost:9000

View File

@@ -246,9 +246,10 @@ type Before struct {
// S3 contains s3 config // S3 contains s3 config
type S3 struct { type S3 struct {
Region string Region string
Bucket string Bucket string
Folder string Folder string
Endpoint string // used for minio for example
} }
// Project includes all project configuration // Project includes all project configuration

View File

@@ -56,7 +56,12 @@ func (Pipe) Run(ctx *context.Context) error {
} }
func upload(ctx *context.Context, conf config.S3) error { func upload(ctx *context.Context, conf config.S3) error {
sess := session.Must(session.NewSession()) var awsConfig = aws.Config{}
if conf.Endpoint != "" {
awsConfig.Endpoint = aws.String(conf.Endpoint)
awsConfig.S3ForcePathStyle = aws.Bool(true)
}
sess := session.Must(session.NewSession(&awsConfig))
svc := s3.New(sess, &aws.Config{ svc := s3.New(sess, &aws.Config{
Region: aws.String(conf.Region), Region: aws.String(conf.Region),
}) })