[Monitoring] MongoDB Metrics in Grafana
Jambotron Deploy / build-and-deploy (push) Waiting to run

This commit is contained in:
2026-05-01 16:06:11 +03:00
parent 792d8bf6af
commit bcc7ca5d12
6 changed files with 294 additions and 105 deletions
+95 -103
View File
@@ -1,149 +1,141 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.flywaydb.flyway' version '10.4.1'
id 'java'
id 'org.springframework.boot' version '3.5.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.flywaydb.flyway' version '10.4.1'
}
group = 'com.jambotronGroup'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
toolchain {
// Устанавливаем актуальную LTS версию 21 для Spring Boot 3.5
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.projectlombok:lombok:1.18.26'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' // For JSON serialization/deserialization
implementation 'org.postgresql:postgresql:42.6.0'
implementation 'org.flywaydb:flyway-core'
implementation("org.flywaydb:flyway-database-postgresql:10.4.1")
// Ядро Spring Boot
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6'
implementation 'org.springframework:spring-mock:2.0.8'
// --- НОВОЕ: Реактивная MongoDB 6.0 для метаданных PaaS ---
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
// Apache Commons Exec for process execution
implementation 'org.apache.commons:commons-exec:1.3'
// --- НОВОЕ: Docker API для управления контейнерами (Созидание) ---
implementation 'com.github.docker-java:docker-java-core:3.3.6'
implementation 'com.github.docker-java:docker-java-transport-httpclient5:3.3.6'
implementation 'com.google.guava:guava:33.4.8-jre'
implementation 'io.micrometer:micrometer-core:1.12.0'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// Работа с SQL и PostgreSQL[cite: 3]
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.postgresql:postgresql:42.6.0'
implementation 'org.flywaydb:flyway-core'
implementation "org.flywaydb:flyway-database-postgresql:10.4.1"
implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
// Безопасность и JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
// Lombok с поддержкой JDK 21
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
// Spring AI и дополнительные утилиты
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6'
implementation 'com.google.guava:guava:33.4.8-jre'
implementation 'org.apache.commons:commons-exec:1.3'
implementation 'io.micrometer:micrometer-core:1.12.0'
// Тестирование
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// Временный фикс для обратной совместимости (если требуется)
implementation 'org.springframework:spring-mock:2.0.8'
}
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom ("org.springframework.ai:spring-ai-retry:1.0.0")
}
}
dependencyManagement {
imports {
mavenBom ("org.springframework.ai:spring-ai-retry:1.0.0")
}
}
apply plugin: 'java'
// --- Задачи сборки Angular (Твой монолитный код существования) ---
import org.apache.tools.ant.taskdefs.condition.Os
tasks.register("bootRun_Dev") {
group = "_jambotron_build"
description = "Runs the Spring Boot application with the dev profile"
doFirst {
tasks.bootRun.configure {
systemProperty("spring.profiles.active", "dev")
}
}
finalizedBy("bootRun")
group = "_jambotron_build"
description = "Runs the Spring Boot application with the dev profile"
doFirst {
tasks.bootRun.configure {
systemProperty("spring.profiles.active", "dev")
}
}
finalizedBy("bootRun")
}
tasks.register('buildAngular_dev', Exec) {
group = "_jambotron_build"
description = "Builds the Angular application in development mode"
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
// Your Angular build command
//do not forget build_dev used port 8082 with proxy for connect to backend rest api
args = ['run', 'build_dev']
}
import org.apache.tools.ant.taskdefs.condition.Os // Обязательно добавь этот импорт в самое начало файла
tasks.register('buildAngular_prod', Exec) {
group = "_jambotron_build"
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
// Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
group = "_jambotron_build"
workingDir './jambotron-ui'
executable = Os.isFamily(Os.FAMILY_WINDOWS) ? 'npm.cmd' : 'npm'
// Your Angular build command
args = ['run', 'build']
args = ['run', 'build_dev']
}
tasks.register('buildAngular_prod', Exec) {
group = "_jambotron_build"
workingDir './jambotron-ui'
executable = Os.isFamily(Os.FAMILY_WINDOWS) ? 'npm.cmd' : 'npm'
args = ['run', 'build']
}
tasks.register('deleteStaticFolder_prod', Delete) {
group = "_jambotron_build"
dependsOn buildAngular_prod
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
group = "_jambotron_build"
dependsOn buildAngular_prod
delete "src/main/resources/static"
}
tasks.register('deleteStaticFolder_dev', Delete) {
group = "_jambotron_build"
dependsOn buildAngular_dev
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
group = "_jambotron_build"
dependsOn buildAngular_dev
delete "src/main/resources/static"
}
tasks.register('copyAngularBuild_prod', Copy) {
group = "_jambotron_build"
group = "_jambotron_build"
dependsOn deleteStaticFolder_prod
from 'jambotron-ui/dist/jambotron-ui/browser'
into "src/main/resources/static"
}
dependsOn deleteStaticFolder_prod
from 'jambotron-ui/dist/jambotron-ui/browser' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR
tasks.register('copyAngularBuild_dev', Copy) {
group = "_jambotron_build"
dependsOn deleteStaticFolder_dev
from 'jambotron-ui/dist/jambotron-ui'
into "src/main/resources/static"
}
// Говорим задаче обработки ресурсов, что она НЕ ДОЛЖНА трогать статику фронтенда,
// пока фронтенд-задача не закончит свою работу.
processResources {
if (!gradle.startParameter.taskNames.any { it.toLowerCase().contains("dev") })
{
// В продакшн сборке всегда копируем фронтенд
if (!gradle.startParameter.taskNames.any { it.toLowerCase().contains("dev") }) {
dependsOn copyAngularBuild_prod
}
}
tasks.register('copyAngularBuild_dev', Copy) {
group = "_jambotron_build"
dependsOn deleteStaticFolder_dev
from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR
}
tasks.named('test') {
useJUnitPlatform()
}
useJUnitPlatform()
}