Skip to content

Commit

Permalink
Migrate hardcoded images to Maven properties
Browse files Browse the repository at this point in the history
  • Loading branch information
gtroitsk committed Dec 21, 2023
1 parent a64ea18 commit 89de046
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class AbstractMysqlReusableInstance extends AbstractSqlDatabaseI
* property `ts.database.container.reusable` is enabled on test.properties
**/

@Container(image = "docker.io/mysql:8.0.30", port = 3306, expectedLog = "port: 3306 MySQL Community Server")
@Container(image = "${mysql.image}", port = 3306, expectedLog = "port: 3306 MySQL Community Server")
public static MySqlService database = new MySqlService();

static Integer containerPort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DevModeMySqlDatabaseIT extends AbstractSqlDatabaseIT {
static final String MYSQL_DATABASE = "mydb";
static final int MYSQL_PORT = 3306;

@Container(image = "docker.io/mysql:8.0", port = MYSQL_PORT, expectedLog = "ready for connections")
@Container(image = "${mysql.image}", port = MYSQL_PORT, expectedLog = "ready for connections")
static DefaultService database = new DefaultService()
.withProperty("MYSQL_ROOT_USER", MYSQL_USER)
.withProperty("MYSQL_ROOT_PASSWORD", MYSQL_PASSWORD)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.quarkus.qe.database.postgresql;

import static io.quarkus.qe.database.postgresql.PostgresqlDatabaseIT.POSTGRES_IMG;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

Expand All @@ -16,7 +14,7 @@ public class DuplicatedPostgresqlDatabaseIT {

private static final int POSTGRESQL_PORT = 5432;

@Container(image = POSTGRES_IMG, port = POSTGRESQL_PORT, expectedLog = "is ready")
@Container(image = "${postgresql.image}", port = POSTGRESQL_PORT, expectedLog = "is ready")
static PostgresqlService database = new PostgresqlService();

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ public class OpenShiftPostgresqlIT extends AbstractSqlDatabaseIT {

private static final int POSTGRESQL_PORT = 5432;

@Container(image = "quay.io/quarkusqeteam/postgres:14.0", port = POSTGRESQL_PORT, expectedLog = "is ready")
static PostgresqlService database = new PostgresqlService();
@Container(image = "${postgresql.image}", port = POSTGRESQL_PORT, expectedLog = "is ready")
static PostgresqlService database = new PostgresqlService()
.withProperty("PGDATA", "/tmp/psql");

@QuarkusApplication
static RestService app = new RestService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
public class PostgresqlDatabaseIT extends AbstractSqlDatabaseIT {

private static final int POSTGRESQL_PORT = 5432;
public static final String POSTGRES_IMG = "docker.io/postgres:13.8";

@Container(image = POSTGRES_IMG, port = POSTGRESQL_PORT, expectedLog = "is ready")
@Container(image = "${postgresql.image}", port = POSTGRESQL_PORT, expectedLog = "is ready")
static PostgresqlService database = new PostgresqlService();

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@QuarkusScenario
public class BasicInfinispanBookCacheIT extends BaseBookCacheIT {

@Container(image = "docker.io/infinispan/server:14.0", expectedLog = "Infinispan Server.*started in", port = 11222)
@Container(image = "${infinispan.image}", expectedLog = "Infinispan Server.*started in", port = 11222)
static final InfinispanService infinispan = new InfinispanService();

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@QuarkusScenario
public class LegacyUsingJksInfinispanBookCacheIT extends BaseBookCacheIT {

@Container(image = "docker.io/infinispan/server:13.0", expectedLog = "Infinispan Server.*started in", port = 11222)
@Container(image = "${infinispan-legacy.image}", expectedLog = "Infinispan Server.*started in", port = 11222)
static final InfinispanService infinispan = new InfinispanService()
.withConfigFile("/jks-config.yaml")
.withSecretFiles("/jks/server.jks");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@QuarkusScenario
public class UsingJksInfinispanBookCacheIT extends BaseBookCacheIT {

@Container(image = "docker.io/infinispan/server:14.0", expectedLog = "Infinispan Server.*started in", port = 11222)
@Container(image = "${infinispan.image}", expectedLog = "Infinispan Server.*started in", port = 11222)
static final InfinispanService infinispan = new InfinispanService()
.withConfigFile("infinispan.xml")
.withSecretFiles("/jks/keystore.jks");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import io.quarkus.test.bootstrap.KeycloakService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.KeycloakContainer;
import io.quarkus.test.services.QuarkusApplication;

@OpenShiftScenario
Expand All @@ -18,7 +18,7 @@ public class OpenShiftUsingCustomTemplateResourceIT {
private static final String CLIENT_ID_DEFAULT = "test-application-client";
private static final String CLIENT_SECRET_DEFAULT = "test-application-client-secret";

@Container(image = "quay.io/keycloak/keycloak:22.0.1", expectedLog = "started", port = 8080)
@KeycloakContainer(command = { "start-dev", "--import-realm" })
static final KeycloakService customkeycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM,
DEFAULT_REALM_BASE_PATH);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ items:
- name: latest
from:
kind: DockerImage
name: quay.io/keycloak/keycloak:22.0.1
# Hardcoded image is used only here, tests use one from KeycloakContainer
name: quay.io/keycloak/keycloak:23.0
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
Expand Down
1 change: 1 addition & 0 deletions misc/jaeger-for-tracing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ items:
app: 'jaeger'
spec:
containers:
# Image is used only in this configuration, no need in tracking the image in Maven properties
- image: 'quay.io/jaegertracing/all-in-one:1.41'
name: 'jaeger'
env:
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
<quarkus.build.skip>${skipTests}</quarkus.build.skip>
<!-- Oracle image - we aim to use same version as Dev Services for Oracle so that we only download one image -->
<oracle.image>docker.io/gvenzl/oracle-free:23-slim-faststart</oracle.image>
<postgresql.image>docker.io/postgres:16.1</postgresql.image>
<mysql.image>docker.io/mysql:8.2.0</mysql.image>
<infinispan.image>docker.io/infinispan/server:14.0</infinispan.image>
<infinispan-legacy.image>docker.io/infinispan/server:13.0</infinispan-legacy.image>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down Expand Up @@ -344,6 +348,10 @@
<configuration>
<systemProperties>
<oracle.image>${oracle.image}</oracle.image>
<postgresql.image>${postgresql.image}</postgresql.image>
<mysql.image>${mysql.image}</mysql.image>
<infinispan.image>${infinispan.image}</infinispan.image>
<infinispan-legacy.image>${infinispan-legacy.image}</infinispan-legacy.image>
</systemProperties>
<argLine>${jacoco.agent.argLine}</argLine>
<excludedGroups>${exclude.tests.with.tags}</excludedGroups>
Expand Down

0 comments on commit 89de046

Please sign in to comment.