Production must not ship test users, demo orders, or test1234. Dev and CI still need seeded users for e2e. Prod creates one admin from deploy secrets. - Move V2/V4/V6 seed migrations to db/dev-migration - Add application-prod.yml with schema-only Flyway and ignore-missing for moved seeds - Add AdminBootstrap to create admin from ADMIN_EMAIL and ADMIN_PASSWORD - Wire docker,prod profile, deploy secrets, and localhost:5433 for SSH DB access - Add hashPassword Gradle task for optional manual bcrypt generation
92 lines
2.5 KiB
Groovy
92 lines
2.5 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'jacoco'
|
|
id 'org.springframework.boot' version '4.0.6'
|
|
id 'io.spring.dependency-management' version '1.1.7'
|
|
}
|
|
|
|
group = 'se.bilhalsning'
|
|
version = '0.0.1-SNAPSHOT'
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
|
implementation 'org.springframework.boot:spring-boot-starter-flyway'
|
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
|
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
|
implementation 'org.flywaydb:flyway-database-postgresql'
|
|
implementation 'org.jsoup:jsoup:1.18.1'
|
|
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
|
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
|
compileOnly 'org.projectlombok:lombok'
|
|
runtimeOnly 'com.h2database:h2'
|
|
runtimeOnly 'org.postgresql:postgresql'
|
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
|
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'
|
|
annotationProcessor 'org.projectlombok:lombok'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-flyway-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
|
testCompileOnly 'org.projectlombok:lombok'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
testAnnotationProcessor 'org.projectlombok:lombok'
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
finalizedBy jacocoTestReport
|
|
}
|
|
|
|
jacoco {
|
|
toolVersion = "0.8.12"
|
|
}
|
|
|
|
jacocoTestReport {
|
|
dependsOn test
|
|
reports {
|
|
xml.required = true
|
|
csv.required = false
|
|
html.required = true
|
|
}
|
|
}
|
|
|
|
jacocoTestCoverageVerification {
|
|
dependsOn jacocoTestReport
|
|
violationRules {
|
|
rule {
|
|
limit {
|
|
minimum = 0.70
|
|
}
|
|
}
|
|
rule {
|
|
limit {
|
|
counter = 'BRANCH'
|
|
minimum = 0.60
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named('check').configure {
|
|
dependsOn jacocoTestCoverageVerification
|
|
}
|
|
|
|
tasks.register('hashPassword', JavaExec) {
|
|
group = 'utility'
|
|
description = 'Print BCrypt hash for a password (strength 12). Usage: -Ppassword=secret'
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
mainClass = 'se.bilhalsning.tools.BcryptHashCli'
|
|
args = project.findProperty('password') ? [project.property('password')] : []
|
|
}
|