Skip to content

Commit

Permalink
Update Gradle and Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dnl50 committed Sep 22, 2024
1 parent 098bdcf commit da5081d
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 17 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: '21'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -35,9 +35,9 @@ jobs:

- name: Build and Push Native Image
env:
QUARKUS_CONTAINER_IMAGE_BUILD: true
QUARKUS_CONTAINER_IMAGE_PUSH: true
QUARKUS_PACKAGE_TYPE: native
QUARKUS_PACKAGE_JAR_ENABLED: false
QUARKUS_NATIVE_ENABLED: true
QUARKUS_NATIVE_COMPRESSION_LEVEL: 9
run: ./gradlew clean build

Expand Down Expand Up @@ -69,8 +69,9 @@ jobs:

- name: Build and Push JVM Images
env:
QUARKUS_CONTAINER_IMAGE_BUILD: true
QUARKUS_CONTAINER_IMAGE_PUSH: true
QUARKUS_PACKAGE_JAR_ENABLED: true
QUARKUS_NATIVE_ENABLED: false
QUARKUS_PACKAGE_JAR_TYPE: mutable-jar
QUARKUS_DOCKER_BUILDX_PLATFORM: linux/amd64,linux/arm64
run: ./gradlew clean build -PimageTagSuffix=jvm
Expand Down
16 changes: 14 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,26 @@ spotless {

quarkus {
set("native.container-build", "true")
set("container-image.build", "true")
set("container-image.group", "dnl50")
set("container-image.name", "tsa-server")
set("container-image.tag", objects.property<String>().value(provider {
set("container-image.tag", provider {
if (project.hasProperty("imageTagSuffix")) {
"${project.version}-${project.property("imageTagSuffix")}"
} else {
project.version.toString()
}
}))
})
finalName.set("tsa-${project.version}")
}

tasks.check {
dependsOn(tasks.testNative)
}

// for some reason quarkus does recognize that the JDBC URL is set in the prod profile. therefore it
// creates a h2 db in server mode (using the H2DevServicesProcessor) which runs on the host machine and sets the JDBC URL
// to something like "jdbc:h2:tcp://localhost:53233/mem:test" which obviously does not work inside the docker container
tasks.testNative {
systemProperty("quarkus.datasource.jdbc.url", "jdbc:h2:file:/work/data/tsa")
}
2 changes: 1 addition & 1 deletion app/src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on Quarkus' Dockerfile.jvm template for Gradle
FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.19
FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.20

ENV LANGUAGE='en_US:en'

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
WORKDIR /work/
RUN chown 1001 /work \
&& mkdir /work/data \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private TimeStampResponseData signRequestViaHttpEndpoint() throws Exception {
.extract()
.as(new TypeRef<Page<TimeStampResponseData>>() {})
.content()
.get(0);
.getFirst();
}

}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
10 changes: 5 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ include("web")
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("quarkus", "3.11.0")
version("mapstruct", "1.5.5.Final")
version("quarkus", "3.15.0")
version("mapstruct", "1.6.2")

plugin("quarkus", "io.quarkus").versionRef("quarkus")
plugin("lombok", "io.freefair.lombok").version("8.6")
plugin("lombok", "io.freefair.lombok").version("8.10")
plugin("spotless", "com.diffplug.spotless").version("6.25.0")

library("quarkus-bom", "io.quarkus", "quarkus-bom").versionRef("quarkus")
library("bouncycastle", "org.bouncycastle:bcpkix-jdk18on:1.78.1")
library("bouncycastle", "org.bouncycastle", "bcpkix-jdk18on").version("1.78.1")
library("mapstruct-processor", "org.mapstruct", "mapstruct-processor").versionRef("mapstruct")
library("mapstruct-runtime", "org.mapstruct", "mapstruct").versionRef("mapstruct")
}

create("testLibs") {
library("assertj", "org.assertj:assertj-core:3.26.0")
library("assertj", "org.assertj:assertj-core:3.26.3")
library("archunit", "com.tngtech.archunit:archunit:1.3.0")
}
}
Expand Down

0 comments on commit da5081d

Please sign in to comment.