Local Kroki Plugin

Objectives

The local-kroki Gradle plugin aims to:
  • run Kroki services locally

  • easily configure services and exposed port

  • work seamlessly with the local-antora plugin

About Kroki

Kroki.io makes it really easy to generate diagrams from textual representations, but you might not want to send all your diagrams into the wild.

How It Works

The local-kroki plugin shamelessly rips of the Install Kroki Using Docker Compose docs and applies the gradle-docker-compose-plugin to tie everything together.

The plugin:
  • adds the localAntora extension

  • adds the task writeKrokiDockerComposeFile task, writes a docker-compose.yml file (to the build directory)

  • applies the gradle-docker-compose-plugin and configures docker-compose

  • adds the tasks startKroki and stopKroki

Setup

build.gradle
plugins {
    id 'com.gitlab.mvik.local-kroki' version '0.4.0'
}

localKroki {
    version '0.11.0'
    port 8000
    service 'core'
    composeFile layout.buildDirectory.file('kroki/docker-compose.yml')
    krokiOnly true
}

See More Examples to get the full list of configuration options.

Run Kroki

start kroki services
./gradlew startKroki
stop kroki services
./gradlew stopKroki

More Examples

See use plugin examples in the source repository.