|
|
|
@ -2,35 +2,20 @@ kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: deploy-postgresql
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
- name: postgresql
|
|
|
|
|
image: postgres:13
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER:
|
|
|
|
|
from_secret: db_user
|
|
|
|
|
POSTGRES_PASSWORD:
|
|
|
|
|
from_secret: db_password
|
|
|
|
|
POSTGRES_DB:
|
|
|
|
|
from_secret: db_database
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: wait-for-postgresql
|
|
|
|
|
image: busybox
|
|
|
|
|
commands:
|
|
|
|
|
- sleep 600 # Donne du temps au conteneur PostgreSQL pour démarrer
|
|
|
|
|
|
|
|
|
|
- name: check-database
|
|
|
|
|
image: postgres:13
|
|
|
|
|
- name: deploy-container-mysql
|
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER:
|
|
|
|
|
from_secret: db_user
|
|
|
|
|
POSTGRES_PASSWORD:
|
|
|
|
|
from_secret: db_password
|
|
|
|
|
POSTGRES_DB:
|
|
|
|
|
from_secret: db_database
|
|
|
|
|
commands:
|
|
|
|
|
# Essaie de se connecter au service PostgreSQL en utilisant le nom du service
|
|
|
|
|
- psql -h postgresql -U $POSTGRES_USER -d $POSTGRES_DB -c "SELECT 1;" || echo "Failed to connect using 'postgresql', trying localhost..."
|
|
|
|
|
|
|
|
|
|
# Si cela échoue, essaie de se connecter via localhost
|
|
|
|
|
- psql -h localhost -U $POSTGRES_USER -d $POSTGRES_DB -c "SELECT 1;" || echo "Failed to connect using localhost."
|
|
|
|
|
IMAGENAME: psql:13
|
|
|
|
|
CONTAINERNAME: mysql
|
|
|
|
|
COMMAND: create
|
|
|
|
|
# OVERWRITE: false
|
|
|
|
|
PRIVATE: true
|
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD:
|
|
|
|
|
from_secret: db_root_password
|
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE:
|
|
|
|
|
from_secret: db_database
|
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
|
|
|
|
|
from_secret: db_user
|
|
|
|
|
CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD:
|
|
|
|
|
from_secret: db_password
|