mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add option forcePathStyle for s3 deployment
This commit is contained in:
@@ -23,6 +23,8 @@ public class S3DownloadOptions : RepositoryOptions, IObjectDownloadOptions
|
||||
public string Bucket { get; set; }
|
||||
|
||||
public string Prefix { get; set; }
|
||||
|
||||
public bool ForcePathStyle { get; set; }
|
||||
}
|
||||
|
||||
public class S3UploadOptions : S3DownloadOptions, IObjectUploadOptions
|
||||
@@ -98,8 +100,8 @@ public class S3Repository : ObjectRepository<S3DownloadOptions, S3UploadOptions,
|
||||
bool disableSigning = false;
|
||||
var config = new AmazonS3Config() {
|
||||
ServiceURL = options.Endpoint,
|
||||
ForcePathStyle = true, // support for MINIO
|
||||
Timeout = TimeSpan.FromMinutes(options.Timeout),
|
||||
ForcePathStyle = options.ForcePathStyle,
|
||||
Timeout = TimeSpan.FromMinutes(options.Timeout)
|
||||
};
|
||||
|
||||
if (options.Endpoint != null) {
|
||||
@@ -214,4 +216,4 @@ public class S3Repository : ObjectRepository<S3DownloadOptions, S3UploadOptions,
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ public class S3BaseCommand : OutputCommand
|
||||
|
||||
public string Prefix { get; private set; }
|
||||
|
||||
public bool ForcePathStyle { get; private set; }
|
||||
|
||||
public double Timeout { get; private set; }
|
||||
|
||||
protected S3BaseCommand(string name, string description)
|
||||
@@ -56,6 +58,11 @@ public class S3BaseCommand : OutputCommand
|
||||
.SetDescription("Prefix to the S3 url.")
|
||||
.SetArgumentHelpName("PREFIX");
|
||||
|
||||
AddOption<bool>((v) => ForcePathStyle = v, "--forcePathStyle")
|
||||
.SetDescription("Force a path-style endpoint to be used where the bucket name is part of the path.")
|
||||
.SetArgumentHelpName("BOOL")
|
||||
.SetDefault(true);
|
||||
|
||||
AddOption<double>((v) => Timeout = v, "--timeout")
|
||||
.SetDescription("Network timeout in minutes.")
|
||||
.SetArgumentHelpName("MINUTES")
|
||||
|
||||
Reference in New Issue
Block a user