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
|
||||
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
|
||||
|
Loading…
Reference in new issue