Skip to content

Commit e6c5d9d

Browse files
committed
feat: Added tables creation and population
1 parent ba12468 commit e6c5d9d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/cd-base.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ jobs:
6969
7070
- name: Create tables and populate (tickets table not existent)
7171
if: steps.check_table.outputs.table_exist == 'f'
72-
run: echo ""
72+
env:
73+
PGPASSWORD: ${{ secrets.DB_PASSWORD }}
74+
run: |
75+
# if something fails stop
76+
set -e
77+
for file in $(ls src/db/scripts*.sql | sort -V); do
78+
echo "> Executing: $file"
79+
psql -h ${{ steps.db.outputs.public_ip }} -U ${{ secrets.DB_USER }} -d ${{ secrets.DB_NAME }} -f "$file" -v ON_ERROR_STOP=1
80+
done
7381
7482
- name: Skipped table creation (existent tickets table)
7583
if: steps.check_table.outputs.table_exist == 't'

0 commit comments

Comments
 (0)