gradle docker config tidy up

This commit is contained in:
Adam 2022-06-20 23:59:57 +02:00
parent e56ecb7d36
commit e0f689c538
7 changed files with 31 additions and 44 deletions

View file

@ -12,9 +12,9 @@ dependencyResolutionManagement {
repositories {
myMavenLocal()
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
mavenContent { snapshotsOnly() }
}
// maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
// mavenContent { snapshotsOnly() }
// }
jitpack()
gradlePluginPortal()

View file

@ -1,3 +1,5 @@
rootProject.name = "buildSrc"
apply(from = "./repositories.settings.gradle.kts")
@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature

View file

@ -8,6 +8,7 @@ plugins {
idea
}
group = rootProject.group
version = rootProject.version
@ -18,19 +19,6 @@ tasks.withType<WriteProperties>().configureEach {
}
val hardReset by tasks.registering(Delete::class) {
group = rootProject.name
doFirst("hardResetConfirmation") {
val answer = project.serviceOf<UserInputHandler>()
.askYesNoQuestion("Are you sure you want to permanently delete Kafkatorio data?")
if (answer != true) {
throw GradleException("Aborting hard reset")
}
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
exclude("**/.secret.*")
}

View file

@ -23,6 +23,7 @@ val dockerUp by tasks.registering(Exec::class) {
commandLine = parseSpaceSeparatedArgs(""" docker-compose up -d """)
}
val dockerDown by tasks.registering(Exec::class) {
group = dockerComposeTaskGroup
@ -42,11 +43,13 @@ val dockerRemove by tasks.registering(Exec::class) {
commandLine = parseSpaceSeparatedArgs(""" docker-compose rm --stop -v -f """)
}
afterEvaluate {
tasks.named("processRun") { dependsOn(dockerUp, dockerEnv) }
tasks.named("processKill") { dependsOn(dockerDown) }
}
val dockerEnv by tasks.registering(WriteProperties::class) {
group = dockerComposeTaskGroup
@ -60,4 +63,5 @@ val dockerEnv by tasks.registering(WriteProperties::class) {
)
}
tasks.assemble { dependsOn(dockerEnv) }