Skip to content

Commit

Permalink
feat: add s3ForcePathStyle option for s3 publisher (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xlau authored Nov 17, 2024
1 parent d971224 commit a82e82c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-flies-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-bin": minor
---

feat: add s3ForcePathStyle option for s3 publisher
20 changes: 11 additions & 9 deletions pkg/publisher/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
type ObjectOptions struct {
file *string

endpoint *string
region *string
bucket *string
key *string
forcePathStyle *bool
endpoint *string
region *string
bucket *string
key *string

acl *string
storageClass *string
Expand All @@ -40,10 +41,11 @@ func ConfigurePublishToS3Command(app *kingpin.Application) {
options := ObjectOptions{
file: command.Flag("file", "").Required().String(),

region: command.Flag("region", "").String(),
bucket: command.Flag("bucket", "").Required().String(),
key: command.Flag("key", "").Required().String(),
endpoint: command.Flag("endpoint", "").String(),
forcePathStyle: command.Flag("forcePathStyle", "").Default("true").Bool(),
region: command.Flag("region", "").String(),
bucket: command.Flag("bucket", "").Required().String(),
key: command.Flag("key", "").Required().String(),
endpoint: command.Flag("endpoint", "").String(),

acl: command.Flag("acl", "").String(),
storageClass: command.Flag("storageClass", "").String(),
Expand Down Expand Up @@ -112,7 +114,7 @@ func upload(options *ObjectOptions) error {
}
if *options.endpoint != "" {
awsConfig.Endpoint = options.endpoint
awsConfig.S3ForcePathStyle = aws.Bool(true)
awsConfig.S3ForcePathStyle = aws.Bool(*options.forcePathStyle)
}

//awsConfig.WithLogLevel(aws.LogDebugWithHTTPBody)
Expand Down

0 comments on commit a82e82c

Please sign in to comment.