Skip to content

Commit fc64d55

Browse files
authored
Infra: Migrate build system from maven to gradle (#884)
2 parents d91483b + d49627b commit fc64d55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1177
-347
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"features": {
77
"ghcr.io/devcontainers/features/java:1": {
88
"version": "none",
9-
"installMaven": "true",
10-
"installGradle": "false"
9+
"installMaven": "false",
10+
"installGradle": "true"
1111
},
1212
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
1313
},

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33

44
# BACKEND
5-
/pom.xml @kafbat/backend
5+
/build.gradle @kafbat/backend
6+
/gradle.properties @kafbat/backend
7+
/settings.gradle @kafbat/backend
8+
/gradle/ @kafbat/backend
69
/contract/ @kafbat/backend
710
/api/ @kafbat/backend
811
/serde-api/ @kafbat/backend

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33

4-
- package-ecosystem: maven
4+
- package-ecosystem: gradle
55
directory: "/"
66
schedule:
77
interval: weekly

.github/workflows/aws_ami_publish.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/workflows/backend_main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ on:
44
push:
55
branches: [ "main" ]
66
paths:
7-
- "pom.xml"
7+
- "build.gradle"
8+
- "gradle.properties"
9+
- "settings.gradle"
10+
- "gradle/libs.versions.toml"
11+
812
- "contract/**"
913
- "api/**"
1014
- "serde-api/**"

.github/workflows/backend_pr.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ on:
55
pull_request_target:
66
types: [ "opened", "reopened", "synchronize" ]
77
paths:
8-
- "pom.xml"
8+
- "build.gradle"
9+
- "gradle.properties"
10+
- "settings.gradle"
11+
- "gradle/libs.versions.toml"
12+
913
- "contract/**"
1014
- "api/**"
1115
- "serde-api/**"
Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Backend: build and test"
1+
name: "Backend: tests & sonar"
22

33
on:
44
workflow_call:
@@ -30,40 +30,12 @@ jobs:
3030
with:
3131
java-version: '21'
3232
distribution: 'zulu'
33-
cache: 'maven'
33+
cache: 'gradle'
3434

35-
- name: Cache SonarCloud packages
36-
uses: actions/cache@v4
37-
with:
38-
path: ~/.sonar/cache
39-
key: ${{ runner.os }}-sonar
40-
restore-keys: ${{ runner.os }}-sonar
41-
42-
- name: "Pull request: Maven tests & sonar"
43-
if: ${{ inputs.event_name == 'pull_request' || inputs.event_name == 'pull_request_target' }}
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}
47-
HEAD_REF: ${{ github.head_ref }}
48-
BASE_REF: ${{ github.base_ref }}
49-
SKIP_SONAR: "true" # TODO remove when public
35+
- name: "Tests"
5036
run: |
51-
./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
52-
./mvnw -B -V -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
53-
-Dsonar.skip=${SKIP_SONAR} \
54-
-Dsonar.projectKey=io.kafbat:kafbat-ui_backend \
55-
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
56-
-Dsonar.pullrequest.branch=$HEAD_REF \
57-
-Dsonar.pullrequest.base=$BASE_REF
37+
./gradlew :api:test --info
5838
59-
- name: "Main: Maven tests & sonar"
60-
if: ${{ inputs.event_name == 'push' }}
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}
64-
SKIP_SONAR: "true" # TODO remove when public
39+
- name: "Sonar"
6540
run: |
66-
./mvnw -B -ntp versions:set -DnewVersion=$GITHUB_SHA
67-
./mvnw -B -V -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
68-
-Dsonar.skip=${SKIP_SONAR} \
69-
-Dsonar.projectKey=io.kafbat:kafbat-ui_backend
41+
./gradlew sonar --info

.github/workflows/block_merge.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ jobs:
1010
with:
1111
mode: exactly
1212
count: 0
13-
labels: "status/blocked, status/needs-attention, status/on-hold, status/pending, status/triage, status/pending-backend, status/pending-frontend, status/pending-QA"
13+
labels: >
14+
status/blocked,
15+
status/needs-attention,
16+
status/on-hold,
17+
status/pending,
18+
status/triage,
19+
status/pending-backend,
20+
status/pending-frontend,
21+
status/pending-QA

.github/workflows/branch-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
java-version: '21'
3333
distribution: 'zulu'
34-
cache: 'maven'
34+
cache: 'gradle'
3535
- name: Build
3636
id: build
3737
run: |
@@ -69,7 +69,7 @@ jobs:
6969
push: true
7070
tags: 297478128798.dkr.ecr.eu-central-1.amazonaws.com/kafka-ui:${{ steps.extract_branch.outputs.tag }}
7171
build-args: |
72-
JAR_FILE=api-${{ steps.build.outputs.version }}.jar
72+
JAR_FILE=build/libs/api-${{ steps.build.outputs.version }}.jar
7373
cache-from: type=local,src=/tmp/.buildx-cache
7474
cache-to: type=local,dest=/tmp/.buildx-cache
7575
outputs:

.github/workflows/build-public-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
java-version: '21'
3131
distribution: 'zulu'
32-
cache: 'maven'
32+
cache: 'gradle'
3333
- name: Build
3434
id: build
3535
run: |
@@ -68,7 +68,7 @@ jobs:
6868
push: true
6969
tags: ${{ vars.ECR_REGISTRY }}/${{ github.repository }}:${{ steps.extract_branch.outputs.tag }}
7070
build-args: |
71-
JAR_FILE=api-${{ steps.build.outputs.version }}.jar
71+
JAR_FILE=build/libs/api-${{ steps.build.outputs.version }}.jar
7272
cache-from: type=local,src=/tmp/.buildx-cache
7373
cache-to: type=local,dest=/tmp/.buildx-cache
7474
- name: make comment with private deployment link

0 commit comments

Comments
 (0)