1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +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
s3:
- bucket: goreleaser
endpoint: http://localhost:9000

View File

@ -246,9 +246,10 @@ type Before struct {
// S3 contains s3 config
type S3 struct {
Region string
Bucket string
Folder string
Region string
Bucket string
Folder string
Endpoint string // used for minio for example
}
// 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 {
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{
Region: aws.String(conf.Region),
})