2019-08-10 17:16:24 +02:00
|
|
|
name: postgresql
|
|
|
|
user: postgres
|
2019-10-22 18:33:51 +02:00
|
|
|
command: postgres -D /srv/${ENVIRONMENT}/postgresql -k /tmp/postgresql-${ENVIRONMENT}
|
2019-08-10 17:16:24 +02:00
|
|
|
#stop-command: kill -HUP ${PID}
|
|
|
|
environment-variables:
|
|
|
|
- PGROOT=/srv/${ENVIRONMENT}/postgresql
|
2019-10-24 15:54:15 +02:00
|
|
|
provides: postgresql
|
2019-08-10 17:16:24 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
name: database directory creation
|
|
|
|
directory: /srv/${ENVIRONMENT}/postgresql
|
|
|
|
command: mkdir -p /srv/${ENVIRONMENT}/postgresql && chown postgres:postgres /srv/${ENVIRONMENT}/postgresql
|
|
|
|
|
|
|
|
%check
|
|
|
|
name: database creation
|
|
|
|
file: /srv/${ENVIRONMENT}/postgresql/base
|
2019-10-22 18:33:51 +02:00
|
|
|
command: su - postgres -c "initdb --locale en_US.UTF-8 -D '/srv/${ENVIRONMENT}/postgresql'" && rm /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
|
|
|
|
|
|
|
%check
|
|
|
|
name: database configuration
|
|
|
|
# once this file is created, there is no need to perform the command
|
|
|
|
file: /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
|
|
|
# gen-config inherits its parameters from the environment
|
|
|
|
command: gen-config postgresql.conf /srv/${ENVIRONMENT}/postgresql/postgresql.conf && chown postgres:postgres /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
2019-08-10 17:16:24 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
name: sockets directory
|
|
|
|
directory: /tmp/postgres-${ENVIRONMENT}
|
|
|
|
# FIXME: impose permissions
|
|
|
|
command: mkdir -p /tmp/postgresql-${ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-${ENVIRONMENT}
|
|
|
|
# FIXME: add postgresql-check-db-dir around here
|