Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/repository-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ Integration tests require several environment variables.
```
AWS_REGION=us-west-2 amazon_s3_access_key=$AWS_ACCESS_KEY_ID amazon_s3_secret_key=$AWS_SECRET_ACCESS_KEY amazon_s3_base_path=path amazon_s3_bucket=dblock-opensearch ./gradlew :plugins:repository-s3:s3ThirdPartyTest
```
Optional environment variables:

- `amazon_s3_path_style_access`: Possible values true or false. Default is false.
- `amazon_s3_endpoint`: s3 custom endpoint url if aws s3 default endpoint is not being used.
11 changes: 11 additions & 0 deletions plugins/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ String s3PermanentSecretKey = System.getenv("amazon_s3_secret_key")
String s3PermanentBucket = System.getenv("amazon_s3_bucket")
String s3PermanentBasePath = System.getenv("amazon_s3_base_path")
String s3PermanentRegion = System.getenv("amazon_s3_region")
String s3Endpoint = System.getenv("amazon_s3_endpoint")
String s3PathStyleAccess = System.getenv("amazon_s3_path_style_access")


String s3TemporaryAccessKey = System.getenv("amazon_s3_access_key_temporary")
String s3TemporarySecretKey = System.getenv("amazon_s3_secret_key_temporary")
Expand Down Expand Up @@ -419,6 +422,14 @@ TaskProvider s3ThirdPartyTest = tasks.register("s3ThirdPartyTest", Test) {
if (useFixture) {
nonInputProperties.systemProperty 'test.s3.endpoint', "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000') }"
}
else {
if (s3Endpoint != null) {
systemProperty 'test.s3.endpoint', s3Endpoint
}
}
if (s3PathStyleAccess) {
systemProperty 'test.s3.path_style_access', s3PathStyleAccess
}
}
tasks.named("check").configure { dependsOn(s3ThirdPartyTest) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ protected void createRepository(String repoName) {
.put("region", System.getProperty("test.s3.region", "us-west-2"))
.put("base_path", System.getProperty("test.s3.base", "testpath"));
final String endpoint = System.getProperty("test.s3.endpoint");
final boolean pathStyleAccess = Boolean.parseBoolean(System.getProperty("test.s3.path_style_access"));
settings.put("path_style_access", pathStyleAccess);

if (endpoint != null) {
settings.put("endpoint", endpoint);
} else {
Expand Down
Loading