Skip to content

Commit

Permalink
Change diagram generation strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiobotaro committed Mar 29, 2024
1 parent 32d9921 commit 6eafba5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
repo: [relacionamentos, icones, cms, imersaofc, intencoes, maonamassa, niveis, ]
permissions:
contents: write
container:
Expand All @@ -18,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- name: Generate diagrams
run: |
bash scripts/gerar-diagramas.sh ${{ matrix.repo }}
bash scripts/gerar-diagramas.sh
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
17 changes: 9 additions & 8 deletions scripts/gerar-diagramas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ function _gerar_markdown() {
echo ""
}

nome=$1
lista=(relacionamentos icones cms imersaofc intencoes maonamassa niveis)
for nome in "${lista[@]}"; do
/usr/local/structurizr-cli/structurizr.sh export \
-format mermaid \
-workspace "$nome"/"$nome".dsl

/usr/local/structurizr-cli/structurizr.sh export \
-format mermaid \
-workspace "$nome"/"$nome".dsl

[ -f "$nome"/diagramas.md ] && rm "$nome"/diagramas.md
for arquivo_mmd in "$nome"/*.mmd; do
_gerar_markdown "$arquivo_mmd" >>"$nome"/diagramas.md
[ -f "$nome"/diagramas.md ] && rm "$nome"/diagramas.md
for arquivo_mmd in "$nome"/*.mmd; do
_gerar_markdown "$arquivo_mmd" >>"$nome"/diagramas.md
done
done

0 comments on commit 6eafba5

Please sign in to comment.