Skip to content

Commit

Permalink
use Docker version of schemaspy + simplfiy compose
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 7, 2023
1 parent fe36615 commit 0350fc0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
21 changes: 20 additions & 1 deletion .docker/docker-compose.qgis.yml → .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3'

services:
signalo:
build:
Expand All @@ -10,7 +11,7 @@ services:
- ${SOURCE_DIR}:/usr/src
ports:
# making the postgres database accessible for debugging
- 5432:5432
- ${SIGNALO_PG_PORT:-5432}:${SIGNALO_PG_PORT:-5432}

qgis:
image: opengisch/qgis
Expand All @@ -20,3 +21,21 @@ services:
- ./.pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
links:
- signalo
profiles:
- qgis

schemaspy:
image: schemaspy/schemaspy
volumes:
- ../data_model/schemaspy:/output
- ../data_model/schemaspy.properties:/schemaspy.properties
depends_on:
- signalo
network_mode: "service:signalo"
command: [
"-configFile",
"/schemaspy.properties"
]
user: "${UID}:${GID}"
profiles:
- schemaspy
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
# ----------------------
# Define POSTGRES PORT for Docker when calling datamodel/scripts/run-docker.sh
SIGNALO_PG_PORT=5432

# fix access rights for schemaspy
UID=1000
GID=1001
33 changes: 14 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
DOCKER_TAG: stable
COMPOSE_FILE: .docker/docker-compose.qgis.yml
COMPOSE_FILE: .docker/docker-compose.yml

steps:
- name: Checkout code
Expand All @@ -29,18 +29,18 @@ jobs:
- name: Docker build
run: |
export SOURCE_DIR=$(pwd)
docker compose up --build -d
docker compose exec -T signalo init_db.sh wait
docker compose --profile qgis --profile schemaspy up --build -d
docker compose exec signalo init_db.sh wait
- name: create dumps
run: |
export SOURCE_DIR=$(pwd)
docker compose exec -T signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump.backup signalo
docker compose exec -T signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump.sql signalo
docker compose exec -T signalo pg_dump --format plain --schema=signalo_app --file signalo-${{ github.event.release.tag_name }}-db-app.sql signalo
docker compose exec -T signalo init_db.sh build -d
docker compose exec -T signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.backup signalo
docker compose exec -T signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.sql signalo
docker compose exec signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump.backup signalo
docker compose exec signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump.sql signalo
docker compose exec signalo pg_dump --format plain --schema=signalo_app --file signalo-${{ github.event.release.tag_name }}-db-app.sql signalo
docker compose exec signalo init_db.sh build -d
docker compose exec signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.backup signalo
docker compose exec signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.sql signalo
- name: translate project
run: |
Expand All @@ -58,20 +58,15 @@ jobs:
cp data_model/demo_data/this-is-the-way.jpg project/this-is-the-way.jpg
zip -r signalo-${{ github.event.release.tag_name }}-project.zip project README.md
- name: "zip changelogs"
- name: zip changelogs
run: |
zip -r signalo-${{ github.event.release.tag_name }}-changelogs.zip data_model/changelogs
- name: SchemaSpy
- name: schemaspy
run: |
sudo apt-get install -y openjdk-8-jdk graphviz
wget https://github.com/schemaspy/schemaspy/releases/download/v6.1.0/schemaspy-6.1.0.jar
wget https://jdbc.postgresql.org/download/postgresql-42.2.24.jar -O postgresql.jar
java -jar schemaspy-6.1.0.jar -t pgsql -db signalo -u postgres -host localhost -p postgres \
-schemas signalo_db,signalo_app -norows \
-hq -o model-documentation -dp postgresql.jar \
-desc "signalo data model documentation (version ${{ github.event.release.tag_name }})"
zip -r signalo-${{ github.event.release.tag_name }}-model-documentation.zip model-documentation/*
sed -i "s/version dev/version ${{ github.event.release.tag_name }}/" data_model/schemaspy.properties
docker compose run schemaspy
zip -r signalo-${{ github.event.release.tag_name }}-model-documentation.zip datamodel/schemaspy/*
- name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand Down
8 changes: 8 additions & 0 deletions data_model/schemaspy.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schemaspy.t=pgsql11
schemaspy.host=signalo
schemaspy.port=5432
schemaspy.db=signalo
schemaspy.u=postgres
schemaspy.p=postgres
schemaspy.schemas=signalo_db,signalo_app
schemaspy.desc='signalo data model documentation (version dev)'

0 comments on commit 0350fc0

Please sign in to comment.