Skip to content

Commit 9c5a403

Browse files
committed
refactor(plantuml): change plantuml renderer
Change plantuml renderer to locally render via docker container
1 parent 5be5b84 commit 9c5a403

File tree

5 files changed

+59
-7
lines changed

5 files changed

+59
-7
lines changed

.github/workflows/dev-documentation.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,51 @@ permissions:
1818
jobs:
1919
deploy:
2020
name: Deploy dev documentation
21-
runs-on: ubuntu-22.04
21+
runs-on: ubuntu-20.04-self-hosted
22+
env:
23+
RENDERER_NETWORK: renderer-net
24+
RENDERER_IMAGE: plantuml/plantuml-server:jetty-v1.2026.0
25+
RENDERER_CONTAINER_NAME: renderer
26+
RENDERER_REGISTRY: "registry.ps.tarantool.io/"
2227
defaults:
2328
run:
2429
working-directory: documentation
2530
steps:
2631
- uses: actions/checkout@v6
2732
with:
2833
fetch-depth: 0
34+
35+
- name: Docker login to private registry
36+
run: docker login "${{ secrets.PS_REGISTRY_URL }}" -u admin -p "${{ secrets.PS_REGISTRY_PASSWORD }}"
37+
38+
- name: Start renderer service locally
39+
run: |
40+
docker network create "$RENDERER_NETWORK"
41+
docker run -d -p 7036:8080 --name "$RENDERER_CONTAINER_NAME" --network "$RENDERER_NETWORK" ${RENDERER_REGISTRY}${RENDERER_IMAGE}
42+
2943
- name: Configure Git user
3044
run: |
3145
git config user.email "actions@github.com"
3246
git config user.name "GitHub Actions"
47+
3348
- name: Setup python
3449
uses: actions/setup-python@v5
3550
with:
3651
python-version: 3.x
3752
cache: 'pip'
53+
3854
- name: Download mkdocs plugins
3955
run: pip install -r requirements.txt
56+
4057
- name: Deploy documentation into gh-pages branch
4158
run: mike deploy dev --push
59+
4260
- name: Setup default version
4361
run: mike set-default dev --push
62+
63+
- name: Cleanup renderer container
64+
if: always()
65+
run: |
66+
docker rm -f "$RENDERER_CONTAINER_NAME"
67+
docker network rm -f "$RENDERER_NETWORK"
68+
docker rmi -f ${RENDERER_REGISTRY}${RENDERER_IMAGE}

.github/workflows/release-documentation.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ permissions:
2020
jobs:
2121
deploy:
2222
name: Deploy release documentation
23-
runs-on: ubuntu-22.04
23+
runs-on: ubuntu-20.04-self-hosted
24+
env:
25+
RENDERER_NETWORK: renderer-net
26+
RENDERER_IMAGE: plantuml/plantuml-server:jetty-v1.2026.0
27+
RENDERER_CONTAINER_NAME: renderer
28+
RENDERER_REGISTRY: "registry.ps.tarantool.io/"
2429
steps:
2530
- name: Validate semver tag format
2631
id: validate-tag
@@ -38,12 +43,21 @@ jobs:
3843
echo "✅ Valid tag: $TAG"
3944
echo "Version for docs: $VERSION"
4045
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
4147
- name: Checkout repository with tag
4248
uses: actions/checkout@v6
4349
with:
4450
ref: "${{ github.event.inputs.tag }}"
4551
fetch-depth: 0
4652

53+
- name: Docker login to private registry
54+
run: docker login "${{ secrets.PS_REGISTRY_URL }}" -u admin -p "${{ secrets.PS_REGISTRY_PASSWORD }}"
55+
56+
- name: Start renderer service locally
57+
run: |
58+
docker network create "$RENDERER_NETWORK"
59+
docker run -d -p 7036:8080 --name "$RENDERER_CONTAINER_NAME" --network "$RENDERER_NETWORK" ${RENDERER_REGISTRY}${RENDERER_IMAGE}
60+
4761
- name: Configure Git user
4862
run: |
4963
git config user.email "actions@github.com"
@@ -66,3 +80,10 @@ jobs:
6680
# env:
6781
# # Для дебага, если нужно
6882
# MIKE_VERBOSE: 1
83+
84+
- name: Cleanup renderer container
85+
if: always()
86+
run: |
87+
docker rm -f "$RENDERER_CONTAINER_NAME"
88+
docker network rm -f "$RENDERER_NETWORK"
89+
docker rmi -f ${RENDERER_REGISTRY}${RENDERER_IMAGE}

documentation/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
source venv/bin/activate
1414
pip install -r requirements.txt
1515
```
16-
17-
2. Соберите или запустите сайт:
16+
2. Необходим `docker`. Запустите сервер рендеринга локально:
17+
```shell
18+
docker run -d -p 7036:8080 plantuml/plantuml-server:jetty-v1.2026.0
19+
```
20+
3. Соберите или запустите сайт:
1821

1922
```shell
2023
mkdocs build

documentation/README_EN.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ To deploy documentation locally on current branch/tag:
1313
source venv/bin/activate
1414
pip install -r requirements.txt
1515
```
16-
17-
2. Build or serve site:
16+
2. Requires `docker`. Start the render server locally:
17+
```shell
18+
docker run -d -p 7036:8080 plantuml/plantuml-server:jetty-v1.2026.0
19+
```
20+
3. Build or serve site:
1821

1922
```shell
2023
mkdocs build

documentation/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ plugins:
4747
- drawio:
4848
darkmode: true
4949
- plantuml:
50-
puml_url: https://www.plantuml.com/plantuml/
50+
puml_url: http://localhost:7036
5151
# в секундах(in seconds)
5252
request_timeout: 300
5353

0 commit comments

Comments
 (0)