Skip to content

Commit

Permalink
fix: env var for db update
Browse files Browse the repository at this point in the history
  • Loading branch information
cka-y committed Jan 8, 2024
1 parent efb4fc0 commit 5c092ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/db-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ jobs:

- name: Update .env file
run: |
echo "POSTGRES_USER=${{ secrets.DB_USER_NAME }}" > config/.env.local
echo "PGUSER=${{ secrets.DB_USER_NAME }}" >> config/.env.local
echo "POSTGRES_PASSWORD=${{ secrets.DB_USER_PASSWORD }}" >> config/.env.local
echo "POSTGRES_DB=${{ inputs.DB_NAME }}" >> config/.env.local
echo "POSTGRES_PORT=5432" >> config/.env.local
echo "POSTGRES_HOST=${{ env.DB_IP }}" >> config/.env.local
echo "FEEDS_DATABASE_URL=postgresql://${{ secrets.DB_USER_NAME }}:${{ secrets.DB_USER_PASSWORD }}@${{ env.DB_IP }}:5432/${{ inputs.DB_NAME }}" >> config/.env.local
echo "ENV=dev" >> config/.env.local
cat config/.env.local
Expand Down
2 changes: 2 additions & 0 deletions api/src/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def __init__(self):
self.session = None
self.connection_attempts = 0
self.SQLALCHEMY_DATABASE_URL = os.getenv("FEEDS_DATABASE_URL")
print(80 * '*')
print(self.SQLALCHEMY_DATABASE_URL)
print(80 * '*')
self.start_session()

def is_connected(self):
Expand Down

0 comments on commit 5c092ee

Please sign in to comment.