Update DB config
continuous-integration/drone/push Build is failing Details

main
Félix MIELCAREK 11 months ago
parent ad9e6c74a3
commit 1b7e8c601b

@ -28,6 +28,8 @@ steps:
- pip install psycopg2 - pip install psycopg2
- python3 db-creation.py - python3 db-creation.py
environment: environment:
POSTGRES_ROOT_PASSWORD: POSTGRES_USER:
from_secret: db_root_password from_secret: db_user
POSTGRES_PASSWORD:
from_secret: db_password
depends_on: [ deploy-container-pgsql ] depends_on: [ deploy-container-pgsql ]

@ -2,13 +2,14 @@ import os
import psycopg2 import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
env_root_password = os.getenv('POSTGRES_ROOT_PASSWORD') env_user = os.getenv('POSTGRES_USER')
env_password = os.getenv('POSTGRES_PASSWORD')
# Establish connection to the PostgreSQL database # Establish connection to the PostgreSQL database
conn = psycopg2.connect( conn = psycopg2.connect(
dbname="postgres", dbname="postgres",
user="postgres", user=env_user,
password=env_root_password, password=env_password,
host="felixmielcarek-bigbrotherdb" host="felixmielcarek-bigbrotherdb"
) )
conn.autocommit = True conn.autocommit = True

Loading…
Cancel
Save