For my tests I need to run containers with e.g. some databases. I have set everything using docker-compose, and if containers are up my tests are working. One note: these are not the unit tests, but integration tests, and they are allowed to run longer.
What would be the best way to control docker-compose from Gradle? I need to run the containers (if not up) and fire the tests. This also should work for OSX and Linux.
I think you can run docker-compose up -d using the exec task to start the environment.
And you can run docker-compose stop; docker-compose rm -f as a cleanup task when the tests are done (if you want to stop everything and remove containers).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With