Newer
Older
defaultTasks("run")
tasks.register<Exec>("run-db") {
group = "OpenCoDE"
description = "Runs the database in background via docker"
commandLine("docker", "compose", "up", "-d", "db")
}
tasks.register<Exec>("run-dashboard") {
group = "OpenCoDE"
description = "Runs the dashboard in background via docker."
workingDir("../dashboard")
commandLine("docker", "compose", "up", "-d", "dashboard")
}
tasks.register("dependencyUpdates") {
description = "Prints possible dependency updates."
dependsOn(gradle.includedBuild("app").task(":backend:dependencyUpdates"))
}
tasks.register("run") {
group = "OpenCoDE"
description = "Runs the dataprovider against the database, you should be sure database is running."
dependsOn(gradle.includedBuild("app").task(":backend:bootRun"))
// check if db is started and reports healthy
doFirst {
val checkHealthCmd = arrayOf("docker", "inspect", "--format='{{.State.Health.Status}}'", "opencode-db-1")
val process = Runtime.getRuntime().exec(checkHealthCmd)
val healthStatus = process.inputStream.bufferedReader().readText().trim()
if (healthStatus != "healthy") {
throw GradleException("Database container 'opencode-db-1' is not healthy. Please start db first via run-db task. Current db status: \"$healthStatus\" (empty = no db started)")
}
}
tasks.register<Exec>("run-container") {
group = "OpenCoDE"
description = "Runs the dataprovider against the database in foreground."
commandLine("docker", "compose", "up", "--build", "data-provider")
group = "OpenCoDE"
description = "Removes all builds."
dependsOn(gradle.includedBuild("app").task(":backend:clean"))
}
group = "OpenCoDE"
description = "Build the service"
dependsOn(gradle.includedBuild("app").task(":backend:build"))
}
group = "OpenCoDE"
description = "Runs tests."
dependsOn(gradle.includedBuild("app").task(":backend:test"))
}
group = "OpenCoDE"
description = "Assembles everything into a deployable format."
dependsOn(gradle.includedBuild("app").task(":backend:assemble"))