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.
41 lines
1.1 KiB
41 lines
1.1 KiB
kind: pipeline
|
|
type: docker
|
|
name: deploy-postgres
|
|
|
|
services:
|
|
- name: postgres
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_DB: wikifantasy3
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- 5432
|
|
|
|
steps:
|
|
- name: verify-postgres
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_DB: wikifantasy3
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
commands:
|
|
- echo "Vérification de la connexion à PostgreSQL"
|
|
- echo "POSTGRES_USER=postgres"
|
|
- echo "POSTGRES_DB=wikifantasy3"
|
|
- |
|
|
until pg_isready -h postgres -p 5432 -U postgres; do
|
|
echo "PostgreSQL n'est pas encore prêt, nouvelle tentative dans 2s..."
|
|
sleep 2
|
|
done
|
|
- echo "PostgreSQL est prêt !"
|
|
- PGPASSWORD="postgres" psql -h postgres -U postgres -d wikifantasy3 -c '\l'
|
|
|
|
- name: get-server-ip
|
|
image: alpine
|
|
commands:
|
|
- apk add --no-cache curl iproute2
|
|
- echo "Adresse IP publique du serveur :"
|
|
- curl ifconfig.me
|
|
- echo "Adresse IP locale du serveur :"
|
|
- ip addr show |