Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to th2 gradle plugin 0.0.6 #82

Merged
merged 15 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ jobs:
versions:
name: Extract app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: app
changes:
name: Collect changed files
runs-on: ubuntu-20.04
outputs:
app: ${{ steps.filter.outputs.app }}
grpc: ${{ steps.filter.outputs.grpc }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref }}
filters: |
app:
- 'gradle.properties'
- 'app/gradle.properties'
grpc:
- 'grpc/gradle.properties'
utils:
Expand Down Expand Up @@ -78,6 +80,7 @@ jobs:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
multiproject: true
nvd-api-key: ${{ secrets.NVD_APIKEY }}
publish-docker:
name: Build and publish docker image
if: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-unwelcome-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Checkout tool
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: exactpro-th2/ci-github-action
ref: master
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
app-version:
name: Collect app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-dev-workflow.yml@main
with:
project-path: app
build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
uses: th2-net/.github/.github/workflows/compaund-java-multi-project-build.yml@main
Expand Down Expand Up @@ -57,6 +59,7 @@ jobs:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
multiproject: true
nvd-api-key: ${{ secrets.NVD_APIKEY }}
publish-docker:
name: Build docker image
needs:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/dev-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: Extract app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
with:
project-path: .
project-path: app
get-previous-tag:
name: Get previous tag
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 100
Expand All @@ -36,14 +36,14 @@ jobs:
app: ${{ steps.filter.outputs.app }}
grpc: ${{ steps.filter.outputs.grpc }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ needs.get-previous-tag.outputs.tag }}
filters: |
app:
- 'gradle.properties'
- 'app/gradle.properties'
grpc:
- 'grpc/gradle.properties'
utils:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- changes
if: ${{ needs.changes.outputs.grpc == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 'zulu' '11'
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
always() &&
(needs.changes.outputs.utils == 'true' || needs.changes.outputs.grpc == 'true')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 'zulu' '11'
uses: actions/setup-java@v3
with:
Expand All @@ -131,6 +131,7 @@ jobs:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
multiproject: true
nvd-api-key: ${{ secrets.NVD_APIKEY }}

publish-docker:
name: Build and publish docker image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 'zulu' '11'
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM adoptopenjdk/openjdk11:alpine
WORKDIR /home
COPY ./build/docker .
COPY ./app/build/docker .
ENTRYPOINT ["/home/service/bin/service"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ spec:

# Release notes:

## 2.9.0
+ Migrated to th2 gradle plugin `0.0.6`
+ Updated bom: `4.6.1-dev`
+ Updated cradle api: `5.3.0-dev`
+ Updated common: `5.11.0-dev`
+ Updated micrometer-bom: `1.12.5`
+ Updated jetty-bom: `11.0.20`

## 2.7.0

+ Updated cradle api: `5.2.0-dev`
Expand Down
79 changes: 79 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
plugins {
`java-library`
`maven-publish`

kotlin("kapt")
kotlin("plugin.serialization")
id("com.exactpro.th2.gradle.component")
}

val cradleApiVersion: String by rootProject.extra
val javalin: String by rootProject.extra
val commonVersion: String by rootProject.extra

dependencies {
implementation("com.exactpro.th2:common:${commonVersion}") {
exclude(group = "com.exactpro.th2", module = "cradle-core")
exclude(group = "com.exactpro.th2", module = "cradle-cassandra")
}

implementation(platform("org.eclipse.jetty:jetty-bom:11.0.20")) {
OptimumCode marked this conversation as resolved.
Show resolved Hide resolved
because("vulnerabilities in version 11.0.13. Can be removed after updating Javalin and Kotlin")
}

implementation("io.javalin:javalin:$javalin")
implementation("io.javalin:javalin-micrometer:$javalin")

implementation(platform("io.micrometer:micrometer-bom:1.12.5")) {
because("should match the version in javalin-micrometer")
}

implementation("io.micrometer:micrometer-registry-prometheus")
implementation("org.apache.commons:commons-lang3")

kapt("io.javalin.community.openapi:openapi-annotation-processor:$javalin")

implementation("io.javalin.community.openapi:javalin-openapi-plugin:$javalin") {
because("for /openapi route with JSON scheme")
}
// swagger-ui-3.52.5.jar (pkg:maven/org.webjars/[email protected]) : CVE-2018-25031
// implementation("io.javalin.community.openapi:javalin-swagger-plugin:$javalin") {
// because("for Swagger UI")
// }
implementation("io.javalin.community.openapi:javalin-redoc-plugin:$javalin") {
because("for Re Doc UI")
}

implementation("com.exactpro.th2:cradle-cassandra:$cradleApiVersion")
implementation("net.jpountz.lz4:lz4:1.3.0") {
because("cassandra driver requires lz4 impl in classpath for compression")
}
implementation(project(":grpc-lw-data-provider"))

implementation("io.prometheus:simpleclient") {
because("need add custom metrics to provider")
}

implementation("org.apache.commons:commons-lang3")

implementation("com.fasterxml.jackson.core:jackson-core")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.5.1")

implementation("io.netty:netty-buffer")

testImplementation("io.javalin:javalin-testtools:$javalin")

testImplementation(testFixtures("com.exactpro.th2:common:${commonVersion}"))
testImplementation(platform("org.testcontainers:testcontainers-bom:1.19.8"))
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:cassandra")

testImplementation("com.datastax.oss:java-driver-core")
}

application {
mainClass.set("com.exactpro.th2.lwdataprovider.MainKt")
}
6 changes: 6 additions & 0 deletions app/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kotlin.code.style=official
release_version=2.9.0

description='th2 Lightweight data provider component'
vcs_url=https://github.com/th2-net/th2-lw-data-provider
kapt.include.compile.classpath=false
Loading
Loading