Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing #34 Created a script to auto generate the uml and ER diagrams #35

Merged
merged 3 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/diagrams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Generate Diagrams

on:
push:
paths: [ '**.plantuml' ]
branches: [ "main" ]
pull_request:
paths: [ '**.plantuml' ]
branches: [ "main" ]

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run ./generate_diagrams.sh
run: |
chmod +x ./generate_diagrams.sh
./generate_diagrams.sh
shell: bash
Binary file modified diagrams/Milestone1_ER_Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagrams/Milestone1_UML_Class_Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed diagrams/Milestone1_UML_class_diagram.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
@startuml
@startuml Milestone1_ER_Diagram
skinparam classFontSize 11
skinparam classBackgroundColor beige
skinparam ClassBorderColor red
skinparam ArrowColor red

entity "Answer" as answer {
*id : Long
*content : String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@startuml Milestone1_UML_class_diagram
@startuml Milestone1_UML_Class_Diagram
skinparam classFontSize 11
skinparam classBackgroundColor beige
skinparam ClassBorderColor red
Expand Down
23 changes: 23 additions & 0 deletions generate_diagrams.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

input_directory="./diagrams/plantUmlFiles"

plantuml="./tools/plantuml.jar"

if [ $(which dot 2>/dev/null) ]; then
echo "Found GraphViz"
else
echo "Did not find GraphViz"
sudo apt install graphviz
fi

for file in "$input_directory"/*.plantuml; do
if [ -f "$file" ]; then
java -jar "$plantuml" "$file" -o "../"
if [ $? != 0 ]; then
raise error "Failed to generate the diagram"
fi
fi
done

echo "Successfully Generated the Diagrams"
Binary file added tools/plantuml.jar
Binary file not shown.