Last active
April 29, 2022 13:45
-
-
Save ToastShaman/5aee90d0590036f97ffd50c0d90638f4 to your computer and use it in GitHub Desktop.
PlantUML CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:14-jdk-alpine3.10 | |
ENV PLANTUML_VERSION=1.2022.4 | |
ENV LANG en_US.UTF-8 | |
RUN \ | |
apk add --no-cache graphviz wget ca-certificates && \ | |
apk add --no-cache graphviz wget ca-certificates ttf-dejavu fontconfig && \ | |
mkdir /app && \ | |
wget "https://github.com/plantuml/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-${PLANTUML_VERSION}.jar" -O /app/plantuml.jar && \ | |
apk del wget ca-certificates | |
RUN ["java", "-Djava.awt.headless=true", "-jar", "/app/plantuml.jar", "-version"] | |
RUN ["dot", "-version"] | |
ENTRYPOINT ["java", "-Djava.awt.headless=true", "-jar", "/app/plantuml.jar", "-p"] | |
CMD ["-tsvg"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIAGRAMS_SRC := $(wildcard *.plantuml) | |
DIAGRAMS_PNG := $(addsuffix .png, $(basename $(DIAGRAMS_SRC))) | |
DIAGRAMS_SVG := $(addsuffix .svg, $(basename $(DIAGRAMS_SRC))) | |
LOCAL_DATE := $(shell date "+%Y-%m-%d") | |
PWD := $(shell pwd) | |
png: build $(DIAGRAMS_PNG) | |
svg: build $(DIAGRAMS_SVG) | |
%.png: %.plantuml | |
cat $< | docker run -v $(PWD):/work -w /work --rm -i toastshaman/plantuml -tpng > ./$*-${LOCAL_DATE}.png | |
%.svg: %.plantuml | |
cat $< | docker run -v $(PWD):/work -w /work --rm -i toastshaman/plantuml > ./$*-${LOCAL_DATE}.svg | |
build: | |
docker build --build-arg plantuml_version=1.2022.4 -t toastshaman/plantuml:latest . | |
.PHONY: build png svg postbuild |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment