Skip to content

Commit 23f1c18

Browse files
committed
Use Gradle to start/stop containers
1 parent d68c1c2 commit 23f1c18

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

README.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ Build the services using this command:
132132
Run the application using this command:
133133

134134
```
135-
docker-compose up -d
135+
./gradlew :composeUp
136136
```
137137

138+
Note: the ':'
139+
138140
This can take a while.
139141

140142
=== Using the application
@@ -157,7 +159,7 @@ Note: if the containers aren't accessible via `localhost`, you will have to use
157159
Stop the application using this command:
158160

159161
```
160-
docker-compose down -v
162+
./gradlew :composeDown
161163
```
162164

163165
== Deploying the application on Kubernetes

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
dependencies {
66
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
77
classpath "io.spring.gradle:dependency-management-plugin:$springDependencyManagementPluginVersion"
8+
classpath "com.avast.gradle:gradle-docker-compose-plugin:$dockerComposePluginVersion"
89
}
910

1011
}
@@ -15,6 +16,7 @@ plugins {
1516
}
1617

1718
apply plugin: WaitForMySqlPlugin
19+
apply plugin: 'docker-compose'
1820

1921
subprojects {
2022

@@ -47,3 +49,14 @@ subprojects {
4749
task buildContracts(type: GradleBuild) {
4850
tasks = subprojects.collect { it.name }.findAll { it.endsWith("-contracts") }.collect { ":" + it + ":publish"}
4951
}
52+
53+
task compileAll(type: GradleBuild) {
54+
tasks = ["testClasses", "compileIntegrationTestJava", "compileComponentTestJava"]
55+
}
56+
57+
dockerCompose {
58+
projectName = null
59+
if (project.hasProperty('startedService'))
60+
startedServices= [project.ext.startedService]
61+
62+
}

0 commit comments

Comments
 (0)