-
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
Le Gall, Benoit
committed
Aug 14, 2024
1 parent
240d44b
commit 8b2986c
Showing
7 changed files
with
127 additions
and
1 deletion.
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
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
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,77 @@ | ||
plugins { | ||
id("io.micronaut.minimal.application") | ||
alias(libs.plugins.jib) | ||
} | ||
|
||
micronaut { | ||
runtime("netty") | ||
testRuntime("junit5") | ||
processing { | ||
incremental(true) | ||
annotations("com.frogdevelopment.*") | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.toVersion("21") | ||
targetCompatibility = JavaVersion.toVersion("21") | ||
} | ||
|
||
dependencies { | ||
annotationProcessor(mn.lombok) | ||
annotationProcessor(mn.micronaut.http.validation) | ||
annotationProcessor(mn.micronaut.serde.processor) | ||
|
||
implementation(mn.micronaut.discovery.client) | ||
implementation(mn.micronaut.http.client) | ||
implementation(mn.micronaut.management) | ||
implementation(mn.micronaut.serde.jackson) | ||
implementation(projects.micronautApiGatewayHttp) | ||
|
||
compileOnly(mn.lombok) | ||
|
||
runtimeOnly(mn.logback.classic) | ||
runtimeOnly(mn.snakeyaml) | ||
runtimeOnly(mn.micronaut.discovery.client) | ||
|
||
testImplementation(mn.assertj.core) | ||
testImplementation(mn.mockito.junit.jupiter) | ||
} | ||
|
||
application { | ||
mainClass.set("com.frogdevelopment.micronaut.gateway.Application") | ||
} | ||
|
||
tasks { | ||
jib { | ||
|
||
from { | ||
image = "eclipse-temurin:21-jre-alpine" | ||
platforms { | ||
platform { | ||
architecture = "amd64" | ||
os = "linux" | ||
} | ||
platform { | ||
architecture = "arm64" | ||
os = "linux" | ||
} | ||
} | ||
} | ||
|
||
to { | ||
image = "frogdevelopment/micronaut-api-gateway:${rootProject.version}" | ||
if (System.getenv("CI") == "true") { | ||
auth { | ||
username = System.getenv("DOCKER_USR") | ||
password = System.getenv("DOCKER_PSW") | ||
} | ||
} | ||
} | ||
|
||
container { | ||
setMainClass(application.mainClass) | ||
} | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ut-api-gateway-image/src/main/java/com/frogdevelopment/micronaut/gateway/Application.java
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,10 @@ | ||
package com.frogdevelopment.micronaut.gateway; | ||
|
||
import io.micronaut.runtime.Micronaut; | ||
|
||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
Micronaut.run(Application.class, args); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
micronaut-api-gateway-image/src/main/resources/bootstrap.yaml
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,15 @@ | ||
micronaut: | ||
application: | ||
name: api-gateway | ||
config-client: | ||
enabled: true | ||
|
||
consul: | ||
client: | ||
defaultZone: "${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}" | ||
config: | ||
format: yaml | ||
path: config/local | ||
registration: | ||
deregister: true | ||
enabled: true |
15 changes: 15 additions & 0 deletions
15
micronaut-api-gateway-image/src/main/resources/logback.xml
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,15 @@ | ||
<configuration debug="false"> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<pattern>%cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n | ||
</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="info"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
</configuration> |
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