Skip to content

Commit

Permalink
Idempotent backup run
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Mar 9, 2024
1 parent 48eeab3 commit 7380f83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion baker/ansible/tasks/product/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ansible.builtin.command:
cmd: >-
mvn clean test
--activate-profiles {{ devenv }},{{ focus }}
--activate-profiles {{ focus }},{{ devenv }}
--no-snapshot-updates
--batch-mode
--also-make
Expand Down
15 changes: 10 additions & 5 deletions stack/product/focus/resilience/compose.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ services:
target: /postgres/data
type: volume
entrypoint: []
command: >-
pg_basebackup --write-recovery-conf
--host {{ ops.storage.vendor }}-primary
--username {{ storage.dba.username }}
--pgdata /postgres/data
command: |
bash <<EOF
if [ -z "$(ls -A /postgres/data)" ]; then
exit 0
fi
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 7380f83

Please sign in to comment.