forked from tech-by-design/polyglot-prime
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.81 KB
/
udi-devl-rds.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
name: Synthetic Devl UDI schema generator
on:
workflow_dispatch:
inputs:
tag:
description: 'Polyglot Prime Tag Version'
required: true
jobs:
schema-generation:
runs-on: devl-techbd-sql
env:
SQL_AIDE_TAG: v0.14.9
steps:
- name: Running schema generation
run: echo "Running schema generation"
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .pgpass file
run: |
# Write the metadata comment to the .pgpass file
echo "# { id: \"DEVL_TECHBD_UDI_DS\", description: \"UDI Devl database \", boundary: \"Development\" }" > ~/.pgpass
# Append the database connection details to the .pgpass file
echo "${{ secrets.DEVL_TECHBD_UDI_DS_HOST }}:${{ secrets.DEVL_TECHBD_UDI_DS_PORT }}:${{ secrets.DEVL_TECHBD_UDI_DS_NAME }}:${{ secrets.DEVL_TECHBD_UDI_DS_USER }}:${{ secrets.DEVL_TECHBD_UDI_DS_PASSWORD }}" >> ~/.pgpass
# Set the .pgpass file permissions to 600 (read and write for owner only)
chmod 600 ~/.pgpass
- name: Clone SQL Aide repository
run: |
git clone --branch ${{ env.SQL_AIDE_TAG }} https://github.com/netspective-labs/sql-aide.git
- name: Navigate to SQL Aide and Generate ISLM SQL
run: |
cd sql-aide/lib/postgres/islm
chmod +x islmctl.ts
./islmctl.ts evolve up --conn-id DEVL_TECHBD_UDI_DS
- name: Run ISLM test
run: |
cd sql-aide/lib/postgres/islm
./islmctl.ts evolve test --conn-id DEVL_TECHBD_UDI_DS
- name: Display ISLM Test log
run: |
cd sql-aide/lib/postgres/islm
log_file=$(ls -t ./islmctl-test-*.log | head -n 1)
cat "$log_file"
- name: Clone Polyglot Prime repository
run: |
git clone -b ${{ inputs.tag }} https://github.com/tech-by-design/polyglot-prime.git
- name: Navigate to UDI Prime and Generate SQL
run: |
cd polyglot-prime/udi-prime
./udictl.ts ic generate sql
- name: Load SQL into database
run: |
cd polyglot-prime/udi-prime
./udictl.ts ic load-sql --conn-id DEVL_TECHBD_UDI_DS
- name: Display Load SQL log
run: |
cd polyglot-prime/udi-prime
log_file=$(ls -t ./udictl-load-sql-*.log | head -n 1)
cat "$log_file"
- name: Run UDI test
run: |
cd polyglot-prime/udi-prime
./udictl.ts ic test --conn-id DEVL_TECHBD_UDI_DS
- name: Run UDI Migrations
run: |
cd polyglot-prime/udi-prime
./udictl.ts ic migrate --conn-id DEVL_TECHBD_UDI_DS --is-linted false
- name: Display UDI Test log
run: |
cd polyglot-prime/udi-prime
log_file=$(ls -t ./udictl-test-*.log | head -n 1)
cat "$log_file"