FIX: usa variáveis PG* no step de migrations
Some checks failed
Deploy Dev / Deploy para VM Dev (push) Failing after 4s
Some checks failed
Deploy Dev / Deploy para VM Dev (push) Failing after 4s
This commit is contained in:
parent
aaebed359e
commit
e2892d1df5
@ -51,15 +51,17 @@ jobs:
|
||||
- name: Executar migrations
|
||||
shell: bash
|
||||
env:
|
||||
PGHOST: ${{ secrets.DB_HOST }}
|
||||
PGPORT: ${{ secrets.DB_PORT }}
|
||||
PGUSER: ${{ secrets.DB_USER }}
|
||||
PGDATABASE: ${{ secrets.DB_NAME }}
|
||||
PGPASSWORD: ${{ secrets.DB_PASSWORD }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "Testando conectividade com o banco..."
|
||||
psql -c '\conninfo'
|
||||
echo "Aplicando migrations..."
|
||||
for f in $(ls "$DEPLOY_PATH/database/migrations/"*.sql | sort); do
|
||||
echo "Aplicando: $(basename "$f")"
|
||||
psql \
|
||||
-h ${{ secrets.DB_HOST }} \
|
||||
-p ${{ secrets.DB_PORT }} \
|
||||
-U ${{ secrets.DB_USER }} \
|
||||
-d ${{ secrets.DB_NAME }} \
|
||||
-f "$f"
|
||||
psql -f "$f"
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user