Skip to content

Commit ddf6398

Browse files
authored
docs: usage description improved
Fixes #446
1 parent abde6c9 commit ddf6398

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ Simplifies usage of [Docker Compose](https://docs.docker.com/compose/) for local
1717
`composeLogs` task stores logs from all containers to files in `containerLogToDir` directory.
1818

1919
## Quick start
20+
The plugin is published to [Gradle Plugin Portal](https://plugins.gradle.org/plugin/com.avast.gradle.docker-compose), so the import is easy as
21+
22+
```gradle
23+
plugins {
24+
id "com.avast.gradle.docker-compose" version "$versionHere"
25+
}
26+
```
27+
28+
Since the version `0.14.2`, the plugin is also published to Maven Central, so if your prefer this way:
29+
2030
```gradle
2131
buildscript {
2232
repositories {
@@ -28,14 +38,14 @@ buildscript {
2838
}
2939
3040
apply plugin: 'docker-compose'
41+
```
3142

32-
// Or use the new Gradle Portal plugins (then you don't have to add the dependency as above):
33-
// plugins {
34-
// id 'com.avast.gradle.docker-compose' version "$versionHere"
35-
// }
36-
43+
After importing the plugin, the basic usage is typically just:
44+
```gradle
3745
dockerCompose.isRequiredBy(test)
3846
```
47+
48+
It ensures:
3949
* `docker-compose up` is executed in the project directory, so it uses the `docker-compose.yml` file.
4050
* If the provided task (`test` in the example above) executes a new process then environment variables and Java system properties are provided.
4151
* The name of environment variable is `${serviceName}_HOST` and `${serviceName}_TCP_${exposedPort}` (e.g. `WEB_HOST` and `WEB_TCP_80`).

0 commit comments

Comments
 (0)