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:
parent
1c426847d9
commit
17f09de1e8
@ -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),
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user