From 2251f0a286cfb6e6bf951bfb193867cc78bd315e Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Thu, 29 Sep 2022 19:16:00 +0200 Subject: [PATCH 1/3] Create structure to build UML diagrams for GH pages Signed-off-by: Christian Wolf --- .github/workflows/pages.yml | 20 ++++++++++++++++++++ docs/Makefile | 17 ++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 16d81d9cd..5cd36edad 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,6 +22,10 @@ concurrency: group: "pages" cancel-in-progress: true +defaults: + run: + shell: bash + jobs: # Build job build: @@ -31,6 +35,22 @@ jobs: uses: actions/checkout@v3 - name: Setup Pages uses: actions/configure-pages@v2 + + - name: Count number of plantuml files + id: count-plantuml + run: | + count=$(find docs/ -name \*.puml | wc -l) + echo "There are $count number of plantuml files" + echo "::set-output name=num::$count" + - name: Install PlantUML on demand + if: steps.count-plantuml.outputs.num > 0 + run: | + apt-get update + apt-get install --no-install-recommends plantuml + - name: Build PlantUML images + if: steps.count-plantuml.outputs.num > 0 + run: make -C docs build-uml-svg + - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 with: diff --git a/docs/Makefile b/docs/Makefile index e3a068b82..5608ade74 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,10 +2,13 @@ BUNDLER=bundler HOST=127.0.0.1 +PLANTUML_SRC=$(shell find -name \*.puml ! -path ./_site/\*) +PLANTUML_DST_SVG=${PLANTUML_SRC:%.puml=%.svg} + .PHONY: all all: help -.PHONY: help watch build install +.PHONY: help watch build install build-uml-svg help: @echo "Make tragets supported:" @@ -23,3 +26,15 @@ watch: install: ${BUNDLER} install +build-uml-svg: +ifeq ($(strip ${PLANTUML_SRC}),) + @echo 'No plantuml files were found. Skipping.' +else + ${MAKE} ${PLANTUML_DST_SVG} +endif + +%.svg: %.puml + plantuml -tsvg $< + +%.png: %.puml + plantuml -tpng $< From 9b28d24bd4291cb60df7c114e34f672e65a4ed62 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Thu, 29 Sep 2022 19:27:04 +0200 Subject: [PATCH 2/3] Fix problems in workflow scripts Signed-off-by: Christian Wolf --- .github/workflows/pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5cd36edad..e72dd373c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -40,13 +40,13 @@ jobs: id: count-plantuml run: | count=$(find docs/ -name \*.puml | wc -l) - echo "There are $count number of plantuml files" + echo "There are $count plantuml files" echo "::set-output name=num::$count" - name: Install PlantUML on demand if: steps.count-plantuml.outputs.num > 0 run: | - apt-get update - apt-get install --no-install-recommends plantuml + sudo apt-get update + sudo apt-get install --no-install-recommends -y plantuml - name: Build PlantUML images if: steps.count-plantuml.outputs.num > 0 run: make -C docs build-uml-svg From 422dcc6a24f2ff8ad4464681f1ed53e3270d54b7 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Fri, 30 Sep 2022 09:12:56 +0200 Subject: [PATCH 3/3] Update changelog Signed-off-by: Christian Wolf --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ecd0073f..9d2af196a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ [#1224](https://github.com/nextcloud/cookbook/pull/1224) @christianlupus - Remove obsolete code from Recipe service class [#1226](https://github.com/nextcloud/cookbook/pull/1226) @christianlupus +- Allow for PlantUML diagrams in documentation + [#1229](https://github.com/nextcloud/cookbook/pull/1229) @christianlupus ### Removed - Remove the deprecated endpoints from version 0.9.15