From 484ff86b0a30dca81d0d942f03add26b42d544b6 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:18:44 +0100 Subject: [PATCH 1/9] test drone --- .drone.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index f3ce6f5..626af04 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,26 +1,32 @@ kind: pipeline type: docker -name: Deploiement - -trigger: - event: - - push +name: default steps: - - name: deploy-container-postgresql + # 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:17-alpine - CONTAINERNAME: wf-database + IMAGENAME: postgres:13 # Choix de l'image PostgreSQL + CONTAINERNAME: mypostgres # Nom du conteneur COMMAND: create - OVERWRITE: false PRIVATE: true CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: - from_secret: POSTGRES_PASSWORD - CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: - from_secret: POSTGRES_DB + from_secret: db_password CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER: - from_secret: POSTGRES_USER - CODEFIRST_CLIENTDRONE_ENV_TRAEFIK_LABELS: true - ADMINS: marocher8, maximerocher , kentinbrongniart + from_secret: db_user + 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: + # 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 From f5ace6ba1b613d299adfec3da8c0d9674293a8ce Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:20:31 +0100 Subject: [PATCH 2/9] 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 + From 96291af54909f545de785d9cc8d3ea66fe46a22a Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:21:06 +0100 Subject: [PATCH 3/9] test drone 3 --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index abf43f9..3c18d8d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,7 +30,7 @@ steps: from_secret: db_database commands: # Attendre que le service PostgreSQL soit disponible - - until pg_isready -h mypostgres -U "$POSTGRES_USER"; do sleep 1; done + - 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 From 046794ddf2c7d17d58e2be1b44803ea8564aa074 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:24:55 +0100 Subject: [PATCH 4/9] 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 From 42b02222c3245cd6fc32b634b40f766347497d90 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:26:46 +0100 Subject: [PATCH 5/9] test drone 5 --- .drone.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index c133e4c..3759bcf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ steps: image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest environment: IMAGENAME: postgres:13 - CONTAINERNAME: mypostgres + CONTAINERNAME: dbWikiFantasy COMMAND: create PRIVATE: true CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: @@ -18,7 +18,7 @@ steps: from_secret: db_database - name: init-database - image: postgres:13 + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest environment: PGPASSWORD: from_secret: db_password @@ -27,5 +27,9 @@ steps: 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 + # Installer le client PostgreSQL + - apk update && apk add postgresql-client + # Attendre que PostgreSQL soit prêt + - until pg_isready -h dbWikiFantasy -U postgres; do sleep 1; done + # Exécuter le script d'initialisation + - psql -h dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql From 1ee499c8c934a79202134131a03096727cc4ba5e Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:27:48 +0100 Subject: [PATCH 6/9] test drone 5 --- .drone.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3759bcf..9695a73 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,19 +17,17 @@ steps: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: from_secret: db_database - - name: init-database - image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest - environment: - PGPASSWORD: - from_secret: db_password - PGUSER: - from_secret: db_user - PGDATABASE: - from_secret: db_database - commands: - # Installer le client PostgreSQL - - apk update && apk add postgresql-client - # Attendre que PostgreSQL soit prêt - - until pg_isready -h dbWikiFantasy -U postgres; do sleep 1; done - # Exécuter le script d'initialisation - - psql -h dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql +- name: init-database + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest + environment: + PGPASSWORD: + from_secret: db_password + PGUSER: + from_secret: db_user + PGDATABASE: + from_secret: db_database + commands: + - apt-get update && apt-get install -y postgresql-client + - until pg_isready -h dbWikiFantasy -U "$PGUSER"; do sleep 1; done + - psql -h dbWikiFantasy -U "$PGUSER" -d "$PGDATABASE" -f script/init.sql + From 061a6134e2928720a50a2a179cd95655e830af3d Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:29:43 +0100 Subject: [PATCH 7/9] test drone 6 --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 9695a73..79af290 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,5 +29,5 @@ steps: commands: - apt-get update && apt-get install -y postgresql-client - until pg_isready -h dbWikiFantasy -U "$PGUSER"; do sleep 1; done - - psql -h dbWikiFantasy -U "$PGUSER" -d "$PGDATABASE" -f script/init.sql + - psql -h dbWikiFantasy -U "$PGUSER" -d "$PGDATABASE" -f script/init.sql From da3669f829a5d23987caf4c4520e3b828f912456 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:30:48 +0100 Subject: [PATCH 8/9] test drone 8 --- .drone.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index 79af290..aeb1e4a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,17 +17,16 @@ steps: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: from_secret: db_database -- name: init-database - image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest - environment: - PGPASSWORD: - from_secret: db_password - PGUSER: - from_secret: db_user - PGDATABASE: - from_secret: db_database - commands: - - apt-get update && apt-get install -y postgresql-client - - until pg_isready -h dbWikiFantasy -U "$PGUSER"; do sleep 1; done - - psql -h dbWikiFantasy -U "$PGUSER" -d "$PGDATABASE" -f script/init.sql - + - name: init-database + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest + environment: + PGPASSWORD: + from_secret: db_password + PGUSER: + from_secret: db_user + PGDATABASE: + from_secret: db_database + commands: + - apt-get update && apt-get install -y postgresql-client + - until pg_isready -h dbWikiFantasy -U postgres; do sleep 1; done + - psql -h dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql From c926103500d648bd9f809a5261f7ba42e0fbfbd7 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:32:27 +0100 Subject: [PATCH 9/9] test drone 9 --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index aeb1e4a..2d986e7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,5 +28,5 @@ steps: from_secret: db_database commands: - apt-get update && apt-get install -y postgresql-client - - until pg_isready -h dbWikiFantasy -U postgres; do sleep 1; done - - psql -h dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql + - until pg_isready -h marocher8-dbWikiFantasy -U postgres; do sleep 1; done + - psql -h marocher8-dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql