From 046794ddf2c7d17d58e2be1b44803ea8564aa074 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:24:55 +0100 Subject: [PATCH] test drone 4 --- .drone.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3c18d8d..c133e4c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,12 +3,11 @@ type: docker name: default steps: - # 1. Déploiement du conteneur PostgreSQL - name: deploy-container-postgres image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest environment: - IMAGENAME: postgres:13 # Choix de l'image PostgreSQL - CONTAINERNAME: mypostgres # Nom du conteneur + IMAGENAME: postgres:13 + CONTAINERNAME: mypostgres COMMAND: create PRIVATE: true CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: @@ -18,19 +17,15 @@ steps: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: from_secret: db_database - # 2. Initialisation de la base de données avec 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 - + - name: init-database + image: postgres:13 + environment: + PGPASSWORD: + from_secret: db_password + PGUSER: + from_secret: db_user + PGDATABASE: + from_secret: db_database + commands: + - until pg_isready -h mypostgres -U postgres; do sleep 1; done + - psql -h mypostgres -U postgres -d wikifantasy -f scripts/init.sql