Skip to content

Commit

Permalink
Upgrade deps etc (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersrognstad authored Sep 16, 2024
1 parent 330712e commit 5947e7f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 60 deletions.
37 changes: 0 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,6 @@ $ docker-compose up

* Run the `main()` function in `SyfooversiktApplication.kt`

## Download packages from Github Package Registry

Certain packages (isdialogmote-schema) must be downloaded from Github Package Registry, which requires
authentication. The packages can be downloaded via build.gradle:

```
val githubUser: String by project
val githubPassword: String by project
repositories {
maven {
url = uri("https://maven.pkg.github.com/navikt/isdialogmote-schema")
credentials {
username = githubUser
password = githubPassword
}
}
}
```

`githubUser` and `githubPassword` are properties that are set in `~/.gradle/gradle.properties`:

```
githubUser=x-access-token
githubPassword=<token>
```

Where `<token>` is a personal access token with scope `read:packages`(and SSO enabled).

The variables can alternatively be configured as environment variables or used in the command lines:

* `ORG_GRADLE_PROJECT_githubUser`
* `ORG_GRADLE_PROJECT_githubPassword`

```
./gradlew -PgithubUser=x-access-token -PgithubPassword=[token]
```

### Connect to the db from terminal:

To connect and run queries directly against the db run:
Expand Down
36 changes: 14 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,48 +1,40 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "no.nav.syfo"
version = "1.0-SNAPSHOT"

val confluent = "7.6.1"
val confluent = "7.7.1"
val flyway = "9.22.3"
val hikari = "5.1.0"
val isdialogmoteSchema = "1.0.5"
val jacksonDataType = "2.17.2"
val jedis = "5.1.3"
val jedis = "5.1.5"
val json = "20240303"
val kafka = "3.7.0"
val kluent = "1.73"
val ktor = "2.3.12"
val logback = "1.5.6"
val logback = "1.5.8"
val logstashEncoder = "7.4"
val mockk = "1.13.11"
val mockk = "1.13.12"
val micrometerRegistry = "1.12.8"
val nimbusjosejwt = "9.40"
val postgresEmbedded = if (Os.isFamily(Os.FAMILY_MAC)) "1.0.0" else "0.13.4"
val postgres = "42.7.3"
val nimbusjosejwt = "9.41.1"
val postgresEmbedded = "2.0.7"
val postgres = "42.7.4"
val spek = "2.0.19"

plugins {
kotlin("jvm") version "2.0.10"
id("com.github.johnrengelman.shadow") version "8.1.1"
kotlin("jvm") version "2.0.20"
id("com.gradleup.shadow") version "8.3.0"
id("org.jlleitschuh.gradle.ktlint") version "11.6.0"
id("com.github.davidmc24.gradle.plugin.avro") version "1.8.0"
}

val githubUser: String by project
val githubPassword: String by project
repositories {
mavenCentral()
maven(url = "https://packages.confluent.io/maven/")
maven(url = "https://jitpack.io")
maven {
url = uri("https://maven.pkg.github.com/navikt/isdialogmote-schema")
credentials {
username = githubUser
password = githubPassword
}
url = uri("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
}

Expand Down Expand Up @@ -79,7 +71,7 @@ dependencies {
implementation("org.postgresql:postgresql:$postgres")
implementation("com.zaxxer:HikariCP:$hikari")
implementation("org.flywaydb:flyway-core:$flyway")
testImplementation("com.opentable.components:otj-pg-embedded:$postgresEmbedded")
testImplementation("io.zonky.test:embedded-postgres:$postgresEmbedded")

// Kafka
val excludeLog4j = fun ExternalModuleDependency.() {
Expand Down Expand Up @@ -127,15 +119,15 @@ kotlin {
}

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

create("printVersion") {
println(project.version)
}

withType<ShadowJar> {
shadowJar {
archiveBaseName.set("app")
archiveClassifier.set("")
archiveVersion.set("")
Expand All @@ -146,7 +138,7 @@ tasks {
dependsOn(":generateTestAvroJava")
}

withType<Test> {
test {
useJUnitPlatform {
includeEngines("spek2")
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx1024m
2 changes: 1 addition & 1 deletion src/test/kotlin/no/nav/syfo/testutil/TestDatabase.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package no.nav.syfo.testutil

import com.opentable.db.postgres.embedded.EmbeddedPostgres
import io.zonky.test.db.postgres.embedded.EmbeddedPostgres
import no.nav.syfo.personstatus.domain.PersonIdent
import no.nav.syfo.personstatus.db.createPersonOversiktStatus
import no.nav.syfo.personstatus.domain.PersonOversiktStatus
Expand Down

0 comments on commit 5947e7f

Please sign in to comment.