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.
35 lines
1.2 KiB
35 lines
1.2 KiB
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: deploy-container-postgres
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
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
|
|
|
|
- name: init-database
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
environment:
|
|
PGPASSWORD:
|
|
from_secret: db_password
|
|
PGUSER:
|
|
from_secret: db_user
|
|
PGDATABASE:
|
|
from_secret: db_database
|
|
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
|