From 484ff86b0a30dca81d0d942f03add26b42d544b6 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:18:44 +0100 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 05/11] 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 06/11] 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 07/11] 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 08/11] 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 09/11] 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 From 5daba67bf553144efdf8aa45a12282923ae46034 Mon Sep 17 00:00:00 2001 From: beaulaton Date: Fri, 10 Jan 2025 11:33:38 +0100 Subject: [PATCH 10/11] Changement image --- insert_all_data.sql | 33 +++++++++++++++++---------------- scripts/init.sql | 28 ++++++++++++++-------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/insert_all_data.sql b/insert_all_data.sql index 96116e2..7ed3f3c 100755 --- a/insert_all_data.sql +++ b/insert_all_data.sql @@ -6,10 +6,10 @@ INSERT INTO Image (id_img, imgPath) VALUES (4, 'https://tse4.mm.bing.net/th/id/O INSERT INTO Image (id_img, imgPath) VALUES (5, 'https://tse2.mm.bing.net/th/id/OIP.CthWIxuLm0a8THOguTDB_AAAAA?w=157&h=207&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (6, 'https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (7, 'https://tse1.mm.bing.net/th/id/OIP.luN_zVQJt2Kyf7H_kSrPyQHaJD?w=115&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (8, 'https://tse1.mm.bing.net/th/id/OIP.GPIbva8dEP6Kllx-sj5ysAHaK-?w=115&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (9, 'https://tse4.mm.bing.net/th/id/OIP.loqNhw71Vk_C-TiyWQJoKAHaKK?w=95&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (10, 'https://tse2.mm.bing.net/th/id/OIP._OiJHgI7cal4cWNHcCE9zAHaM2?w=115&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (11, 'https://tse2.mm.bing.net/th/id/OIP.B9RbuWnpmV-7fI8v-H0G8gHaEK?w=290&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (8, 'https://i.ytimg.com/vi/iWgPz7HZ-WA/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLBflPslog0bm-h3cOdRobgdZBeazA'); +INSERT INTO Image (id_img, imgPath) VALUES (9, 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/MClarkeDuncan021109-R106_%2850094589037%29.jpg/1200px-MClarkeDuncan021109-R106_%2850094589037%29.jpg'); +INSERT INTO Image (id_img, imgPath) VALUES (10, 'https://www.lesuricate.org/wp-content/uploads/2014/07/dragons-2.jpg'); +INSERT INTO Image (id_img, imgPath) VALUES (11, 'https://wallpaper.forfun.com/fetch/66/66580e0f71b67a64408bb525256d8843.jpeg'); INSERT INTO Image (id_img, imgPath) VALUES (12, 'https://tse2.mm.bing.net/th/id/OIP.RrJkua2jY_o24eUG7wmk8QHaE-?w=232&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (13, 'https://tse3.mm.bing.net/th/id/OIP.-1Ds-2D5GPiu9uejDdmgNgHaH3?w=124&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (14, 'https://tse3.mm.bing.net/th/id/OIP.BeQYJEP1pQKzHDLGhTLBtgHaFj?w=243&h=182&c=7&r=0&o=5&pid=1.7'); @@ -34,26 +34,26 @@ INSERT INTO Image (id_img, imgPath) VALUES (32, 'https://tse4.mm.bing.net/th/id/ INSERT INTO Image (id_img, imgPath) VALUES (33, 'https://tse2.mm.bing.net/th/id/OIP.79bf2opzc4vp3nvyKdI9QAHaHa?w=164&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (34, 'https://tse1.mm.bing.net/th/id/OIP.01EekTJQq0yQ9QQ_aNq87gHaJ-?w=162&h=218&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (35, 'https://tse4.mm.bing.net/th/id/OIP.ckCQ_jiHNatyzti0Fnq4PQHaED?w=317&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (36, 'https://tse3.mm.bing.net/th/id/OIP.QwHMbOI-N9zfJ_Re9I65ggHaJ1?w=140&h=187&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (36, 'https://pm1.aminoapps.com/6921/9eb8d851d100f9c6b8333f9b4e4408825e42d8b6r1-701-394v2_uhq.jpg'); INSERT INTO Image (id_img, imgPath) VALUES (37, 'https://tse2.mm.bing.net/th/id/OIP.3Je-oEIjxk44RyMF3nSi-gHaEK?w=289&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (38, 'https://tse2.mm.bing.net/th/id/OIP.jzIdpLlEe-MQogtqU8kAxAHaHa?w=149&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (39, 'https://tse3.mm.bing.net/th/id/OIP.IV9gltTWHTVtnezyCVXjwAHaJ4?w=120&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (40, 'https://tse2.mm.bing.net/th/id/OIP.s4nqc0QluImn7arGZTfurQHaI7?w=131&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (41, 'https://tse2.mm.bing.net/th/id/OIP.VGvVLSX6Yib-4x0JJOMWUQHaEK?w=305&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (42, 'https://tse2.mm.bing.net/th/id/OIP.2tQ82oaA3J3wmLyBBjrgWAHaJF?w=138&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (42, 'https://i.ytimg.com/vi/Ln-S6p-lQCs/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLBqG4sPNP_rx7-44m9FKJtxTL-5Xw'); INSERT INTO Image (id_img, imgPath) VALUES (43, 'https://tse3.mm.bing.net/th/id/OIP.gl3qdaf8Njvek6PM5AVgXgHaFj?w=228&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (44, 'https://tse3.mm.bing.net/th/id/OIP.J7Kmtok0f2mQT7iX_JA_5QHaE8?w=218&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (45, 'https://tse4.mm.bing.net/th/id/OIP.edxwKxyoPXfV7_DSTeerFAHaHa?w=180&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (46, 'https://tse4.mm.bing.net/th/id/OIP.OQFYbcxGZsFJlvLIT8jrLAHaDt?w=310&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (47, 'https://tse2.mm.bing.net/th/id/OIP.PziDszqyhWeRqKHDL8ouwgHaJ4?w=115&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (47, 'https://www.serieously.com/app/uploads/2023/02/gaston-la-belle-et-la-bete-disney.jpg?width=768&height=432&fit=cover'); INSERT INTO Image (id_img, imgPath) VALUES (48, 'https://tse1.mm.bing.net/th/id/OIP.uDr845hAlB9JoYe8i-DJ0QAAAA?w=294&h=170&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (49, 'https://tse4.mm.bing.net/th/id/OIP.nFqhuPIEX-oV0i8PWjC1DwHaEx?w=186&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (50, 'https://tse2.mm.bing.net/th/id/OIP.P5CMgdStIPfYvfNky4Kh7QHaLF?w=115&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (51, 'https://tse4.mm.bing.net/th/id/OIP._ROT4QN7TDwCQHn6OLEswAHaEK?w=299&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (51, 'https://www.indiewire.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-16-at-4.36.58-PM.png'); INSERT INTO Image (id_img, imgPath) VALUES (52, 'https://tse1.mm.bing.net/th/id/OIP.7ZWmLIPHcKWDZZjROnCh3AHaDF?w=287&h=145&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (53, 'https://tse2.mm.bing.net/th/id/OPEC.aBKNyvpNlyyj9g474C474?w=186&h=241&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (54, 'https://tse1.mm.bing.net/th/id/OIP.csFLWCPUhS7NhdJT8-Cq-QHaEL?w=270&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (55, 'https://tse4.mm.bing.net/th/id/OIP.3i5U6ihAOUsTFvLLT-RKtAHaJd?w=68&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (55, 'https://pm1.aminoapps.com/6934/51dccd2dcb8e60f52489446de42a9531a3d065c3r1-914-1168v2_uhq.jpg'); INSERT INTO Image (id_img, imgPath) VALUES (56, 'https://tse3.mm.bing.net/th/id/OIP.eYavZu8-Xp11x2Pod8v6bQHaKw?w=194&h=282&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (57, 'https://tse2.mm.bing.net/th/id/OIP.UKHYE8eX_v3E_G8OSFUcjQAAAA?w=142&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (58, 'https://tse2.mm.bing.net/th/id/OIP.s8Egh2FBsKGr6QdkdWEPnwHaE6?w=212&h=180&c=7&r=0&o=5&pid=1.7'); @@ -61,12 +61,12 @@ INSERT INTO Image (id_img, imgPath) VALUES (59, 'https://tse1.mm.bing.net/th/id/ INSERT INTO Image (id_img, imgPath) VALUES (60, 'https://tse4.mm.bing.net/th/id/OIP.vku_hB1875k65Vxs1GKm_wAAAA?w=333&h=184&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (61, 'https://tse4.mm.bing.net/th/id/OIP.lObXQdwuf5hDc_g40knCmQHaDt?w=348&h=174&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (62, 'https://tse2.mm.bing.net/th/id/OIP.xkBsnyA8BI1MgSGbQpFhOQAAAA?w=115&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (63, 'https://tse4.mm.bing.net/th/id/OIP.6XMc0WCQbJ5xbzekralK7gHaD4?w=301&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (64, 'https://tse2.mm.bing.net/th/id/OIP.ztKYa5HLhCKgVkY0GZ4rSAHaJ4?w=71&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (63, 'https://www.serieously.com/app/uploads/2022/10/jan-edgecomb-la-ligne-verte.jpg'); +INSERT INTO Image (id_img, imgPath) VALUES (64, 'https://static.wixstatic.com/media/065e6b_dd1a8624bd5b40c9848aeec671ed811b.png/v1/fill/w_568,h_444,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/065e6b_dd1a8624bd5b40c9848aeec671ed811b.png'); INSERT INTO Image (id_img, imgPath) VALUES (65, 'https://tse4.mm.bing.net/th/id/OIP.FKM9RHVwmPE_eTQm6cvlbgHaLL?w=115&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (66, 'https://tse3.mm.bing.net/th/id/OIP.pPDkRAfYT1rldQW1FRuxaAHaJQ?w=123&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (67, 'https://tse1.mm.bing.net/th/id/OIP.H7i5IHvFUZl9DgyVtITn_wHaEK?w=296&h=180&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (68, 'https://tse4.mm.bing.net/th/id/OIP.8My5fvsa2Z1P6oWhtJc6WQHaKl?w=127&h=181&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (68, 'https://liguedesofficiersdetatcivil.fr/wp-content/uploads/2016/12/rafiki.jpg'); INSERT INTO Image (id_img, imgPath) VALUES (69, 'https://tse1.mm.bing.net/th/id/OIP.k-xCm-NCW6Dxah3T2FlcFQHaEK?w=326&h=183&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (70, 'https://tse4.mm.bing.net/th/id/OIP._TZXuDVR3nHwrSJ9PPxJvAHaFO?w=230&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (71, 'https://tse2.mm.bing.net/th/id/OIP.l_zFAxgXMX9SnNDbFfXnqwHaFj?w=202&h=180&c=7&r=0&o=5&pid=1.7'); @@ -89,12 +89,12 @@ INSERT INTO Image (id_img, imgPath) VALUES (87, 'https://tse2.mm.bing.net/th/id/ INSERT INTO Image (id_img, imgPath) VALUES (88, 'https://tse3.mm.bing.net/th/id/OIP.raX8ZfSizmfVbeMrR0ghZgHaG2?w=173&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (89, 'https://tse4.mm.bing.net/th/id/OIP.iuYaquLDGgV_o3vDOphh-gHaLH?w=127&h=191&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (90, 'https://tse1.mm.bing.net/th/id/OIP.AzOPUHw61pXF-W3a1giYwAHaFH?w=194&h=134&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (91, 'https://tse2.mm.bing.net/th/id/OIP.oBoBPN1VKEeJglTjZbtRUAHaJ5?w=94&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (91, 'https://ds.static.rtbf.be/article/image/1248x1248/e/6/6/fa84632d742f2729dc32ce8cb5d49733-1702552617.jpg'); INSERT INTO Image (id_img, imgPath) VALUES (92, 'https://tse1.mm.bing.net/th/id/OIP.LTvVuaapKih6VpqAOtZudgHaK6?w=194&h=287&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (93, 'https://tse4.mm.bing.net/th/id/OIP.6PMXCMTZgkDKCkeY-NP6sAHaKB?w=145&h=197&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (93, 'https://www.lexpress.fr/resizer/v2/NX5EMUVUNVBXXLJUEEFNSRO5NI.jpg?auth=0d1b7c5c3950384f4ffc99bb87eebf0ac0105f91fdc68bb6557cef4b814d9534&width=1200&height=630&quality=85&smart=true'); INSERT INTO Image (id_img, imgPath) VALUES (94, 'https://tse2.mm.bing.net/th/id/OIP.N2JpjF9aPxvz9vZYEOjc2QHaFj?w=177&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (95, 'https://tse1.mm.bing.net/th/id/OIP.DNVVrGRcxyoXfy8Nqn4DnwHaJ4?w=194&h=259&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (96, 'https://tse3.mm.bing.net/th/id/OIP.GT8e1PVP9IQvdn49uMVgeAHaE0?w=262&h=180&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (96, 'https://media.gqmagazine.fr/photos/64907ade8e8457689a904913/1:1/w_720,h_720,c_limit/Forrest%20Gump.jpeg'); INSERT INTO Image (id_img, imgPath) VALUES (97, 'https://tse4.mm.bing.net/th/id/OIP.1mHiCYi8mwl6uzmVk0JZ3AHaJQ?w=141&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (98, 'https://tse3.mm.bing.net/th/id/OIP.wYPg61JNUvsouPzwUhr0-QHaHa?w=162&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (99, 'https://tse3.mm.bing.net/th/id/OIP.P4hzN60jIU4IQ7WnfJHN5AHaJQ?w=135&h=180&c=7&r=0&o=5&pid=1.7'); @@ -105,7 +105,8 @@ INSERT INTO Image (id_img, imgPath) VALUES (103, 'https://tse3.mm.bing.net/th/id INSERT INTO Image (id_img, imgPath) VALUES (104, 'https://tse1.mm.bing.net/th/id/OIP.Fzb2IGNnUPn1wc_ne1cqgAHaL2?w=119&h=191&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (105, 'https://tse2.mm.bing.net/th/id/OIP.zR4rzkK7q2wCcNwZd6jjegHaIC?w=163&h=180&c=7&r=0&o=5&pid=1.7'); INSERT INTO Image (id_img, imgPath) VALUES (106, 'https://tse2.mm.bing.net/th/id/OIP.UICndeUgBDrka76aTOvAKQHaLH?w=147&h=220&c=7&r=0&o=5&pid=1.7'); -INSERT INTO Image (id_img, imgPath) VALUES (107, 'https://tse1.mm.bing.net/th/id/OIP.c5hOJMCbBn2CugR3e1ltNQHaIh?w=194&h=223&c=7&r=0&o=5&pid=1.7'); +INSERT INTO Image (id_img, imgPath) VALUES (107, 'https://www.tomsguide.fr/content/uploads/sites/2/2021/05/batman-et-robin-mr-freeze.jpg'); + -- Insertion des utilisateurs dans la table Users et Admin INSERT INTO Users (id_user, username, email, password, img, creation) diff --git a/scripts/init.sql b/scripts/init.sql index 41000a8..c528752 100644 --- a/scripts/init.sql +++ b/scripts/init.sql @@ -18,7 +18,7 @@ DROP TABLE IF EXISTS Image; CREATE TABLE Image( id_img NUMERIC PRIMARY KEY, - imgPath varchar(100) NOT NULL UNIQUE + imgPath varchar(300) NOT NULL UNIQUE ); ------------------------------------------------------------------------- @@ -45,7 +45,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER IfUserIsAdmin ON Users; + Create Trigger IfUserIsAdmin BEFORE DELETE on Users FOR EACH ROW EXECUTE FUNCTION IfUserIsAdmin(); @@ -62,7 +62,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER DeleteUserFavorite ON Users; + Create Trigger DeleteUserFavorite BEFORE DELETE on Users FOR EACH ROW EXECUTE FUNCTION DeleteUserFavorite(); @@ -78,7 +78,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER DeleteUserCommentary ON Users; + Create Trigger DeleteUserCommentary BEFORE DELETE on Users FOR EACH ROW EXECUTE FUNCTION DeleteUserCommentary(); @@ -124,7 +124,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER DeleteQuiz ON Quiz; + Create Trigger DeleteQuiz BEFORE DELETE on Quiz FOR EACH ROW EXECUTE FUNCTION DeleteQuiz(); @@ -162,8 +162,8 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER NombreQuestionQuiz ON Quiz_Question; -Create Trigger NombreQuestionQuiz AFTER INSERT UPDATE DELETE on Quiz_Question + +Create Trigger NombreQuestionQuiz AFTER INSERT or UPDATE or DELETE on Quiz_Question FOR EACH ROW EXECUTE FUNCTION NombreQuestionQuiz(); @@ -229,7 +229,7 @@ BEGIN If OLD.id_quote in (Select citation_id From DailyQuote) Then - Update from DailyQuote + Update DailyQuote set citation_id = (Select id_quote From Quote Where id_quote!=OLD.id_quote @@ -242,7 +242,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER DeleteQuoteBEFORE ON Quote; + Create Trigger DeleteQuoteBEFORE BEFORE DELETE on Quote FOR EACH ROW EXECUTE FUNCTION DeleteQuoteBEFORE(); @@ -275,7 +275,7 @@ BEGIN END; $$ LANGUAGE plpgsql ; -DROP TRIGGER DeleteQuoteAFTER ON Quote; + Create Trigger DeleteQuoteAFTER AFTER DELETE on Quote FOR EACH ROW EXECUTE FUNCTION DeleteQuoteAFTER(); @@ -301,16 +301,16 @@ BEGIN Where id_quote!=OLD.id_quote ORDER BY RAND() LIMIT 1) ); - ELIF nb>1 + ELSE IF nb>1 then DELETE From DailyQuote where citation_id!=NEW.citation_id; END IF; - + RETURN NEW; END; $$ LANGUAGE plpgsql ; -DROP TRIGGER UniqueDailyQuote ON DailyQuote; -Create Trigger UniqueDailyQuote AFTER INSERT DELETE on DailyQuote + +Create Trigger UniqueDailyQuote AFTER INSERT or DELETE on DailyQuote FOR EACH ROW EXECUTE FUNCTION UniqueDailyQuote(); From bd40699067c5aa2847c10288666aa0ee76f9ab95 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Fri, 10 Jan 2025 11:35:20 +0100 Subject: [PATCH 11/11] test drone 10 --- .drone.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2d986e7..d53a850 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,6 +27,8 @@ steps: PGDATABASE: from_secret: db_database commands: - - apt-get update && apt-get install -y postgresql-client - - until pg_isready -h marocher8-dbWikiFantasy -U postgres; do sleep 1; done - - psql -h marocher8-dbWikiFantasy -U postgres -d wikifantasy -f script/init.sql + - apt-get update && apt-get install -y postgresql-client netcat + - getent hosts dbwikifantasy + - until nc -z dbwikifantasy 5432; do echo "Waiting for port 5432..."; sleep 5; done + - until pg_isready -h dbwikifantasy -U postgres; do echo "En attente de PostgreSQL..."; sleep 5; done + - psql -h dbwikifantasy -U postgres -d wikifantasy -f script/init.sql