Skip to content

Commit 7e43a1e

Browse files
committed
If ENABLE_BARMAN is set to true, verify the other arguments are set and throw error if they aren't
1 parent 2e9d9db commit 7e43a1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

common/db/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ ARG BARMAN_HOST
77

88
ENV BARMAN_HOST=$BARMAN_HOST
99

10+
# Check if ENABLE_BARMAN is set to true, and if so, ensure other arguments are provided
11+
# Check if ENABLE_BARMAN is set to true, and if so, ensure other arguments are provided
12+
RUN if [ "$ENABLE_BARMAN" = "true" ]; then \
13+
: "${DB_SSH_PRIVATE_KEY:?DB_SSH_PRIVATE_KEY is not set}"; \
14+
: "${DB_SSH_PUBLIC_KEY:?DB_SSH_PUBLIC_KEY is not set}"; \
15+
: "${BARMAN_HOST:?BARMAN_HOST is not set}"; \
16+
fi
17+
1018
ADD config/postgresql.conf.template /etc/postgresql/postgresql.conf.template
1119
ADD config/pg_hba.conf.template /etc/postgresql/pg_hba.conf.template
1220

0 commit comments

Comments
 (0)