kind: pipeline type: docker name: deploy-postgres services: - name: postgres image: postgres:15 environment: POSTGRES_DB: mydatabase POSTGRES_USER: myuser POSTGRES_PASSWORD: mypassword ports: - 5432 steps: - name: verify-postgres image: postgres:15 environment: POSTGRES_DB: mydatabase POSTGRES_USER: myuser POSTGRES_PASSWORD: mypassword commands: - echo "Vérification de la connexion à PostgreSQL" - echo "POSTGRES_USER=myuser" - echo "POSTGRES_DB=mydatabase" - | until pg_isready -h postgres -p 5432 -U "myuser"; do echo "PostgreSQL n'est pas encore prêt, nouvelle tentative dans 2s..." sleep 2 done - echo "PostgreSQL est prêt !" - psql -h postgres -U "myuser" -d "mydatabase" -c '\l'