Skip to content

Commit

Permalink
docs: usage description improved
Browse files Browse the repository at this point in the history
Fixes #446
  • Loading branch information
augi authored Jul 19, 2024
1 parent abde6c9 commit ddf6398
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Simplifies usage of [Docker Compose](https://docs.docker.com/compose/) for local
`composeLogs` task stores logs from all containers to files in `containerLogToDir` directory.

## Quick start
The plugin is published to [Gradle Plugin Portal](https://plugins.gradle.org/plugin/com.avast.gradle.docker-compose), so the import is easy as

```gradle
plugins {
id "com.avast.gradle.docker-compose" version "$versionHere"
}
```

Since the version `0.14.2`, the plugin is also published to Maven Central, so if your prefer this way:

```gradle
buildscript {
repositories {
Expand All @@ -28,14 +38,14 @@ buildscript {
}
apply plugin: 'docker-compose'
```

// Or use the new Gradle Portal plugins (then you don't have to add the dependency as above):
// plugins {
// id 'com.avast.gradle.docker-compose' version "$versionHere"
// }
After importing the plugin, the basic usage is typically just:
```gradle
dockerCompose.isRequiredBy(test)
```

It ensures:
* `docker-compose up` is executed in the project directory, so it uses the `docker-compose.yml` file.
* If the provided task (`test` in the example above) executes a new process then environment variables and Java system properties are provided.
* The name of environment variable is `${serviceName}_HOST` and `${serviceName}_TCP_${exposedPort}` (e.g. `WEB_HOST` and `WEB_TCP_80`).
Expand Down

0 comments on commit ddf6398

Please sign in to comment.