parent
99213ab042
commit
cc88fb2daa
22 changed files with 62 additions and 57 deletions
|
@ -1,6 +1,6 @@
|
|||
./
|
||||
keycloak-server-dist:keycloak
|
||||
keycloak-server-x-dist:keycloak.x-preview
|
||||
keycloak-server-dist:keycloak-legacy
|
||||
keycloak-quarkus-dist:keycloak
|
||||
keycloak-api-docs-dist:keycloak-api-docs
|
||||
|
||||
keycloak-jetty92-adapter-dist:keycloak-oidc-jetty92-adapter
|
||||
|
|
|
@ -77,18 +77,6 @@
|
|||
<module>server-legacy-dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>quarkus</id>
|
||||
<activation>
|
||||
<jdk>[11,)</jdk>
|
||||
<property>
|
||||
<name>!product</name>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>server-x-dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>distribution-downloads</id>
|
||||
<modules>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<artifactId>keycloak-server-dist</artifactId>
|
||||
|
||||
<name>Keycloak Server Galleon Based Distribution</name>
|
||||
<name>Keycloak Server Legacy WildFly Distribution</name>
|
||||
<description/>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
@ -301,7 +301,7 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>keycloak-${project.version}</finalName>
|
||||
<finalName>keycloak-legacy-${project.version}</finalName>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -1468,7 +1468,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-server-x-dist</artifactId>
|
||||
<artifactId>keycloak-quarkus-dist</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
|
|
1
quarkus/container/.gitignore
vendored
Normal file
1
quarkus/container/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.tar.gz
|
34
quarkus/container/Dockerfile
Normal file
34
quarkus/container/Dockerfile
Normal file
|
@ -0,0 +1,34 @@
|
|||
FROM registry.access.redhat.com/ubi8-minimal AS build-env
|
||||
|
||||
ENV KEYCLOAK_VERSION 17.0.0-SNAPSHOT
|
||||
ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
|
||||
|
||||
RUN microdnf install -y tar gzip
|
||||
|
||||
ADD $KEYCLOAK_DIST /tmp/keycloak/
|
||||
|
||||
# The next step makes it uniform for local development and upstream built.
|
||||
# If it is a local tar archive then it is unpacked, if from remote is just downloaded.
|
||||
RUN (cd /tmp/keycloak && \
|
||||
tar -xvf /tmp/keycloak/keycloak-*.tar.gz && \
|
||||
rm /tmp/keycloak/keycloak-*.tar.gz) || true
|
||||
|
||||
RUN mv /tmp/keycloak/keycloak-* /opt/keycloak
|
||||
|
||||
FROM registry.access.redhat.com/ubi8-minimal
|
||||
|
||||
COPY --from=build-env /opt/keycloak /opt/keycloak
|
||||
|
||||
RUN microdnf update -y && \
|
||||
microdnf install -y java-11-openjdk-headless && microdnf clean all && rm -rf /var/cache/yum/* && \
|
||||
echo "keycloak:x:0:root" >> /etc/group && \
|
||||
echo "keycloak:x:1000:0:keycloak user:/opt/keycloak:/sbin/nologin" >> /etc/passwd && \
|
||||
chown -R keycloak:root /opt/keycloak && \
|
||||
chmod -R g+rwX /opt/keycloak
|
||||
|
||||
USER 1000
|
||||
|
||||
EXPOSE 8080
|
||||
EXPOSE 8443
|
||||
|
||||
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
|
|
@ -19,14 +19,14 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>keycloak-distribution-parent</artifactId>
|
||||
<artifactId>keycloak-quarkus-parent</artifactId>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<version>17.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>keycloak-server-x-dist</artifactId>
|
||||
<artifactId>keycloak-quarkus-dist</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Keycloak.X Server Distribution</name>
|
||||
<name>Keycloak Quarkus Server Distribution</name>
|
||||
<description/>
|
||||
|
||||
<dependencies>
|
||||
|
@ -49,7 +49,7 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>keycloak.x-${project.version}</finalName>
|
||||
<finalName>keycloak-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
|
@ -154,6 +154,7 @@
|
|||
<module>runtime</module>
|
||||
<module>deployment</module>
|
||||
<module>server</module>
|
||||
<module>dist</module>
|
||||
<module>tests</module>
|
||||
</modules>
|
||||
|
||||
|
|
|
@ -57,6 +57,11 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-quarkus-dist</artifactId>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.keycloak.it.utils;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.keycloak.common.Version;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
|
@ -11,8 +10,6 @@ import org.testcontainers.images.builder.ImageFromDockerfile;
|
|||
import org.testcontainers.utility.ResourceReaper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
@ -30,9 +27,8 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution {
|
|||
private String stderr = "";
|
||||
private ToStringConsumer backupConsumer = new ToStringConsumer();
|
||||
|
||||
private File distributionFile = new File("../../../distribution/server-x-dist/target/keycloak.x-" + Version.VERSION_KEYCLOAK + ".tar.gz");
|
||||
private File cachedDockerfile = createDockerCacheFile();
|
||||
private boolean dockerfileFetched = false;
|
||||
private File distributionFile = new File("../../dist/target/keycloak-" + Version.VERSION_KEYCLOAK + ".tar.gz");
|
||||
private File dockerFile = new File("../../container/Dockerfile");
|
||||
|
||||
private GenericContainer<?> keycloakContainer = null;
|
||||
private String containerId = null;
|
||||
|
@ -44,37 +40,15 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution {
|
|||
this.manualStop = manualStop;
|
||||
}
|
||||
|
||||
private File createDockerCacheFile() {
|
||||
try {
|
||||
File tmp = File.createTempFile("Dockerfile", "keycloak.x");
|
||||
tmp.deleteOnExit();
|
||||
return tmp;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void fetchDockerfile() {
|
||||
if (!dockerfileFetched) {
|
||||
try {
|
||||
FileUtils.copyURLToFile(new URL("https://raw.githubusercontent.com/keycloak/keycloak-containers/main/server-x/Dockerfile"), cachedDockerfile);
|
||||
dockerfileFetched = true;
|
||||
} catch (Exception cause) {
|
||||
throw new RuntimeException("Cannot download upstream Dockerfile", cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private GenericContainer getKeycloakContainer() {
|
||||
if (!distributionFile.exists()) {
|
||||
throw new RuntimeException("Distribution archive " + distributionFile.getAbsolutePath() +" doesn't exists");
|
||||
}
|
||||
fetchDockerfile();
|
||||
return new GenericContainer(
|
||||
new ImageFromDockerfile("keycloak.x-under-test", false)
|
||||
.withFileFromFile("keycloakx.tar.gz", distributionFile)
|
||||
.withFileFromFile("Dockerfile", cachedDockerfile)
|
||||
.withBuildArg("KEYCLOAK_DIST", "keycloakx.tar.gz")
|
||||
new ImageFromDockerfile("keycloak-under-test", false)
|
||||
.withFileFromFile("keycloak.tar.gz", distributionFile)
|
||||
.withFileFromFile("Dockerfile", dockerFile)
|
||||
.withBuildArg("KEYCLOAK_DIST", "keycloak.tar.gz")
|
||||
)
|
||||
.withExposedPorts(8080)
|
||||
.withStartupAttempts(1)
|
||||
|
|
|
@ -251,7 +251,7 @@ public final class RawKeycloakDistribution implements KeycloakDistribution {
|
|||
try {
|
||||
Path distRootPath = Paths.get(System.getProperty("java.io.tmpdir")).resolve("kc-tests");
|
||||
distRootPath.toFile().mkdirs();
|
||||
File distFile = new File("../../../distribution/server-x-dist/target/keycloak.x-" + Version.VERSION_KEYCLOAK + ".zip");
|
||||
File distFile = new File("../../dist/target/keycloak-" + Version.VERSION_KEYCLOAK + ".zip");
|
||||
if (!distFile.exists()) {
|
||||
throw new RuntimeException("Distribution archive " + distFile.getAbsolutePath() +" doesn't exists");
|
||||
}
|
||||
|
|
|
@ -4,3 +4,5 @@ NEW_VERSION=$1
|
|||
|
||||
mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=*
|
||||
mvn versions:use-dep-version -Dincludes=org.keycloak:keycloak-admin-ui -DdepVersion=$NEW_VERSION -DforceVersion=true -pl org.keycloak:keycloak-parent
|
||||
|
||||
sed -i "s/ENV KEYCLOAK_VERSION .*/ENV KEYCLOAK_VERSION $NEW_VERSION/" quarkus/container/Dockerfile
|
|
@ -13,7 +13,7 @@
|
|||
<artifactId>integration-arquillian-servers-auth-server-quarkus</artifactId>
|
||||
|
||||
<properties>
|
||||
<auth.server.home>${project.build.directory}/unpacked/keycloak.x-${project.version}</auth.server.home>
|
||||
<auth.server.home>${project.build.directory}/unpacked/keycloak-${project.version}</auth.server.home>
|
||||
<common.resources>${basedir}/../jboss/common</common.resources>
|
||||
<session.cache.owners>2</session.cache.owners>
|
||||
<offline.session.cache.owners>2</offline.session.cache.owners>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-server-x-dist</artifactId>
|
||||
<artifactId>keycloak-quarkus-dist</artifactId>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -177,7 +177,7 @@
|
|||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-server-x-dist</artifactId>
|
||||
<artifactId>keycloak-quarkus-dist</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<outputDirectory>${project.build.directory}/unpacked</outputDirectory>
|
||||
|
|
Loading…
Reference in a new issue