mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Bump to ebean-test-docker 5.0-RC1
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import io.ebean.docker.commands.ElasticConfig;
|
||||
import io.ebean.docker.commands.ElasticContainer;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -19,27 +18,18 @@ class ElasticSearchSetup {
|
||||
}
|
||||
|
||||
void run() {
|
||||
ElasticConfig elasticConfig = readConfig();
|
||||
if (elasticConfig != null) {
|
||||
new ElasticContainer(elasticConfig).start();
|
||||
}
|
||||
}
|
||||
|
||||
ElasticConfig readConfig() {
|
||||
|
||||
String version = read("version", null);
|
||||
if (version == null) {
|
||||
// we need an explicit version to run
|
||||
return null;
|
||||
if (version != null) {
|
||||
Properties properties = populateDockerProperties(version);
|
||||
ElasticContainer.newBuilder(version)
|
||||
.properties(properties)
|
||||
.build()
|
||||
.start();
|
||||
}
|
||||
|
||||
return new ElasticConfig(version, populateDockerProperties(version));
|
||||
}
|
||||
|
||||
private Properties populateDockerProperties(String version) {
|
||||
|
||||
PropertiesBuilder properties = new PropertiesBuilder();
|
||||
|
||||
String mode = config.getProperty("ebean.test.shutdown");
|
||||
if (mode != null) {
|
||||
properties.set("shutdown", mode);
|
||||
@@ -63,7 +53,7 @@ class ElasticSearchSetup {
|
||||
|
||||
private static class PropertiesBuilder {
|
||||
|
||||
private Properties dockerProperties = new Properties();
|
||||
private final Properties dockerProperties = new Properties();
|
||||
|
||||
private void set(String key, String val) {
|
||||
dockerProperties.setProperty("elastic." + key, val);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import io.ebean.docker.commands.RedisConfig;
|
||||
import io.ebean.docker.commands.RedisContainer;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -16,9 +15,10 @@ class RedisSetup {
|
||||
String host = dockerHost.dockerHost(properties.getProperty("ebean.test.dockerHost"));
|
||||
properties.setProperty("redis.host", host);
|
||||
}
|
||||
RedisConfig redisConfig = new RedisConfig(version, properties);
|
||||
RedisContainer container = new RedisContainer(redisConfig);
|
||||
container.start();
|
||||
RedisContainer.newBuilder(version)
|
||||
.properties(properties)
|
||||
.build()
|
||||
.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user