forked from kuvasz-uptime/kuvasz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
akobor
committed
Jul 18, 2020
0 parents
commit 16f6952
Showing
32 changed files
with
1,605 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Thumbs.db | ||
.DS_Store | ||
.gradle | ||
build/ | ||
target/ | ||
out/ | ||
.idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.project | ||
.settings | ||
.classpath | ||
docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM oracle/graalvm-ce:20.1.0-java11 as graalvm | ||
RUN gu install native-image | ||
|
||
COPY . /home/app/kuvasz | ||
WORKDIR /home/app/kuvasz | ||
|
||
RUN native-image --no-server -cp build/libs/kuvasz-*-all.jar | ||
|
||
FROM frolvlad/alpine-glibc | ||
RUN apk update && apk add libstdc++ | ||
EXPOSE 8080 | ||
COPY --from=graalvm /home/app/kuvasz/kuvasz /app/kuvasz | ||
ENTRYPOINT ["/app/kuvasz"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.jvm" version "${kotlinVersion}" | ||
id "org.jetbrains.kotlin.kapt" version "${kotlinVersion}" | ||
id "org.jetbrains.kotlin.plugin.allopen" version "${kotlinVersion}" | ||
id "application" | ||
id "com.google.cloud.tools.jib" version "2.4.0" | ||
id "com.github.johnrengelman.shadow" version "6.0.0" | ||
id "io.gitlab.arturbosch.detekt" version "${detektVersion}" | ||
id "jacoco" | ||
id "nu.studer.jooq" version "${jooqPluginVersion}" | ||
} | ||
|
||
version "0.1" | ||
group "com.akobor.kuvasz" | ||
|
||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
} | ||
|
||
configurations { | ||
// for dependencies that are needed for development only | ||
developmentOnly | ||
} | ||
|
||
dependencies { | ||
kapt(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
kapt("io.micronaut:micronaut-inject-java") | ||
kapt("io.micronaut:micronaut-validation") | ||
kapt("io.micronaut:micronaut-graal") | ||
kapt("io.micronaut.configuration:micronaut-openapi") | ||
kapt("io.micronaut.security:micronaut-security-annotations") | ||
compileOnly(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
compileOnly("org.graalvm.nativeimage:svm") | ||
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
implementation("io.micronaut:micronaut-inject") | ||
implementation("io.micronaut:micronaut-validation") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") | ||
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime") | ||
implementation("io.micronaut:micronaut-runtime") | ||
implementation("javax.annotation:javax.annotation-api") | ||
implementation("io.micronaut:micronaut-http-server-netty") | ||
implementation("io.micronaut:micronaut-http-client") | ||
implementation("io.swagger.core.v3:swagger-annotations") | ||
implementation("io.micronaut.flyway:micronaut-flyway") | ||
implementation("io.micronaut.sql:micronaut-jdbc-hikari") | ||
implementation("io.micronaut.sql:micronaut-jooq") | ||
implementation("io.micronaut.security:micronaut-security") | ||
implementation("io.micronaut.kotlin:micronaut-kotlin-extension-functions") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
implementation "nu.studer:gradle-jooq-plugin:$jooqPluginVersion" | ||
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion" | ||
runtimeOnly("ch.qos.logback:logback-classic") | ||
runtimeOnly("org.postgresql:postgresql") | ||
kaptTest(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
kaptTest("io.micronaut:micronaut-inject-java") | ||
testImplementation(platform("io.micronaut:micronaut-bom:$micronautVersion")) | ||
testImplementation("io.micronaut.test:micronaut-test-kotest") | ||
testImplementation("io.mockk:mockk:1.9.3") | ||
testImplementation("io.kotest:kotest-runner-junit5-jvm:4.0.3") | ||
testRuntimeOnly("com.h2database:h2") | ||
} | ||
|
||
test.classpath += configurations.developmentOnly | ||
|
||
mainClassName = "com.akobor.kuvasz.Application" | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
} | ||
|
||
jacoco { | ||
toolVersion = "0.8.5" | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
csv.enabled true | ||
csv.destination file("${buildDir}/jacocoCsv") | ||
} | ||
classDirectories.setFrom( | ||
fileTree("build/classes/kotlin/main") { | ||
exclude("com/akobor/kuvasz/Application.class") | ||
} | ||
) | ||
} | ||
|
||
build { | ||
dependsOn("detekt") | ||
} | ||
|
||
// use JUnit 5 platform | ||
test { | ||
useJUnitPlatform() | ||
finalizedBy("jacocoTestReport") | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.toVersion('11') | ||
} | ||
|
||
allOpen { | ||
annotation("io.micronaut.aop.Around") | ||
} | ||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = '11' | ||
//Will retain parameter names for Java reflection | ||
javaParameters = true | ||
} | ||
} | ||
compileTestKotlin { | ||
kotlinOptions { | ||
jvmTarget = '11' | ||
javaParameters = true | ||
} | ||
} | ||
kapt { | ||
arguments { | ||
arg("micronaut.processing.incremental", true) | ||
arg("micronaut.processing.annotations", "com.akobor.kuvasz.*") | ||
arg("micronaut.processing.group", "com.akobor.kuvasz") | ||
arg("micronaut.processing.module", "kuvasz") | ||
} | ||
} | ||
|
||
tasks.withType(JavaExec) { | ||
classpath += configurations.developmentOnly | ||
jvmArgs('-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote', '-Dlogback.configurationFile=logback-dev.xml') | ||
systemProperty("micronaut.environments", "dev") | ||
if (gradle.startParameter.continuous) { | ||
systemProperties( | ||
'micronaut.io.watch.restart':'true', | ||
'micronaut.io.watch.enabled':'true', | ||
"micronaut.io.watch.paths":"src/main" | ||
) | ||
} | ||
} | ||
|
||
jib.to.image = 'gcr.io/kuvasz/jib-image' |
Oops, something went wrong.