Skip to content

Commit

Permalink
Made ready for gradle 9
Browse files Browse the repository at this point in the history
  • Loading branch information
MikAoJk committed Sep 18, 2023
1 parent 4a4f2ca commit 70a5707
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push

permissions:
actions: read
contents: read
contents: write
security-events: write
packages: write
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM gcr.io/distroless/java17-debian11@sha256:5cc4322dea54a6732cd2d3feebb18138f62af280a167afcbe94d3be7a607f1e5
WORKDIR /app
COPY build/libs/*-all.jar app.jar
COPY build/libs/app-*.jar app.jar
ENV JAVA_OPTS="-Dlogback.configurationFile=logback.xml"
ENV TZ="Europe/Oslo"
EXPOSE 8080
Expand Down
52 changes: 26 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "no.nav.syfo"
version = "1.0.0"

val coroutinesVersion = "1.7.3"
val jacksonVersion = "2.15.2"
val kluentVersion = "1.73"
val logbackVersion = "1.4.11"
val ktorVersion = "2.3.3"
val ktorVersion = "2.3.4"
val logstashEncoderVersion = "7.4"
val prometheusVersion = "0.16.0"
val smCommonVersion = "1.0.1"
val smCommonVersion = "1.0.19"
val mockkVersion = "1.13.7"
val nimbusdsVersion = "9.31"
val hikariVersion = "5.0.1"
Expand All @@ -27,16 +23,17 @@ val googlePostgresVersion = "1.13.1"
val googleOauthVersion = "1.34.1"
val ktfmtVersion = "0.44"

tasks.withType<Jar> {
manifest.attributes["Main-Class"] = "no.nav.syfo.BootstrapKt"
}

plugins {
id("com.diffplug.spotless") version "6.20.0"
kotlin("jvm") version "1.9.0"
id("application")
id("com.diffplug.spotless") version "6.21.0"
kotlin("jvm") version "1.9.10"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.hidetake.swagger.generator") version "2.19.2" apply true
id("org.cyclonedx.bom") version "1.7.4"
}

application {
mainClass.set("no.nav.syfo.BootstrapKt")
}

val githubUser: String by project
Expand Down Expand Up @@ -105,6 +102,7 @@ repositories {
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

swaggerSources {
Expand All @@ -114,27 +112,29 @@ repositories {
}

tasks {
withType<Jar> {
manifest.attributes["Main-Class"] = "no.nav.syfo.BootstrapKt"
}
create("printVersion") {
println(project.version)
}

withType<org.hidetake.gradle.swagger.generator.GenerateSwaggerUI> {
outputDir = File(buildDir.path + "/resources/main/api")
generateSwaggerUI {
val output: Provider<Directory> = layout.buildDirectory.dir("/resources/main/api")
outputDir = output.get().asFile
dependsOn("jar")
}

withType<ShadowJar> {
transform(ServiceFileTransformer::class.java) {
setPath("META-INF/cxf")
include("bus-extensions.txt")
shadowJar {
archiveBaseName.set("app")
archiveClassifier.set("")
isZip64 = true
manifest {
attributes(
mapOf(
"Main-Class" to "no.nav.syfo.BootstrapKt",
),
)
}
dependsOn("generateSwaggerUI")
}

withType<Test> {


test {
useJUnitPlatform {
}
testLogging {
Expand Down
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.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion naiserator-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ spec:
path: /internal/prometheus
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 50m
Expand Down
1 change: 0 additions & 1 deletion naiserator-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ spec:
path: /internal/prometheus
resources:
limits:
cpu: 700m
memory: 1Gi
requests:
cpu: 50m
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/syfo/Bootstrap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fun getWellKnownTokenX(httpClient: HttpClient, wellKnownUrl: String) = runBlocki

fun <T> createKafkaProducer(env: Environment): KafkaProducer<String, T> =
KafkaProducer(
KafkaUtils.getAivenKafkaConfig()
KafkaUtils.getAivenKafkaConfig("syfo-narmesteleder-producer")
.toProducerConfig(
"${env.applicationName}-producer",
JacksonKafkaSerializer::class,
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/no/nav/syfo/util/TestData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ fun createArbeidsgiverSykmelding(
harRedusertArbeidsgiverperiode = false,
merknader = null,
utenlandskSykmelding = land?.let { UtenlandskSykmeldingAGDTO(it) },
signaturDato = null
)

fun createSykmeldingsperiode(
Expand Down

0 comments on commit 70a5707

Please sign in to comment.