test deploiement
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
c2e5e5abb1
commit
73be507fc9
@ -1,34 +1,31 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
name: deploy-postgres
|
||||
|
||||
steps:
|
||||
- name: deploy-container-postgres
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
services:
|
||||
- name: postgres
|
||||
image: postgres:15
|
||||
environment:
|
||||
IMAGENAME: postgres:13
|
||||
CONTAINERNAME: dbWikiFantasy
|
||||
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
|
||||
POSTGRES_DB:
|
||||
from_secret: POSTGRES_DB
|
||||
POSTGRES_USER:
|
||||
from_secret: POSTGRES_USER
|
||||
POSTGRES_PASSWORD:
|
||||
from_secret: POSTGRES_PASSWORD
|
||||
ports:
|
||||
- 5432
|
||||
|
||||
- name: init-database
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
steps:
|
||||
- name: verify-postgres
|
||||
image: postgres:15
|
||||
environment:
|
||||
PGPASSWORD:
|
||||
from_secret: db_password
|
||||
PGUSER:
|
||||
from_secret: db_user
|
||||
PGDATABASE:
|
||||
from_secret: db_database
|
||||
POSTGRES_DB:
|
||||
from_secret: POSTGRES_DB
|
||||
POSTGRES_USER:
|
||||
from_secret: POSTGRES_USER
|
||||
POSTGRES_PASSWORD:
|
||||
from_secret: POSTGRES_PASSWORD
|
||||
commands:
|
||||
- apt-get update && apt-get install -y postgresql-client netcat
|
||||
- getent hosts dbwikifantasy
|
||||
- until nc -z dbwikifantasy 5432; do echo "Waiting for port 5432..."; sleep 5; done
|
||||
- until pg_isready -h dbwikifantasy -U postgres; do echo "En attente de PostgreSQL..."; sleep 5; done
|
||||
- psql -h dbwikifantasy -U postgres -d wikifantasy -f script/init.sql
|
||||
- echo "Vérification de la connexion à PostgreSQL"
|
||||
- pg_isready -h postgres -p 5432 -U $POSTGRES_USER
|
||||
- psql -h postgres -U $POSTGRES_USER -d $POSTGRES_DB -c '\l
|
||||
|
@ -0,0 +1,17 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
environment:
|
||||
POSTGRES_DB: mydatabase
|
||||
POSTGRES_USER: myuser
|
||||
POSTGRES_PASSWORD: mypassword
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
Loading…
Reference in new issue