Skip to content

Commit

Permalink
chore(build): build docker image via gradle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeqo committed Mar 14, 2024
1 parent c848484 commit 9518525
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main_push_and_pull_request_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:

- name: Run integration tests
run: make integration_test

e2e_test:
strategy:
matrix:
Expand All @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ integration_test: build

E2E_TEST=LocalSystem

e2e_test: build
e2e_test:
./gradlew e2e:test --tests $(E2E_TEST)*

.PHONY: docker_image
Expand Down
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 9518525

Please sign in to comment.