You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

4 months ago
kind: pipeline
type: docker
2 months ago
name: default
4 months ago
4 months ago
steps:
2 months ago
# 1. Déploiement du conteneur PostgreSQL
- name: deploy-container-postgres
3 months ago
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
4 months ago
environment:
2 months ago
IMAGENAME: postgres:13 # Choix de l'image PostgreSQL
CONTAINERNAME: mypostgres # Nom du conteneur
4 months ago
COMMAND: create
PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
2 months ago
from_secret: db_password
4 months ago
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
2 months ago
from_secret: db_user
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
from_secret: db_database
3 months ago
2 months ago
# 2. Initialisation de la base de données avec init.sql
2 months ago
- 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