diff --git a/api/Dockerfile b/api/Dockerfile index adaa64009..738981ae2 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -17,7 +17,7 @@ RUN chown kafkaui /etc/kafkaui USER kafkaui ARG JAR_FILE -COPY "/target/${JAR_FILE}" "/api.jar" +COPY $JAR_FILE "/api.jar" ENV JAVA_OPTS= diff --git a/api/build.gradle b/api/build.gradle index 6f3f67f46..69d15087f 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -4,9 +4,11 @@ plugins { id 'checkstyle' alias(libs.plugins.spring.boot) alias(libs.plugins.git.properties) - alias(libs.plugins.jib) + alias(libs.plugins.docker.remote.api) } +import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage + dependencies { implementation project(":contract") if (prod) { @@ -105,7 +107,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion '10.3.1' + toolVersion = libs.versions.checkstyle.get() configFile = rootProject.file('etc/checkstyle/checkstyle.xml') ignoreFailures = false maxWarnings = 0 @@ -116,15 +118,13 @@ test { useJUnitPlatform() } -jib { - from { - image = 'azul/zulu-openjdk-alpine:21.0.5-jre-headless' - } - to { - image = 'ghcr.io/kafbat/kafka-ui' - } - container { - user = "kafkaui" - jvmFlags = ['--add-opens java.rmi/javax.rmi.ssl=ALL-UNNAMED'] - } +tasks.register('buildDockerImage', DockerBuildImage) { + inputDir = projectDir + dockerFile = project.layout.projectDirectory.file('Dockerfile') + buildArgs = [ + 'JAR_FILE': "build/libs/${project.name}-${project.version}.jar" + ] + images.add("ghcr.io/kafbat/kafka-ui:${project.version}") } + +tasks.build.finalizedBy buildDockerImage diff --git a/api/pom.xml b/api/pom.xml index d5000ff49..14a15c1df 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -509,7 +509,7 @@ ${project.basedir} - ${project.build.finalName}.jar + target/${project.build.finalName}.jar diff --git a/e2e-tests/build.gradle b/e2e-tests/build.gradle index 739368097..fca666524 100644 --- a/e2e-tests/build.gradle +++ b/e2e-tests/build.gradle @@ -4,24 +4,18 @@ plugins { alias(libs.plugins.allure) } -ext { - kafkaVersion = "3.8.0" - aspectjVersion = "1.9.21" - allureVersion = "2.27.0" -} - dependencies { implementation project(":contract") - implementation "org.apache.kafka:kafka_2.13:${kafkaVersion}" - implementation "org.aspectj:aspectjweaver:${aspectjVersion}" - implementation "commons-io:commons-io:2.16.1" - implementation "org.testng:testng:7.10.0" - implementation "com.codeborne:selenide:7.2.3" - implementation "io.qameta.allure:allure-testng:${allureVersion}" - implementation "io.qameta.allure:allure-selenide:${allureVersion}" - implementation "io.github.bonigarcia:webdrivermanager:5.8.0" + implementation libs.apache.kafka + implementation libs.apache.commons.io + implementation libs.aspectj + implementation libs.testng + implementation libs.codeborne.selenide + implementation libs.allure.testng + implementation libs.allure.selenide + implementation libs.bonigarcia.webdrivermanager implementation libs.spring.starter.webflux - implementation "io.netty:netty-resolver-dns-native-macos:4.1.116.Final" + implementation libs.netty.resolver.dns.native implementation libs.lombok @@ -30,7 +24,7 @@ dependencies { } checkstyle { - toolVersion '10.3.1' + toolVersion = libs.versions.checkstyle.get() configFile = rootProject.file('etc/checkstyle/checkstyle-e2e.xml') ignoreFailures = false maxWarnings = 10 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index be9400280..edcd17a56 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,7 @@ aws-msk-auth = '2.2.0' azure-identity = '1.14.2' apache-commons = '2.12.0' +apache-commons-io = '2.16.1' apache-datasketches = '3.1.0' apache-commons-compress = '1.26.0' @@ -37,6 +38,14 @@ project-reactor = '3.6.12' micrometer = '1.13.8' antlr = '4.12.0' json-schema-validator = '2.2.14' +checkstyle = '10.3.1' +allure = '2.27.0' +codeborne-selenide = '7.2.3' +testng = '7.10.0' +bonigarcia-webdrivermanager = '5.8.0' +aspectj = '1.9.21' +kafka = '3.8.0' +netty-resolver-dns-native = '4.1.116.Final' [plugins] spring-boot = { id = 'org.springframework.boot', version = '3.4.1' } @@ -46,6 +55,8 @@ allure = { id = 'io.qameta.allure', version='2.10.0' } nexus-publish-plugin = { id = 'io.github.gradle-nexus.publish-plugin', version = '1.1.0'} node-gradle = { id = 'com.github.node-gradle.node', version = '7.0.2'} jib = { id = 'com.google.cloud.tools.jib', version = '3.4.4' } +docker-remote-api = { id = 'com.bmuschko.docker-remote-api', version = '9.4.0'} + @@ -74,9 +85,11 @@ kafka-clients = { module = 'org.apache.kafka:kafka-clients', version.ref = 'kafk apache-commons = { module = 'org.apache.commons:commons-lang3', version.ref = 'apache-commons'} apache-commons-compress = { module = 'org.apache.commons:commons-compress', version.ref = 'apache-commons-compress'} +apache-commons-io = { module = 'commons-io:commons-io', version.ref = 'apache-commons-io'} apache-commons-pool2 = { module = 'org.apache.commons:commons-pool2', version.ref = 'apache-commons'} apache-datasketches = { module = 'org.apache.datasketches:datasketches-java', version.ref='apache-datasketches'} apache-avro = { module = 'org.apache.avro:avro', version.ref = 'avro'} +apache-kafka = { module = 'org.apache.kafka:kafka_2.13', version.ref = 'kafka'} confluent-schema-registry-client = { module = 'io.confluent:kafka-schema-registry-client', version.ref = 'confluent'} confluent-avro-serializer = { module = 'io.confluent:kafka-avro-serializer', version.ref = 'confluent'} @@ -111,3 +124,13 @@ opendatadiscovery-client = { module = 'org.opendatadiscovery:ingestion-contract- bytebuddy = {module = 'net.bytebuddy:byte-buddy', version.ref='byte-buddy'} assertj = {module = 'org.assertj:assertj-core', version.ref = 'assertj'} jsonschemavalidator = {module = 'com.github.java-json-tools:json-schema-validator', version.ref ='json-schema-validator'} + +allure-testng = { module = 'io.qameta.allure:allure-testng', version.ref = 'allure' } +allure-selenide = { module = 'io.qameta.allure:allure-selenide', version.ref = 'allure' } + +codeborne-selenide = { module = 'com.codeborne:selenide', version.ref = 'codeborne-selenide'} +testng = { module = 'org.testng:testng', version.ref = 'testng'} +aspectj = { module = 'org.aspectj:aspectjweaver', version.ref = 'aspectj'} +bonigarcia-webdrivermanager = { module = 'io.github.bonigarcia:webdrivermanager', version.ref = 'bonigarcia-webdrivermanager'} +netty-resolver-dns-native = { module = 'io.netty:netty-resolver-dns-native-macos', version.ref = 'netty-resolver-dns-native'} +