Rewrite build config to kokuwa.io infrastructure
Some checks failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/manual/lint Pipeline failed
ci/woodpecker/manual/test/3 Pipeline failed
ci/woodpecker/manual/test/1 Pipeline failed
ci/woodpecker/manual/test/2 Pipeline failed
ci/woodpecker/manual/test/4 Pipeline failed
ci/woodpecker/manual/build Pipeline failed
Some checks failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/manual/lint Pipeline failed
ci/woodpecker/manual/test/3 Pipeline failed
ci/woodpecker/manual/test/1 Pipeline failed
ci/woodpecker/manual/test/2 Pipeline failed
ci/woodpecker/manual/test/4 Pipeline failed
ci/woodpecker/manual/build Pipeline failed
This commit is contained in:
parent
61e7955732
commit
5a2b56dc39
17 changed files with 312 additions and 400 deletions
|
@ -50,28 +50,29 @@ public class KeycloakExtension implements BeforeAllCallback, ParameterResolver {
|
|||
var jar = properties.getProperty("jar");
|
||||
var timeout = properties.getProperty("timeout");
|
||||
|
||||
// create and start container
|
||||
// create and start container - use fixed port in ci
|
||||
|
||||
@SuppressWarnings({ "resource", "deprecation" })
|
||||
var container = (System.getenv("CI") == null
|
||||
? new GenericContainer<>(image).withExposedPorts(8080)
|
||||
: new FixedHostPortGenericContainer<>(image).withFixedExposedPort(8080, 8080))
|
||||
.withEnv("KEYCLOAK_ADMIN", "admin")
|
||||
.withEnv("KEYCLOAK_ADMIN_PASSWORD", "password")
|
||||
.withEnv("KC_LOG_LEVEL", "io.kokuwa:trace")
|
||||
// otherwise port 9000 will be used, with this config we can test different keycloak versions
|
||||
.withEnv("KC_LEGACY_OBSERVABILITY_INTERFACE", "true")
|
||||
.withEnv("KC_HEALTH_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_STATS_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_STATS_INTERVAL", "PT1s")
|
||||
.withCopyFileToContainer(MountableFile.forHostPath(jar), "/opt/keycloak/providers/metrics.jar")
|
||||
.withLogConsumer(out -> System.out.print(out.getUtf8String()))
|
||||
.withStartupTimeout(Duration.parse(timeout))
|
||||
.waitingFor(Wait.forHttp("/health").forPort(8080).withStartupTimeout(Duration.ofMinutes(10)))
|
||||
.withCommand("start-dev");
|
||||
: new FixedHostPortGenericContainer<>(image).withFixedExposedPort(8080, 8080));
|
||||
try {
|
||||
container.start();
|
||||
container
|
||||
.withEnv("KEYCLOAK_ADMIN", "admin")
|
||||
.withEnv("KEYCLOAK_ADMIN_PASSWORD", "password")
|
||||
.withEnv("KC_LOG_LEVEL", "io.kokuwa:trace")
|
||||
// otherwise port 9000 will be used, with this config we can test different keycloak versions
|
||||
.withEnv("KC_LEGACY_OBSERVABILITY_INTERFACE", "true")
|
||||
.withEnv("KC_HEALTH_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_STATS_ENABLED", "true")
|
||||
.withEnv("KC_METRICS_STATS_INTERVAL", "PT1s")
|
||||
.withCopyFileToContainer(MountableFile.forHostPath(jar), "/opt/keycloak/providers/metrics.jar")
|
||||
.withLogConsumer(out -> System.out.print(out.getUtf8String()))
|
||||
.withStartupTimeout(Duration.parse(timeout))
|
||||
.waitingFor(Wait.forHttp("/health").forPort(8080).withStartupTimeout(Duration.ofMinutes(10)))
|
||||
.withCommand("start-dev")
|
||||
.start();
|
||||
} catch (RuntimeException e) {
|
||||
throw new Exception("Failed to start keycloak", e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue