Skip to content

Commit

Permalink
Dynamically determine Docker image version
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Jan 16, 2025
1 parent f353ec1 commit e4ed210
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion streams-bootstrap-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ dependencies {
testImplementation(testFixtures(project(":streams-bootstrap-core")))
testImplementation(group = "com.ginsberg", name = "junit5-system-exit", version = "1.1.2")
val confluentVersion: String by project
testImplementation(group = "io.confluent", name = "kafka-streams-avro-serde", version = confluentVersion)
testImplementation(group = "io.confluent", name = "kafka-streams-avro-serde", version = confluentVersion) {
exclude(group = "org.apache.kafka", module = "kafka-clients")
}
val log4jVersion: String by project
testImplementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion)
}
12 changes: 9 additions & 3 deletions streams-bootstrap-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ dependencies {
api(group = "org.apache.kafka", name = "kafka-streams", version = kafkaVersion)
api(group = "org.apache.kafka", name = "kafka-clients", version = kafkaVersion)
val confluentVersion: String by project
implementation(group = "io.confluent", name = "kafka-schema-serializer", version = confluentVersion)
api(group = "io.confluent", name = "kafka-schema-registry-client", version = confluentVersion)
implementation(group = "io.confluent", name = "kafka-schema-serializer", version = confluentVersion) {
exclude(group = "org.apache.kafka", module = "kafka-clients")
}
api(group = "io.confluent", name = "kafka-schema-registry-client", version = confluentVersion) {
exclude(group = "org.apache.kafka", module = "kafka-clients")
}
implementation(
group = "org.slf4j",
name = "slf4j-api",
Expand All @@ -35,7 +39,9 @@ dependencies {
val testContainersVersion: String by project
testFixturesApi(group = "org.testcontainers", name = "junit-jupiter", version = testContainersVersion)
testFixturesApi(group = "org.testcontainers", name = "kafka", version = testContainersVersion)
testImplementation(group = "io.confluent", name = "kafka-streams-avro-serde", version = confluentVersion)
testImplementation(group = "io.confluent", name = "kafka-streams-avro-serde", version = confluentVersion) {
exclude(group = "org.apache.kafka", module = "kafka-clients")
}
val log4jVersion: String by project
testImplementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package com.bakdata.kafka;

import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient;
import org.apache.kafka.common.utils.AppInfoParser;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.kafka.KafkaContainer;
Expand All @@ -37,7 +38,8 @@ public abstract class KafkaTest {
private final KafkaContainer kafkaCluster = newCluster();

public static KafkaContainer newCluster() {
return new KafkaContainer(DockerImageName.parse("apache/kafka-native:3.8.1"));
return new KafkaContainer(DockerImageName.parse("apache/kafka-native")
.withTag(AppInfoParser.getVersion()));
}

protected KafkaEndpointConfig createEndpointWithoutSchemaRegistry() {
Expand Down

0 comments on commit e4ed210

Please sign in to comment.