Skip to content

picaron/kotlin-compose

 
 

Repository files navigation

Overview

Kotlin-compose is a docker-compose wrapper for the JVM. This library is mainly intended to be used in embedded integration tests.

Build Status jcenter Maven Central

How to use it

Dependencies

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>

Java code example

// 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

Building locally

./gradlew clean build

Install to your local .m2 directory:

./gradlew clean build publishJavaArtifactsPublicationToMavenLocal

Upload to jcenter

If you're an authorized owner of the project, you may upload a released version to Bintray.

BINTRAY_USER=[USER] BINTRAY_KEY=[API_KEY] ./gradlew clean build bintray

Upload to Artifactory

Upload to Meltwater Artifactory repository:

./gradlew clean build artifactoryPublish

With the following settings given in ~/.gradle/gradle.properties

systemProp.artifactory_user=..
systemProp.artifactory_password=..

License

MIT

About

Docker-compose wrapper for the JVM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 89.2%
  • Groovy 10.8%