From f5ace6ba1b613d299adfec3da8c0d9674293a8ce Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:20:31 +0100 Subject: [PATCH] test drone 2 --- .drone.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) 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 +