test drone
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
parent
75c761d040
commit
484ff86b0a
@ -1,26 +1,32 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Deploiement
|
name: default
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
steps:
|
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
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||||
environment:
|
environment:
|
||||||
IMAGENAME: postgres:17-alpine
|
IMAGENAME: postgres:13 # Choix de l'image PostgreSQL
|
||||||
CONTAINERNAME: wf-database
|
CONTAINERNAME: mypostgres # Nom du conteneur
|
||||||
COMMAND: create
|
COMMAND: create
|
||||||
OVERWRITE: false
|
|
||||||
PRIVATE: true
|
PRIVATE: true
|
||||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
|
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
|
||||||
from_secret: POSTGRES_PASSWORD
|
from_secret: db_password
|
||||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
|
|
||||||
from_secret: POSTGRES_DB
|
|
||||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
|
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
|
||||||
from_secret: POSTGRES_USER
|
from_secret: db_user
|
||||||
CODEFIRST_CLIENTDRONE_ENV_TRAEFIK_LABELS: true
|
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
|
||||||
ADMINS: marocher8, maximerocher , kentinbrongniart
|
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
|
||||||
|
Loading…
Reference in new issue