Skip to content

Commit

Permalink
Use docker-compose instead of docker compose (#1159)
Browse files Browse the repository at this point in the history
reverted c83bc72
  • Loading branch information
nulls authored Sep 5, 2022
1 parent 75266f0 commit 1e86316
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fun Project.createStackDeployTask(profile: String) {
"Deploy to docker swarm. If swarm contains more than one node, some registry for built images is required."
// this command puts env variables into compose file
val composeCmd =
"docker compose -f ${rootProject.buildDir}/docker-compose.yaml --env-file ${rootProject.buildDir}/.env config"
"docker-compose -f ${rootProject.buildDir}/docker-compose.yaml --env-file ${rootProject.buildDir}/.env config"
val stackCmd = "docker stack deploy --compose-file -" +
if (useOverride && composeOverride.exists()) {
" --compose-file ${composeOverride.canonicalPath}"
Expand All @@ -158,9 +158,9 @@ fun Project.createStackDeployTask(profile: String) {
tasks.register<Exec>("startMysqlDbService") {
dependsOn("generateComposeFile")
doFirst {
logger.lifecycle("Running the following command: [docker compose --file $buildDir/docker-compose.yaml up -d mysql]")
logger.lifecycle("Running the following command: [docker-compose --file $buildDir/docker-compose.yaml up -d mysql]")
}
commandLine("docker", "compose", "--file", "$buildDir/docker-compose.yaml", "up", "-d", "mysql")
commandLine("docker-compose", "--file", "$buildDir/docker-compose.yaml", "up", "-d", "mysql")
errorOutput = ByteArrayOutputStream()
doLast {
logger.lifecycle("Waiting $MYSQL_STARTUP_DELAY_MILLIS millis for mysql to start")
Expand All @@ -178,10 +178,10 @@ fun Project.createStackDeployTask(profile: String) {
tasks.register<Exec>("startKafka") {
dependsOn("generateComposeFile")
doFirst {
logger.lifecycle("Running the following command: [docker compose --file $buildDir/docker-compose.yaml up -d kafka]")
logger.lifecycle("Running the following command: [docker-compose --file $buildDir/docker-compose.yaml up -d kafka]")
}
errorOutput = ByteArrayOutputStream()
commandLine("docker", "compose", "--file", "$buildDir/docker-compose.yaml", "up", "-d", "kafka")
commandLine("docker-compose", "--file", "$buildDir/docker-compose.yaml", "up", "-d", "kafka")
doLast {
logger.lifecycle("Waiting $KAFKA_STARTUP_DELAY_MILLIS millis for kafka to start")
Thread.sleep(KAFKA_STARTUP_DELAY_MILLIS) // wait for kafka to start, can be manually increased when needed
Expand All @@ -190,23 +190,22 @@ fun Project.createStackDeployTask(profile: String) {

tasks.register<Exec>("restartMysqlDb") {
dependsOn("generateComposeFile")
commandLine("docker", "compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "mysql")
commandLine("docker-compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "mysql")
finalizedBy("startMysqlDb")
}

tasks.register<Exec>("restartKafka") {
dependsOn("generateComposeFile")
commandLine("docker", "compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "kafka")
commandLine("docker", "compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "zookeeper")
commandLine("docker-compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "kafka")
commandLine("docker-compose", "--file", "$buildDir/docker-compose.yaml", "rm", "--force", "zookeeper")
finalizedBy("startKafka")
}

tasks.register<Exec>("deployLocal") {
dependsOn(subprojects.flatMap { it.tasks.withType<BootBuildImage>() })
dependsOn("startMysqlDb")
commandLine(
"docker",
"compose",
"docker-compose",
"--file",
"$buildDir/docker-compose.yaml",
"up",
Expand Down

0 comments on commit 1e86316

Please sign in to comment.