Skip to content
Permalink
Browse files

feat: also support minio

  • Loading branch information...
caarlos0 committed May 13, 2018
1 parent 1c42684 commit 17f09de1e86e1759a0c6c46000953d7e3389be68
Showing with 11 additions and 4 deletions.
  1. +1 −0 .goreleaser.yml
  2. +4 −3 config/config.go
  3. +6 −1 pipeline/s3/s3.go
@@ -81,4 +81,5 @@ snapcraft:
confinement: classic
s3:
- bucket: goreleaser
endpoint: http://localhost:9000

@@ -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
@@ -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),
})

0 comments on commit 17f09de

Please sign in to comment.
You can’t perform that action at this time.