Skip to content

Commit

Permalink
Fix multiline compose command
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Mar 9, 2024
1 parent 7380f83 commit 15bd1f1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions stack/product/focus/resilience/compose.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@ services:
- source: postgres_data
target: /postgres/data
type: volume
entrypoint: []
command: |
bash <<EOF
if [ -z "$(ls -A /postgres/data)" ]; then
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -eu
if [ -n "$(ls -A /postgres/data)" ]; then
echo Do nothing
exit 0
else
echo Backing up...
fi
pg_basebackup --write-recovery-conf
--host {{ ops.storage.vendor }}-primary
--username {{ storage.dba.username }}
pg_basebackup --write-recovery-conf \
--host {{ ops.storage.vendor }}-primary \
--username {{ storage.dba.username }} \
--pgdata /postgres/data
EOF
labels:
image.key: db/{{ ops.storage.vendor }}/{{ devenv }}

Expand Down

0 comments on commit 15bd1f1

Please sign in to comment.