Skip to content

Commit

Permalink
Upgrade Keycloak to 25.0.1, usage of keycloak-cli-custom.sh is tempor…
Browse files Browse the repository at this point in the history
…ary disabled (in keycloak-setup.sh)
  • Loading branch information
Edwin Steiner committed Jun 28, 2024
1 parent c0654ec commit 9bacd3c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 5 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion config/src/main/resources/keycloak/bin/keycloak-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runKeycloakConfigCli
echo " "
echo "----------------- KEYCLOAK CLI ------------------"
echo " "
runKeycloakCli
# runKeycloakCli : temporary disabled because of error `Failed to create config file: /.keycloak/kcadm.config`

echo " "
echo "--------------- KEYCLOAK SETUP FINISHED ----------------"
Expand Down
8 changes: 8 additions & 0 deletions container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.2</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions container/src/test/java/utils/KeycloakCustomContainer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package utils;

import dasniko.testcontainers.keycloak.ExtendableKeycloakContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.containers.wait.strategy.WaitStrategy;

Expand All @@ -13,6 +16,8 @@ public class KeycloakCustomContainer extends ExtendableKeycloakContainer<Keycloa
private static final String DEFAULT_WAIT_LOG_REGEX = ".*KEYCLOAK SETUP FINISHED.*";
private static final long DEFAULT_STARTUP_TIMEOUT = 3;

private static final Logger LOGGER = LoggerFactory.getLogger(KeycloakCustomContainer.class);

public KeycloakCustomContainer(String dockerImageName, WaitStrategy waitStrategy, long startupTimeout) {
super(dockerImageName);
this.waitStrategy = waitStrategy;
Expand All @@ -26,10 +31,14 @@ public KeycloakCustomContainer(String dockerImageName){
.withRegEx(DEFAULT_WAIT_LOG_REGEX)
.withTimes(1)
.withStartupTimeout(Duration.ofMinutes(this.startupTimeout));
this.withLogConsumer(new Slf4jLogConsumer(LOGGER));
}

@Override
protected void configure() {
super.configure();
setWaitStrategy(this.waitStrategy);
}


}
2 changes: 1 addition & 1 deletion docker-compose/postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=postgres
volumes:
- ./volume/pgdata/:/var/lib/postgresql/data/pgdata
- ./volume/16/pgdata/:/var/lib/postgresql/data/pgdata
networks:
- postgres

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.release>21</maven.compiler.release>
<keycloak.dir>./target/keycloak</keycloak.dir>
<keycloak.target.dir>../server/${keycloak.dir}/</keycloak.target.dir> <!-- used in config & extension modules -->
<keycloak.providers.dir>../../server/${keycloak.dir}/providers</keycloak.providers.dir> <!-- used in extension modules -->
Expand All @@ -32,8 +32,8 @@
<docker.verbose>true</docker.verbose>
<docker.imagePropertyConfiguration>override</docker.imagePropertyConfiguration>
<!-- versions -->
<keycloak.version>24.0.4</keycloak.version> <!-- update also keycloak-config-cli.version -->
<keycloak-config-cli.version>24.0.1</keycloak-config-cli.version> <!-- from https://github.com/adorsys/keycloak-config-cli/releases -->
<keycloak.version>25.0.1</keycloak.version> <!-- update also keycloak-config-cli.version -->
<keycloak-config-cli.version>25.0.1</keycloak-config-cli.version> <!-- from https://github.com/adorsys/keycloak-config-cli/releases -->
<auto-service.version>1.0.1</auto-service.version>
<testcontainers-keycloak.version>3.1.0</testcontainers-keycloak.version>
<testcontainers-postgres.version>1.19.3</testcontainers-postgres.version>
Expand Down

0 comments on commit 9bacd3c

Please sign in to comment.