Init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
FROM bellsoft/liberica-openjre-alpine:21.0.5
|
||||
|
||||
ENV JAVA_OPTS="-jar"
|
||||
|
||||
ADD ./build/libs/*.jar /app.jar
|
||||
|
||||
EXPOSE 38889
|
||||
ENTRYPOINT ["java", "-jar", "/app.jar"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# pcp-srpring-boot-admin-server
|
||||
|
||||
Spring Boot Admin Server для PCP.
|
||||
|
||||
Сервер показывает состояние и actuator-метрики приложений PCP, которые регистрируются через `spring-boot-admin-starter-client`.
|
||||
|
||||
Переменные окружения:
|
||||
|
||||
- `SERVER_PORT`: порт admin server, по умолчанию `38889`
|
||||
|
||||
Запуск:
|
||||
|
||||
`./gradlew :services:pcp-srpring-boot-admin-server:bootRun`
|
||||
@@ -0,0 +1,75 @@
|
||||
group = "space.nstart.pcp"
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.spring")
|
||||
id("org.springframework.boot")
|
||||
id("io.spring.dependency-management")
|
||||
id("org.sonarqube")
|
||||
jacoco
|
||||
}
|
||||
|
||||
version = "1.0.0"
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll("-Xjsr305=strict")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("${property("dep.spring.actuator")}")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-config")
|
||||
implementation("de.codecentric:spring-boot-admin-starter-server:${property("versions.spring.boot.admin")}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
|
||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("versions.spring.cloud")}")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Jar> {
|
||||
manifest {
|
||||
attributes["Built-By"] = "nstart"
|
||||
attributes["Implementation-Version"] = archiveVersion
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
finalizedBy(tasks.jacocoTestReport)
|
||||
systemProperty("spring.profiles.active", "test")
|
||||
systemProperty("spring.config.name", "test-application")
|
||||
}
|
||||
|
||||
tasks.check {
|
||||
dependsOn(tasks.jacocoTestCoverageVerification)
|
||||
}
|
||||
|
||||
tasks.jacocoTestReport {
|
||||
dependsOn(tasks.test)
|
||||
reports {
|
||||
xml.required = true
|
||||
html.required = true
|
||||
csv.required = false
|
||||
}
|
||||
}
|
||||
|
||||
sonar {
|
||||
properties {
|
||||
property("sonar.projectKey", "pcp")
|
||||
property("sonar.login", "sqp_tokenExample")
|
||||
property("sonar.qualitygate.wait", "${property("sonar.qualitygate.wait")}")
|
||||
property("sonar.host.url", "${property("sonar.host.url")}")
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package space.nstart.pcp.pcp_srpring_boot_admin_server
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
|
||||
@EnableAdminServer
|
||||
@SpringBootApplication
|
||||
class PcpSrpringBootAdminServerApplication
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<PcpSrpringBootAdminServerApplication>(*args)
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
spring:
|
||||
application:
|
||||
name: pcp-srpring-boot-admin-server
|
||||
profiles:
|
||||
default: local
|
||||
config:
|
||||
import: "configserver:"
|
||||
cloud:
|
||||
config:
|
||||
uri: ${CONFIG_SERVER_URI:http://localhost:8888}
|
||||
fail-fast: ${CONFIG_SERVER_FAIL_FAST:true}
|
||||
profile: ${SPRING_CLOUD_CONFIG_PROFILE:${SPRING_PROFILES_ACTIVE:${spring.profiles.default}}}
|
||||
label: ${SPRING_CLOUD_CONFIG_LABEL:dev}
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: false
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:38889}
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,env,metrics
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
logging:
|
||||
level:
|
||||
de.codecentric.boot.admin: INFO
|
||||
|
||||
---
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: test
|
||||
cloud:
|
||||
config:
|
||||
enabled: false
|
||||
|
||||
server:
|
||||
port: 0
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package space.nstart.pcp.pcp_srpring_boot_admin_server
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
|
||||
@SpringBootTest
|
||||
class PcpSrpringBootAdminServerApplicationTests {
|
||||
|
||||
@Test
|
||||
fun contextLoads() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
spring:
|
||||
application:
|
||||
name: pcp-srpring-boot-admin-server-test
|
||||
cloud:
|
||||
config:
|
||||
enabled: false
|
||||
import-check:
|
||||
enabled: false
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: false
|
||||
|
||||
server:
|
||||
port: 0
|
||||
Reference in New Issue
Block a user