Skip to content

Commit

Permalink
carbon gray theme w docker and new plantuml jar
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatrajagopalan committed Jul 16, 2022
1 parent 7c664f9 commit ee1629f
Show file tree
Hide file tree
Showing 47 changed files with 51,757 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:17-alpine
RUN \
apk update && \
apk upgrade && \
apk add --no-cache \
graphviz \
font-noto-cjk \
&& \
rm -rf /var/cache/apk/*
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THEME=$1
#PLANT=~/devcontent/bin/plantuml.1.2020.0.jar
#PLANT=~/devcontent/bin/plantuml.1.2020.8.jar
#PLANT=~/devcontent/bin/plantuml-beta.jar
PLANT=bin/plantuml.1.2021.1.jar
PLANT=bin/plantuml-1.2022.6.jar

##
## Build the examples for each type of diagram
Expand Down
2 changes: 1 addition & 1 deletion bin/buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#PLANT=~/devcontent/bin/plantuml.1.2019.12.jar
#PLANT=~/devcontent/bin/plantuml.1.2020.0.jar
#PLANT=~/devcontent/bin/plantuml.1.2020.8.jar
PLANT=bin/plantuml.1.2021.1.jar
PLANT=bin/plantuml-1.2022.6.jar

##
## examples for each type of diagram
Expand Down
Binary file added bin/plantuml-1.2022.6.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.3'

services:
puml-themes:
build:
context: .
dockerfile: Dockerfile
container_name: puml-themes
working_dir: /puml-themes
command: ['/bin/sh', '-c', '[ -z ${THEME} ] || [ ${THEME} = "all" ] && echo "set the THEME variable to build desired theme; Building all themes" && bin/buildall.sh || bin/build.sh ${THEME}']
volumes:
- .:/puml-themes
stdin_open: true
tty: true
privileged: true
23 changes: 23 additions & 0 deletions examples/activity-ex2.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml

!if %variable_exists("$THEME")
title Activity Diagram - $THEME theme
!else
title Activity Diagram
!endif

start
:init;
-> test of color;
if (color?) is (<color:red>red) then
:print red;
else
:print not red;
note right: no color
endif
partition End {
:end;
}
-> this is the end;
end
@enduml
44 changes: 44 additions & 0 deletions rolling.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,47 @@ This will save the images into the theme directory.
9. Submit a pull request for the new theme, or you can host it on your own if you want.

Cheers!

## Using docker to trigger image build

This creates a small alpine based container with graphviz and related dependencies to run the `build.sh` or `buildall.sh` commands to generate images for your theme or for all themes

First build your image
```
docker-compose build
```

Then Create an `.env` file in your workspace with the contents as below; set the THEME variable to the name of your theme

```
# Specify theme name to be built
# Leave blank or set to 'all' to build all themes
THEME=
```

Example: to build the carbon-gray theme

```
# Specify theme name to be built
# Leave blank or set to 'all' to build all themes
THEME=carbon-gray
```

then run
```
docker-compose up
```

This will generate images for your specific theme or all themes if left blank

You can also do the following in lieu of creating a `.env` file

```
THEME=carbon-gray docker-compose up
```

To destroy the container

```
docker-compose down
```
Loading

0 comments on commit ee1629f

Please sign in to comment.