From 9518525ec3cb6fa18a9e944fe98f3f1ed359e6c8 Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Thu, 14 Mar 2024 15:56:08 +0000 Subject: [PATCH] chore(build): build docker image via gradle To reduce friction on developers wanting to build the plugin, this PR adds docker plugin to gradle and define it as a dependency for e2e tests. --- .../main_push_and_pull_request_workflow.yml | 11 +++++----- Makefile | 2 +- build.gradle | 21 +++++++++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main_push_and_pull_request_workflow.yml b/.github/workflows/main_push_and_pull_request_workflow.yml index 9d22ad3b6..eb96e027e 100644 --- a/.github/workflows/main_push_and_pull_request_workflow.yml +++ b/.github/workflows/main_push_and_pull_request_workflow.yml @@ -31,6 +31,7 @@ jobs: - name: Run integration tests run: make integration_test + e2e_test: strategy: matrix: @@ -43,12 +44,12 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Build Docker image - run: make docker_image + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: temurin - name: Run E2E tests timeout-minutes: 30 run: make E2E_TEST=${{ matrix.test }} e2e_test - - # TODO: publish docker image diff --git a/Makefile b/Makefile index 3dcce492a..0bfe1d49c 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ integration_test: build E2E_TEST=LocalSystem -e2e_test: build +e2e_test: ./gradlew e2e:test --tests $(E2E_TEST)* .PHONY: docker_image diff --git a/build.gradle b/build.gradle index 11e3dbf4c..dc345f351 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ plugins { id 'info.solidsoft.pitest' version '1.15.0' apply false id "java-library" id "distribution" + id "com.palantir.docker" version "0.36.0" } apply plugin: 'info.solidsoft.pitest.aggregator' @@ -285,6 +286,26 @@ tasks.register('validateDependencies') { } } +dockerPrepare.dependsOn( + tasks.distTar, + project("core").tasks.distTar, + project("storage:s3").tasks.distTar, + project("storage:gcs").tasks.distTar, + project("storage:azure").tasks.distTar, +) + +docker { + name 'aivenoy/kafka-with-ts-plugin' + dockerfile file('docker/Dockerfile') + copySpec.from(".").into(".") + buildArgs([_VERSION: project.version.toString()]) + buildx true +} + +project("e2e").tasks.named("test") { + dependsOn(rootProject.tasks.named("docker")) +} + // TODO fix GCP dependency issues //tasks.named("check") { // dependsOn(tasks.named("validateDependencies"))