-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (83 loc) · 3.67 KB
/
reusable_data_model_gen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Data Model Generator
on:
workflow_dispatch:
workflow_call:
jobs:
vars:
name: Set Variables
outputs:
user: ${{ steps.data.outputs.user }}
pass: ${{ steps.data.outputs.pass }}
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Generate random username and password
id: data
run: |
USERNAME="user$(shuf -i 1000-9999 -n 1)"
PASSWORD=$(openssl rand -base64 12)
echo "user=$USERNAME" >> $GITHUB_OUTPUT
echo "pass=$PASSWORD" >> $GITHUB_OUTPUT
schemaspy:
name: Generate Documentation
runs-on: ubuntu-latest
needs: [vars]
services:
postgres:
image: postgres:14.13-alpine
env:
POSTGRES_DB: fam
POSTGRES_USER: ${{ needs.vars.outputs.user }}
POSTGRES_PASSWORD: ${{ needs.vars.outputs.pass }}
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/fam
FLYWAY_USER: ${{ needs.vars.outputs.user }}
FLYWAY_PASSWORD: ${{ needs.vars.outputs.pass }}
FLYWAY_LOCATIONS: filesystem:./server/flyway/sql
FLYWAY_DEFAULT_SCHEMA: "app_fam"
FLYWAY_BASELINE_ON_MIGRATE: true
FLYWAY_PLACEHOLDERS_api_db_username: fam_proxy_api
FLYWAY_PLACEHOLDERS_api_db_password: test
FLYWAY_PLACEHOLDERS_admin_management_api_db_user: fam_admin_management_api
FLYWAY_PLACEHOLDERS_admin_management_api_db_password: test
FLYWAY_PLACEHOLDERS_client_id_fom_public: "nolongerinuse1"
FLYWAY_PLACEHOLDERS_client_id_fom_ministry: "nolongerinuse2"
FLYWAY_PLACEHOLDERS_client_id_fam_console: 26tltjjfe7ktm4bte7av998d78
FLYWAY_PLACEHOLDERS_client_id_dev_fom_oidc_client: 1a8pkq0psq0daj5e6ir3ppcjkj
FLYWAY_PLACEHOLDERS_client_id_test_fom_oidc_client: 7b6eki43nahus9ca0lhjs6m568
FLYWAY_PLACEHOLDERS_client_id_prod_fom_oidc_client: 1rhdfiek5ntmk2kg39d6e31p46
FLYWAY_PLACEHOLDERS_client_id_dev_spar_oidc_client: xxqiHFmwG8j1cVAz7NgtknaZOt
FLYWAY_PLACEHOLDERS_client_id_test_spar_oidc_client: dm5Xkmomnq0gbwBiXiN5LgAna2
FLYWAY_PLACEHOLDERS_client_id_prod_spar_oidc_client: KdnD2eGS3Zcx494p04yMFhDwSf
FLYWAY_PLACEHOLDERS_client_id_dev_forest_client_oidc_client: xxqiHFmwG8j1cVAz7NgtknaZOg
FLYWAY_PLACEHOLDERS_client_id_test_forest_client_oidc_client: dm5Xkmomnq0gbwBiXiN5LgAnah
FLYWAY_PLACEHOLDERS_client_id_prod_forest_client_oidc_client: KdnD2eGS3Zcx494p04yMFhDwSe
FLYWAY_PLACEHOLDERS_client_id_dev_silva_oidc_client: xxqiHFmwG8j1cVAz7NgtknaZO5
FLYWAY_PLACEHOLDERS_client_id_test_silva_oidc_client: dm5Xkmomnq0gbwBiXiN5LgAna5
FLYWAY_PLACEHOLDERS_client_id_prod_silva_oidc_client: KdnD2eGS3Zcx494p04yMFhDwS5
FLYWAY_PLACEHOLDERS_auth_lambda_db_user: fam_auth_lambda
FLYWAY_PLACEHOLDERS_auth_lambda_db_password: test
with:
args: info migrate info
- name: Create Output Folder
run: |
mkdir -p 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 fam -host 127.0.0.1 -port 5432 -u ${{ needs.vars.outputs.user }} -p ${{ needs.vars.outputs.pass }} -schemas app_fam
- name: Deploy to Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: output