Refactor admin component and update application properties for production setup
Gradle _jambotron_build aplication.properties for dev and prod
This commit is contained in:
+30
-56
@@ -37,20 +37,6 @@ dependencies {
|
||||
implementation("org.flywaydb:flyway-database-postgresql:10.4.1")
|
||||
|
||||
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6'
|
||||
|
||||
|
||||
|
||||
|
||||
//implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
|
||||
//implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
|
||||
//implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT")
|
||||
// Replace the following with the starter dependencies of specific modules you wish to use
|
||||
//implementation 'org.springframework.ai:spring-ai-zhipuai'
|
||||
//implementation 'org.springframework.boot:spring-boot-starter-webflux'
|
||||
//implementation("org.springframework.ai:spring-ai-spring-boot-autoconfigure:1.0.0-M6")
|
||||
// https://mvnrepository.com/artifact/org.springframework.ai/spring-ai-retry
|
||||
//implementation("org.springframework.ai:spring-ai-retry:1.0.0")
|
||||
//implementation group: 'org.springframework.ai', name: 'spring-ai-spring-boot-autoconfigure', version: '1.0.0-M6'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
@@ -60,67 +46,50 @@ apply plugin: 'io.spring.dependency-management'
|
||||
}
|
||||
}
|
||||
|
||||
// copyResouces( type:Copy
|
||||
|
||||
//tasks copyResouces( type:Copy){
|
||||
//
|
||||
// def buildDir = "${project.buildDir}"
|
||||
//
|
||||
// from "{$buildDir}/jambotron-ui/dist/jambotron-ui/browser" // Source directory
|
||||
// into "{$buildDir}/build/resources" // Target directory
|
||||
// include '**/*'
|
||||
//}
|
||||
|
||||
apply plugin: 'java'
|
||||
|
||||
/*tasks.register('copyResources', Copy) {
|
||||
from 'jambotron-ui/dist/jambotron-ui/browser'
|
||||
into 'src/main/resources/public'
|
||||
}*/
|
||||
//processResources.dependsOn(copyResources)
|
||||
//compileJava.dependsOn(copyResources)
|
||||
//bootRun.dependsOn("flywayMigrate")
|
||||
|
||||
//flyway {
|
||||
// user='admin'
|
||||
// password= 'postgrespw'
|
||||
// url = 'jdbc:postgresql://localhost:5432/jambotronDB'
|
||||
// driver = 'org.postgresql.Driver'
|
||||
// baselineOnMigrate = true
|
||||
// locations = ['filesystem:src/main/resources/db.migration/']
|
||||
//}
|
||||
|
||||
/*sourceSets {
|
||||
main {
|
||||
resources {
|
||||
srcDir 'jambotron-ui/dist/jambotron-ui/browser'
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
|
||||
tasks.register('buildAngular_dev', Exec) {
|
||||
//dependsOn deleteStaticFolder
|
||||
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
|
||||
args = ['run', 'build_dev']//do not forget build_dev used port 8080 for connect to backend rest api
|
||||
//do not forget build_dev used port 8082 with proxy for connect to backend rest api
|
||||
args = ['run', 'build_dev']
|
||||
|
||||
}
|
||||
|
||||
tasks.register('buildAngular', Exec) {
|
||||
//dependsOn deleteStaticFolder
|
||||
tasks.register('buildAngular_prod', Exec) {
|
||||
group = "_jambotron_build"
|
||||
|
||||
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
|
||||
args = ['run', 'build']//do not forget build_dev used port 8080 for connect to backend rest api
|
||||
args = ['run', 'build']
|
||||
|
||||
}
|
||||
|
||||
|
||||
tasks.register('deleteStaticFolder', Delete) {
|
||||
dependsOn buildAngular
|
||||
tasks.register('deleteStaticFolder_prod', Delete) {
|
||||
group = "_jambotron_build"
|
||||
|
||||
dependsOn buildAngular_prod
|
||||
def dirName = "src/main/resources/static"
|
||||
file(dirName).list().each {
|
||||
f ->
|
||||
@@ -129,6 +98,8 @@ tasks.register('deleteStaticFolder', Delete) {
|
||||
}
|
||||
|
||||
tasks.register('deleteStaticFolder_dev', Delete) {
|
||||
group = "_jambotron_build"
|
||||
|
||||
dependsOn buildAngular_dev
|
||||
def dirName = "src/main/resources/static"
|
||||
file(dirName).list().each {
|
||||
@@ -137,12 +108,15 @@ tasks.register('deleteStaticFolder_dev', Delete) {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('copyAngularBuild', Copy) {
|
||||
dependsOn deleteStaticFolder
|
||||
tasks.register('copyAngularBuild_prod', Copy) {
|
||||
group = "_jambotron_build"
|
||||
|
||||
dependsOn deleteStaticFolder_prod
|
||||
from 'jambotron-ui/dist/jambotron-ui' // 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' // Path to your Angular dist folder
|
||||
into "src/main/resources/static" // Path INSIDE the WAR
|
||||
|
||||
Reference in New Issue
Block a user