diff --git a/.changeset/healthy-flies-rescue.md b/.changeset/healthy-flies-rescue.md new file mode 100644 index 0000000..cd4264b --- /dev/null +++ b/.changeset/healthy-flies-rescue.md @@ -0,0 +1,5 @@ +--- +"app-builder-bin": minor +--- + +feat: add s3ForcePathStyle option for s3 publisher diff --git a/pkg/publisher/s3.go b/pkg/publisher/s3.go index 2ea0aee..835f844 100644 --- a/pkg/publisher/s3.go +++ b/pkg/publisher/s3.go @@ -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 @@ -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(), @@ -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)