Skip to content

Commit

Permalink
feat(service): enable configuration of the Kroki version
Browse files Browse the repository at this point in the history
A `KROKI_CONTAINER_IMAGE_TAG` environment variable can be configured to
configure the service management functions to manage a specific version
of Kroki. By default, the `latest` version of Kroki will be managed.
  • Loading branch information
bauglir committed Mar 13, 2024
1 parent 4a95bc1 commit ff03e66
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
22 changes: 21 additions & 1 deletion src/kroki/service.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
"""
# The docstring is included here to ensure visibility, but needs to be stored
# in a variable and associated to the module _after_ it has been define so that
# the docstring can refer to functions defined within the module
service_module_docstring = """
Defines functions and constants managing the Kroki service the rest of the
package uses to render diagrams. These services can be either local or remote.
This module also enables management of a local service instance, provided
[Docker](https://docker.com) and [Docker
Compose](https://docs.docker.com/compose/) are available on the system.
By default, the functions managing locally running services will rely on the
`latest` tag for the [`yuzutech/kroki` container
image](https://hub.docker.com/r/yuzutech/kroki/tags). This typically means the
most recently released version of Kroki will be used. In this mode,
[`Kroki.Service.update!`](@ref) can be used to pull in the most recent version.
A `KROKI_CONTAINER_IMAGE_TAG` environment variable can be configured, prior to
invoking [`Kroki.Service.start!`](@ref), to start the services corresponding to
a specific version of Kroki. It is important the variable matches an existing
tag for the container image.
!!! warning "Changing Kroki versions"
Changing the `KROKI_CONTAINER_IMAGE_TAG` environment variable after calling
[`Kroki.Service.start!`](@ref) may result in manual cleanup of containers
being necessary as the service management functions will _not_ keep track
of which versions of services were previously started.
"""
module Service

Expand Down Expand Up @@ -236,3 +255,4 @@ end
__init__() = setEndpoint!()

end
@doc service_module_docstring Service
13 changes: 7 additions & 6 deletions support/docker-services.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
version: "3"
services:
core:
image: yuzutech/kroki
image: yuzutech/kroki:${KROKI_CONTAINER_IMAGE_TAG:-latest}
depends_on:
- blockdiag
- bpmn
Expand All @@ -19,12 +20,12 @@ services:
ports:
- 8000:8000
blockdiag:
image: yuzutech/kroki-blockdiag
image: yuzutech/kroki-blockdiag:${KROKI_CONTAINER_IMAGE_TAG:-latest}
bpmn:
image: yuzutech/kroki-bpmn
image: yuzutech/kroki-bpmn:${KROKI_CONTAINER_IMAGE_TAG:-latest}
diagramsnet:
image: yuzutech/kroki-diagramsnet
image: yuzutech/kroki-diagramsnet:${KROKI_CONTAINER_IMAGE_TAG:-latest}
excalidraw:
image: yuzutech/kroki-excalidraw
image: yuzutech/kroki-excalidraw:${KROKI_CONTAINER_IMAGE_TAG:-latest}
mermaid:
image: yuzutech/kroki-mermaid
image: yuzutech/kroki-mermaid:${KROKI_CONTAINER_IMAGE_TAG:-latest}

0 comments on commit ff03e66

Please sign in to comment.