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.
|
|
|
kind: pipeline
|
|
|
|
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
|
|
|
|
COMMAND: create
|
|
|
|
PRIVATE: true
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
|
|
|
|
from_secret: db_password
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
|
|
|
|
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:
|
|
|
|
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
|
|
|
|
|