forked from SPC/spc-site
Fix task outputs for build date
This commit is contained in:
parent
d06cc8d359
commit
1c3fb97826
@ -57,10 +57,14 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
//write build time in build to check outdated external data directory
|
||||
tasks.getByName<Copy>("processResources") {
|
||||
val writeBuildDate: Task by tasks.creating {
|
||||
doFirst {
|
||||
val deployDate = LocalDateTime.now()
|
||||
project.buildDir.resolve("resources/main/buildDate").writeText(deployDate.toString())
|
||||
}
|
||||
outputs.file("resources/main/buildDate")
|
||||
}
|
||||
|
||||
|
||||
//write build time in build to check outdated external data directory
|
||||
tasks.getByName("processResources").dependsOn(writeBuildDate)
|
@ -58,7 +58,11 @@ fun Application.spcModule() {
|
||||
|
||||
val inProduction: Boolean = environment.config.propertyOrNull("ktor.environment.production") != null
|
||||
|
||||
if(inProduction) log.info("Production mode activated")
|
||||
if(inProduction){
|
||||
log.info("Production mode activated")
|
||||
log.info("Build date: $buildDate")
|
||||
log.info("Deploy date: $deployDate")
|
||||
}
|
||||
|
||||
if (deployDate != null && buildDate != null && buildDate.isAfter(deployDate)) {
|
||||
log.info("Outdated data. Resetting data directory.")
|
||||
|
Loading…
Reference in New Issue
Block a user