diff --git a/.drone.yml b/.drone.yml index 626af04..abf43f9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,14 +19,18 @@ steps: from_secret: db_database # 2. Initialisation de la base de données avec init.sql - - name: init-database - image: postgres:13 - environment: - # Utilisation des mêmes secrets pour se connecter - PGPASSWORD: - from_secret: db_password - commands: - # Attendre que le service PostgreSQL soit disponible - - until pg_isready -h mypostgres -U ${POSTGRES_PASSWORD}; do sleep 1; done - # Exécuter le script d'initialisation - - psql -h mypostgres -U ${POSTGRES_USER} -d ${POSTGRES_PASSWORD} -f init.sql +- name: init-database + image: postgres:13 + environment: + PGPASSWORD: + from_secret: db_password + PGUSER: + from_secret: db_user + PGDATABASE: + from_secret: db_database + commands: + # Attendre que le service PostgreSQL soit disponible + - until pg_isready -h mypostgres -U "$POSTGRES_USER"; do sleep 1; done + # Exécuter le script d'initialisation + - psql -h mypostgres -U "$POSTGRES_USER" -d "$POSTGRES_DB" -f init.sql +