Skip to content

Commit

Permalink
feat: SchemaSpy shared workflow (#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Nov 13, 2024
1 parent 75e2926 commit 9f87a8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
with:
cleanup: helm
packages: backend frontend migrations

cleanup_db: # TODO move it off to another action later.
name: Remove DB User from crunchy.
name: Remove DB User from crunchy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
name: Checkout
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -39,7 +39,7 @@ jobs:
oc login --token=$OC_TEMP_TOKEN --server=https://api.silver.devops.gov.bc.ca:6443
oc project ${{ secrets.oc_namespace }} # Safeguard!
- name: Remove PR user and database from crunchy.
- name: Remove PR user and database from crunchy
shell: bash
run: |
# check if postgres-crunchy exists or else exit
Expand Down
45 changes: 4 additions & 41 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,48 +54,11 @@ jobs:
fi
done
generate-schema-spy:
name: Generate SchemaSpy Documentation
runs-on: ubuntu-24.04
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_DB: default
POSTGRES_USER: postgres
POSTGRES_PASSWORD: default
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Flyway
uses: docker://flyway/flyway:10
env:
FLYWAY_URL: jdbc:postgresql://postgres:5432/default
FLYWAY_USER: postgres
FLYWAY_PASSWORD: default
FLYWAY_LOCATIONS: filesystem:./migrations
FLYWAY_DEFAULT_SCHEMA: "users"
with:
args: info migrate info
# https://github.com/bcgov/quickstart-openshift-helpers
schema-spy:
name: SchemaSpy Documentation
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected]

- name: Create Output Folder
run: |
mkdir output
chmod a+rwx -R output
- name: Run Schemaspy
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:6.2.4 -t pgsql11 -db default -host 127.0.0.1 -port 5432 -u postgres -p default -schemas users
- name: Deploy to Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: output
target-folder: schemaspy

tests:
name: Tests
Expand Down

0 comments on commit 9f87a8c

Please sign in to comment.