Add SIGNAL_SERVER_CONFIG override to LocalWhisperServerService
This commit is contained in:
parent
e59a1e9efd
commit
7286e724dc
|
@ -6,6 +6,7 @@
|
|||
package org.whispersystems.textsecuregcm;
|
||||
|
||||
import io.dropwizard.util.Resources;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* This class may be run directly from a correctly configured IDE, or using the command line:
|
||||
|
@ -13,9 +14,14 @@ import io.dropwizard.util.Resources;
|
|||
* <code>./mvnw clean integration-test -DskipTests=true -Ptest-server</code>
|
||||
* <p>
|
||||
* <strong>NOTE: many features are non-functional, especially those that depend on external services</strong>
|
||||
* <p>
|
||||
* By default, it will use {@code config/test.yml}, but this may be overridden by setting an environment variable,
|
||||
* {@value SIGNAL_SERVER_CONFIG_ENV_VAR}, with a custom path.
|
||||
*/
|
||||
public class LocalWhisperServerService {
|
||||
|
||||
private static final String SIGNAL_SERVER_CONFIG_ENV_VAR = "SIGNAL_SERVER_CONFIG";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
System.setProperty("secrets.bundle.filename",
|
||||
|
@ -23,6 +29,9 @@ public class LocalWhisperServerService {
|
|||
System.setProperty("sqlite.dir", "service/target/lib");
|
||||
System.setProperty("aws.region", "local-test-region");
|
||||
|
||||
new WhisperServerService().run("server", Resources.getResource("config/test.yml").getPath());
|
||||
final String config = Optional.ofNullable(System.getenv(SIGNAL_SERVER_CONFIG_ENV_VAR))
|
||||
.orElse(Resources.getResource("config/test.yml").getPath());
|
||||
|
||||
new WhisperServerService().run("server", config);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue