Kotlin-compose is a docker-compose wrapper for the JVM. This library is mainly intended to be used in embedded integration tests.
Gradle:
repositories {
jcenter()
}
...
dependencies {
compile 'com.meltwater.docker:kotlin-compose:$VERSION'
...
}
Maven:
<dependency>
<groupId>com.meltwater.docker</groupId>
<artifactId>kotlin-compose</artifactId>
<version>$VERSION</version>
<type>jar</type>
</dependency>
// create the docker compose context giving a path to a docker compose yaml file, a machine uniqe prefix and
// optinally provide some ENVIRONMENT variables that will be resolved in the yaml file
Map<String,String> env = new HashMap<>();
DockerCompose compose = new DockerCompose("docker-compose.yml", "uniqe-namespace", env);
// start the docker containers (note this method will return as soon as all containers are running)
compose.up();
// verify that all services inside the containers has started
// do your tests
// kill the containers (this method reurns when all containers has stopped)
compose.kill();
For more examples have a look at the unit tests
./gradlew clean build
Install to your local .m2 directory:
./gradlew clean build publishJavaArtifactsPublicationToMavenLocal
No new artifacts will be pushed to jcenter for the moment.
Upload to Meltwater Artifactory repository:
./gradlew clean build artifactoryPublish
With the following settings given in ~/.gradle/gradle.properties
systemProp.artifactory_user=..
systemProp.artifactory_password=..