Skip to content

Commit 8b7d8b0

Browse files
committed
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.
1 parent c848484 commit 8b7d8b0

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

.github/workflows/main_push_and_pull_request_workflow.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131

3232
- name: Run integration tests
3333
run: make integration_test
34+
3435
e2e_test:
3536
strategy:
3637
matrix:
@@ -43,12 +44,12 @@ jobs:
4344
uses: actions/checkout@v4
4445
with:
4546
fetch-depth: 0
46-
47-
- name: Build Docker image
48-
run: make docker_image
47+
- name: Set up JDK ${{ matrix.java-version }}
48+
uses: actions/setup-java@v4
49+
with:
50+
java-version: ${{ matrix.java-version }}
51+
distribution: temurin
4952

5053
- name: Run E2E tests
5154
timeout-minutes: 30
5255
run: make E2E_TEST=${{ matrix.test }} e2e_test
53-
54-
# TODO: publish docker image

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ integration_test: build
5050

5151
E2E_TEST=LocalSystem
5252

53-
e2e_test: build
53+
e2e_test:
5454
./gradlew e2e:test --tests $(E2E_TEST)*
5555

5656
.PHONY: docker_image

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
id 'info.solidsoft.pitest' version '1.15.0' apply false
2525
id "java-library"
2626
id "distribution"
27+
id "com.palantir.docker" version "0.36.0"
2728
}
2829

2930
apply plugin: 'info.solidsoft.pitest.aggregator'
@@ -285,6 +286,29 @@ tasks.register('validateDependencies') {
285286
}
286287
}
287288

289+
dockerPrepare.dependsOn(
290+
tasks.distTar,
291+
project("core").tasks.distTar,
292+
project("storage:s3").tasks.distTar,
293+
project("storage:gcs").tasks.distTar,
294+
project("storage:azure").tasks.distTar,
295+
)
296+
297+
docker {
298+
name 'aivenoy/kafka-with-ts-plugin'
299+
dockerfile file('docker/Dockerfile')
300+
buildx true
301+
buildArgs([_VERSION: project.version.toString()])
302+
copySpec.from(".")
303+
.include("build/distributions/*.tgz", "storage/**/distributions/*.tgz", "docker/*.yml")
304+
.into(".")
305+
.includeEmptyDirs(false)
306+
}
307+
308+
project("e2e").tasks.named("test") {
309+
dependsOn(rootProject.tasks.named("docker"))
310+
}
311+
288312
// TODO fix GCP dependency issues
289313
//tasks.named("check") {
290314
// dependsOn(tasks.named("validateDependencies"))

0 commit comments

Comments
 (0)